Camera

The connected Zivid camera. Capture, configure, and inspect a camera through this type.

See also

class Camera

Interface to one Zivid camera.

See Settings and Settings2D for a list of settings that can be configured in the camera. Capture frames by calling capture.

Public Functions

Camera()

Constructor.

~Camera()

Destructor.

Camera(const Camera &other) noexcept

Copy constructor.

Camera &operator=(const Camera &other) noexcept

Copy assignment.

Camera(Camera &&other) noexcept

Move constructor.

Camera &operator=(Camera &&other) noexcept

Move assignment operator.

Camera &connect()

Connect to the camera.

void disconnect()

Disconnect from the camera and free all resources associated with it.

void closeAperture()

Close the camera's aperture.

The aperture will be opened again on the next call to capture.

CameraState state() const

Get the current camera state.

返回:

The current camera state

Frame capture2D3D(const Settings &settings)

Capture a 2D+3D frame.

This method captures both a 3D point cloud and a 2D color image. Use this method when you want to capture colored point clouds. This method will throw if Settings::Color is not set. Use capture3D(const Settings &settings) for capturing a 3D point cloud without a 2D color image.

These remarks below apply for all capture functions:

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. Therefore, after this method has returned, the camera can be moved, or objects in the scene can be moved, or a capture from another camera with overlapping field of view can be triggered, without affecting the point cloud.

When this method returns, there is still remaining data to transfer from the camera to the PC, and the processing of the final point cloud is not completed. Transfer and processing of the point cloud will continue in the background. When you call a method on the returned Frame object that requires the capture to be finished, for example Frame::pointCloud(), that method will block until the processing is finished and the point cloud is available. If an exception occurs after the acquisition of images is complete (during transfer or processing of the capture), then that exception is instead thrown when you access the Frame object.

The capture functions can be invoked back-to-back, for doing rapid back-to-back acquisition of multiple (2D or 3D) captures on the same camera. This is for example useful if you want to do one high-resolution 2D capture followed by a lower-resolution 3D capture. The acquisition of the next capture will begin quickly after acquisition of the previous capture completed, even when there is remaining transfer and processing for the first capture. This allows pipelining several 2D and/or 3D captures, by doing acquisition in parallel with data transfer and processing.

Note: There can be maximum of two in-progress uncompleted 3D (or 2D+3D) captures simultaneously per Zivid camera. If you invoke capture2D3D or capture3D when there are two uncompleted 3D captures in-progress, then the capture will not start until the first of the in-progress 3D captures has finished all transfer and processing. There is a similar limit of maximum two in-process 2D captures per camera.

Capture functions can be called from multiple threads at the same time, for example by using std::async. Multiple capture commands on the same camera object from different threads will be queued and executed in order (first in, first out).

Capture functions can also be called on multiple cameras simultaneously. However, if the cameras have overlapping field-of-view then you need to take consideration and sequence the capture calls to avoid the captures interfering with each other.

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 3D point cloud, a 2D color image, and metadata

Frame capture3D(const Settings &settings)

Capture a single 3D frame.

This method is used to capture a 3D frame without a 2D color image. It ignores all color settings in the input settings. See capture2D3D(const Settings &settings) for capturing a 2D+3D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of capture2D3D(const Settings &settings) above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 3D point cloud and metadata

Frame2D capture2D(const Settings &settings)

Capture a single 2D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of capture2D3D(const Settings &settings) above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

This overload is provided for convenience. Note that only the Settings2D part under Settings::Color will be used for the capture. The other parts of the settings will be ignored.

This method will throw if Settings::Color is not set.

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 2D image and metadata

Frame2D capture2D(const Settings2D &settings2D)

Capture a single 2D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of capture2D3D(const Settings &settings) above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

参数:

settings2D -- Settings2D to use for the capture

返回:

A frame containing a 2D image and metadata

Frame capture(const Settings &settings)

Capture a single frame.

This method is deprecated as of SDK 2.14, and will be removed in the next SDK major version (3.0). Use capture2D3D(const Settings &settings) instead for capturing 2D+3D frames or use capture3D(const Settings &settings) for capturing 3D frames without a 2D color image.

capture returns a frame containing a 3D point cloud, and optionally a 2D color image. The 2D color image is captured by default. To disable the 2D color image capture, set Settings::Sampling::Color to Settings::Sampling::Color::disabled.

This method shares the common remarks about capture functions as found in the "Remarks" section of capture2D3D(const Settings &settings).

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 3D point cloud and metadata. Depending on the settings, the frame may also contain a 2D color image.

inline Frame2D capture(const Settings2D &settings2D)

Capture a single 2D frame.

This method is deprecated as of SDK 2.14, and will be removed in the next SDK major version (3.0). It is replaced by capture2D(const Settings2D &settings2D).

This method shares the common remarks about capture functions as found in the "Remarks" section of capture2D3D(const Settings &settings).

参数:

settings2D -- Settings2D to use for the capture

返回:

A frame containing a 2D image and metadata

CameraInfo info() const

Get information about camera model, serial number etc.

void writeUserData(const std::vector<uint8_t> &data)

Write user data to camera.

The total number of writes supported depends on camera model and size of data.

std::vector<uint8_t> userData() const

Read user data from camera.

NetworkConfiguration networkConfiguration() const

Get the network configuration from the camera.

void applyNetworkConfiguration(const NetworkConfiguration &networkConfiguration)

Applies the specified network configuration to the camera.

applyNetworkConfiguration will block until the camera has finished applying the network configuration, or throw an exception if the camera does not reappear on the network before a timeout occurs.

applyNetworkConfiguration can be used even if the camera is inaccessible via TCP/IP, for example a camera that is on a different subnet to the PC, or a camera with an IP conflict, as it uses UDP multicast to communicate with the camera.

applyNetworkConfiguration can also be used to configure cameras that require a firmware update, as long as the firmware supports network configuration via UDP multicast. This has been supported on all firmware versions included with SDK 2.10.0 or newer. This method will throw an exception if the camera firmware is too old to support UDP multicast.

applyNetworkConfiguration will throw an exception if the camera status (see CameraState::Status) is "busy", "connected", "connecting" or "disconnecting". If the status is "connected", then you must first call disconnect() before calling this method.

参数:

networkConfiguration -- The network configuration to apply to the camera.

SceneConditions measureSceneConditions()

Measure and analyze the conditions of the scene.

The returned value will report if noticeable ambient light flicker indicative of a 50 Hz or 60 Hz power grid was detected. If light flicker is detected in the scene, it is recommended to use capture settings that are optimized for that power grid frequency.

measureSceneConditions will throw an exception if the camera status (see CameraState::Status) is not "connected".

返回:

The current scene conditions.

CameraHealth checkHealth()

Run health checks on the camera and return a severity report.

The returned CameraHealth contains an aggregated CameraHealth::Overall severity, along with the severity of each individual check (link, temperatures, fan, memory and infield verification). Each check uses the four-level severity scale ok, suboptimal, error, unknown. The Overall value is the worst severity across all populated checks.

checkHealth will throw an exception if the camera status (see CameraState::Status) is not "connected".

返回:

The current health check report.

std::string toString() const

Get string representation of the camera info.

返回:

Camera info as string

bool operator==(const Camera &other) const

Check if two camera instances represent the same device.

bool operator!=(const Camera &other) const

Check if two camera instances represent different devices.

class Camera

Interface to one Zivid camera.

See Settings and Settings2D for a list of settings that can be configured in the camera. Capture frames by calling Camera::Capture(Settings ^) or Camera::Capture(Settings2D ^).

Public Functions

delegate void UpdateSettingsDelegate (Settings ^ settings)

Delegate function for updating settings.

参数:

settings -- New settings for the camera

Camera(const Zivid::Camera &cppInstance)

summary>Connect to the camera

void Disconnect()

Disconnect from the camera and free all resources associated with it.

void CloseAperture()

Close the camera's aperture.

The aperture will be opened again on the next call to Camera::Capture(Settings ^) or Camera::Capture(Settings2D ^).

Frame ^ Capture2D3D (Settings ^ settings)

Capture a 2D+3D frame.

This method captures both a 3D point cloud and a 2D color image. Use this method when you want to capture colored point clouds. This method will throw if Settings::Color is not set. Use Capture3D(const Settings &settings) for capturing a 3D point cloud without a 2D color image.

These remarks below apply for all capture functions:

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. Therefore, after this method has returned, the camera can be moved, or objects in the scene can be moved, or a capture from another camera with overlapping field of view can be triggered, without affecting the point cloud.

When this method returns, there is still remaining data to transfer from the camera to the PC, and the processing of the final point cloud is not completed. Transfer and processing of the point cloud will continue in the background. When you call a method on the returned Frame object that requires the capture to be finished, for example Frame::PointCloud(), that method will block until the processing is finished and the point cloud is available. If an exception occurs after the acquisition of images is complete (during transfer or processing of the capture), then that exception is instead thrown when you access the Frame object.

The capture functions can be invoked back-to-back, for doing rapid back-to-back acquisition of multiple (2D or 3D) captures on the same camera. This is for example useful if you want to do one high-resolution 2D capture followed by a lower-resolution 3D capture. The acquisition of the next capture will begin quickly after acquisition of the previous capture completed, even when there is remaining transfer and processing for the first capture. This allows pipelining several 2D and/or 3D captures, by doing acquisition in parallel with data transfer and processing.

Note: There can be maximum of two in-progress uncompleted 3D (or 2D+3D) captures simultaneously per Zivid camera. If you invoke Capture2D3D or Capture3D when there are two uncompleted 3D captures in-progress, then the capture will not start until the first of the in-progress 3D captures has finished all transfer and processing. There is a similar limit of maximum two in-process 2D captures per camera.

Capture functions can be called from multiple threads at the same time. Multiple capture commands on the same camera object from different threads will be queued and executed in order (first in, first out).

Capture functions can also be called on multiple cameras simultaneously. However, if the cameras have overlapping field-of-view then you need to take consideration and sequence the capture calls to avoid the captures interfering with each other.

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 3D point cloud, a 2D color image, and metadata

Frame ^ Capture3D (Settings ^ settings)

Capture a single 3D frame.

This method is used to capture a 3D frame without a 2D color image. It ignores all color settings in the input settings. See Capture2D3D(Settings ^settings) for capturing a 2D+3D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of Capture2D3D(Settings ^settings) above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 3D point cloud and metadata

Frame2D ^ Capture2D (Settings ^ settings)

Capture a single 2D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of Capture2D3D(Settings ^settings) above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

This overload is provided for convenience. Note that only the Settings2D part under Settings::Color will be used for the capture. The other parts of the settings will be ignored.

This method will throw if Settings::Color is not set.

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 2D image and metadata

Frame2D ^ Capture2D (Settings2D ^ settings2D)

Capture a single 2D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of Capture2D3D(Settings ^settings) above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

参数:

settings2D -- Settings2D to use for the capture

返回:

A frame containing a 2D image and metadata

Frame ^ Capture (Settings ^ settings)

Capture a single frame.

This method is deprecated as of SDK 2.14, and will be removed in the next SDK major version (3.0). Use Capture2D3D(Settings ^settings) instead for capturing 2D+3D frames or use Capture3D(Settings ^settings) for capturing 3D frames without a 2D color image.

capture returns a frame containing a 3D point cloud, and optionally a 2D color image. The 2D color image is captured by default. To disable the 2D color image capture, set Settings::SamplingGroup::ColorOption to Settings::SamplingGroup::ColorOption::Disabled.

This method shares the common remarks about capture functions as found in the "Remarks" section of Capture2D3D(Settings ^settings).

参数:

settings -- Settings to use for the capture

返回:

A frame containing a 3D point cloud and metadata. Depending on the settings, the frame may also contain a 2D color image.

Frame2D ^ Capture (Settings2D ^ settings2D)

Capture a single 2D frame.

This method is deprecated as of SDK 2.14, and will be removed in the next SDK major version (3.0). Use Capture2D(Settings2D ^settings2D) instead.

This method shares the common remarks about capture functions as found in the "Remarks" section of Capture2D3D(Settings ^settings).

参数:

settings2D -- Settings2D to use for the capture

返回:

A frame containing a 2D image and metadata

System::String ^ ToString () override

Get string representation of the camera info.

返回:

Camera info as string

void WriteUserData (System::Collections::Generic::IEnumerable< byte > ^ data)

Write user data to camera.

The total number of writes supported depends on camera model and size of data

void ApplyNetworkConfiguration (Zivid::NET::NetworkConfiguration ^ networkConfiguration)

Applies the specified network configuration to the camera.

ApplyNetworkConfiguration will block until the camera has finished applying the network configuration, or throw an exception if the camera does not reappear on the network before a timeout occurs.

ApplyNetworkConfiguration can be used even if the camera is inaccessible via TCP/IP, for example a camera that is on a different subnet to the PC, or a camera with an IP conflict, as it uses UDP multicast to communicate with the camera.

ApplyNetworkConfiguration can also be used to configure cameras that require a firmware update, as long as the firmware supports network configuration via UDP multicast. This has been supported on all firmware versions included with SDK 2.10.0 or newer. This method will throw an exception if the camera firmware is too old to support UDP multicast.

ApplyNetworkConfiguration will throw an exception if the camera status (see CameraState::Status) is "Busy", "Connected", "Connecting" or "Disconnecting". If the status is "Connected", then you must first call Disconnect() before calling this method.

参数:

networkConfiguration -- The network configuration to apply to the camera.

SceneConditions ^ MeasureSceneConditions ()

Measure and analyze the conditions of the scene.

The returned value will report if noticeable ambient light flicker indicative of a 50 Hz or 60 Hz power grid was detected. If light flicker is detected in the scene, it is recommended to use capture settings that are optimized for that power grid frequency.

MeasureSceneConditions will throw an exception if the camera status (see CameraState::Status) is not "Connected".

返回:

The current scene conditions.

CameraHealth ^ CheckHealth ()

Run health checks on the camera and return a severity report.

The returned CameraHealth contains an aggregated CameraHealth::Overall severity, along with the severity of each individual check (link, temperatures, fan, memory and infield verification). Each check uses the four-level severity scale Ok, Suboptimal, Error, Unknown. The Overall value is the worst severity across all populated checks.

CheckHealth will throw an exception if the camera status (see CameraState::Status) is not "connected".

返回:

The current health check report.

Properties

CameraState^ State

Current camera state.

CameraInfo^ Info

Information about camera model, serial number etc.

System::Collections::Generic::IList< byte >^ UserData

Read user data from camera.

Zivid::NET::NetworkConfiguration^ NetworkConfiguration

Get the network configuration from the camera.

class Camera(impl)

Interface to one Zivid camera.

This class cannot be initialized directly by the end-user. Use methods on the Application class to obtain a Camera instance.

apply_network_configuration(
network_configuration: NetworkConfiguration,
) None

Apply the network configuration to the camera.

参数:

network_configuration (NetworkConfiguration) -- The network configuration to apply to the camera.

This method blocks until the camera has finished applying the network configuration, or raises an exception if the camera does not reappear on the network before a timeout occurs.

This method can be used even if the camera is inaccessible via TCP/IP, for example a camera that is on a different subnet to the PC, or a camera with an IP conflict, as it uses UDP multicast to communicate with the camera.

This method can also be used to configure cameras that require a firmware update, as long as the firmware supports network configuration via UDP multicast. This has been supported on all firmware versions included with SDK 2.10.0 or newer. This method will raise an exception if the camera firmware is too old to support UDP multicast.

This method will raise an exception if the camera status (see CameraState.Status) is "busy", "connected", "connecting" or "disconnecting". If the status is "connected", then you must first call disconnect() before calling this method.

抛出:

TypeError -- If the provided network_configuration is not an instance of NetworkConfiguration.

capture(
settings: Settings | Settings2D,
) Frame | Frame2D

Capture a single frame or a single 2D frame.

This method is deprecated as of SDK 2.14, and will be removed in the next SDK major version (3.0). Use capture_2d_3d instead for capturing 2D+3D frames, use capture_3d for capturing 3D frames without a 2D color image, or use capture_2d for capturing a 2D color image only.

This method shares the common remarks about capture functions as found under capture_2d_3d.

参数:

settings -- Settings to be used to capture. Can be either a Settings or Settings2D instance

返回:

A Frame containing a 3D image plus metadata or a Frame2D containing a 2D image plus metadata.

抛出:

TypeError -- If argument is neither a Settings or a Settings2D

capture_2d(
settings: Settings | Settings2D,
) Frame2D

Capture a single 2D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of capture_2d_3d above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

参数:

settings -- Settings to use for the capture. Can be either a Settings2D instance or a Settings instance. If a Settings instance is provided, only the Settings.color part is used. An exception is thrown if the Settings.color part is not set.

返回:

A Frame2D containing a 2D image and metadata

抛出:

TypeError -- If the settings argument is not a Settings2D or a Settings.

capture_2d_3d(settings: Settings) Frame

Capture a 2D+3D frame.

This method captures both a 3D point cloud and a 2D color image. Use this method when you want to capture colored point clouds. This method will throw if Settings.color is not set. Use capture_3d for capturing a 3D point cloud without a 2D color image.

These remarks below apply for all capture functions:

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. Therefore, after this method has returned, the camera can be moved, or objects in the scene can be moved, or a capture from another camera with overlapping field of view can be triggered, without affecting the point cloud.

When this method returns, there is still remaining data to transfer from the camera to the PC, and the processing of the final point cloud is not completed. Transfer and processing of the point cloud will continue in the background. When you call a method on the returned Frame object that requires the capture to be finished, for example Frame.point_cloud, that method will block until the processing is finished and the point cloud is available. If an exception occurs after the acquisition of images is complete (during transfer or processing of the capture), then that exception is instead thrown when you access the Frame object.

The capture functions can be invoked back-to-back, for doing rapid back-to-back acquisition of multiple (2D or 3D) captures on the same camera. This is for example useful if you want to do one high-resolution 2D capture followed by a lower-resolution 3D capture. The acquisition of the next capture will begin quickly after acquisition of the previous capture completed, even when there is remaining transfer and processing for the first capture. This allows pipelining several 2D and/or 3D captures, by doing acquisition in parallel with data transfer and processing.

Note: There can be maximum of two in-progress uncompleted 3D (or 2D+3D) captures simultaneously per Zivid camera. If you invoke capture_2d_3d or capture_3d when there are two uncompleted 3D captures in-progress, then the capture will not start until the first of the in-progress 3D captures has finished all transfer and processing. There is a similar limit of maximum two in-process 2D captures per camera.

Capture functions can also be called on multiple cameras simultaneously. However, if the cameras have overlapping field-of-view then you need to take consideration and sequence the capture calls to avoid the captures interfering with each other.

参数:

settings -- Settings to use for the capture.

返回:

A frame containing a 3D point cloud, a 2D color image, and metadata.

抛出:

TypeError -- If the settings argument is not a Settings instance.

capture_3d(settings: Settings) Frame

Capture a single 3D frame.

This method is used to capture a 3D frame without a 2D color image. It ignores all color settings in the input settings. See capture_2d_3d for capturing a 2D+3D frame.

This method returns right after the acquisition of the images is complete, and the camera has stopped projecting patterns. For more information, see the remarks section of capture_2d_3d above. Those remarks apply for both 2D, 3D, and 2D+3D captures.

参数:

settings -- Settings to use for the capture.

返回:

A frame containing a 3D point cloud and metadata.

抛出:

TypeError -- If the settings argument is not a Settings

check_health() CameraHealth

Run health checks on the camera and return a severity report.

The returned CameraHealth contains an aggregated overall severity, along with the severity of each individual check (link, temperatures, fan, memory and infield verification). Each check uses the four-level severity scale "OK", "Suboptimal", "Error", "Unknown". The overall value is the worst severity across all populated checks.

check_health will raise a RuntimeException if the camera status (see CameraState.Status) is not "connected".

返回:

The current health check report as a CameraHealth instance.

connect() Camera

Connect to the camera.

返回:

Reference to the same Camera instance (for chaining)

disconnect() None

Disconnect from the camera and free all resources associated with it.

property info: CameraInfo

Get information about camera model, serial number etc.

返回:

A CameraInfo instance

measure_scene_conditions() SceneConditions

Measure and analyze the conditions of the scene.

The returned value will report if noticeable ambient light flicker indicative of a 50 Hz or 60 Hz power grid was detected. If light flicker is detected in the scene, it is recommended to use capture settings that are optimized for that power grid frequency.

measure_scene_conditions will raise a RuntimeException if the camera status (see CameraState.Status) is not "connected".

返回:

The current scene conditions.

property network_configuration: NetworkConfiguration

Get the network configuration of the camera.

返回:

NetworkConfiguration instance

release() None

Release the underlying resources.

property state: CameraState

Get the current camera state.

返回:

A CameraState instance

property user_data: bytes

Read user data from camera.

返回:

User data as 'bytes' object

write_user_data(user_data: bytes) None

Write user data to camera. The total number of writes supported depends on camera model and size of data.

参数:

user_data -- User data as 'bytes' object

抛出:

TypeError -- Unsupported type provided for user data