Mech-Eye API 2.4.0
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
mmind::eye::Camera Class Reference

Operates the camera. Use Camera::connect to connect an available camera, and then call the corresponding methods to perform data acquisition, configure parameters, and so on. More...

#include <Camera.h>

Public Member Functions

 Camera ()
 Constructor.
 
 ~Camera ()
 Destructor.
 
 Camera (const Camera &other) noexcept
 Copy constructor.
 
Cameraoperator= (const Camera &other) noexcept
 Copy assignment.
 
ErrorStatus connect (const CameraInfo &info, unsigned int timeoutMs=5000)
 Connects to a camera using CameraInfo.
 
ErrorStatus connect (const std::string &ipAddress, unsigned int timeoutMs=5000)
 Connects to a camera using the IP address.
 
void disconnect ()
 Disconnects from the camera and releases the associated resources.
 
ErrorStatus setHeartbeatInterval (unsigned int timeIntervalMs)
 Sets the time interval at which the client sends periodic heartbeat messages to the camera side. The default time interval is 10s.
 
ErrorStatus getCameraInfo (CameraInfo &info) const
 Gets the basic information of the camera, such as the model, serial number, firmware version, and IP configuration.
 
ErrorStatus getCameraStatus (CameraStatus &status) const
 Gets various statuses of the camera.
 
ErrorStatus getCameraIntrinsics (CameraIntrinsics &intrinsics) const
 Gets the camera intrinsic parameters. The camera intrinsic parameters include the intrinsic parameters of the texture 2D camera and the intrinsic parameters of the depth 2D camera(s) based on the pinhole camera model, which correspond to the 2D and 3D capture results Frame2D and Frame3D. The camera intrinsic parameters also include the transformation relationship between the texture 2D camera and depth 2D camera(s).
 
ErrorStatus getCameraResolutions (CameraResolutions &resolutions) const
 Gets the image resolutions of the camera. Two image resolutions are provided, 2D image (texture) and depth map, which correspond to the 2D and 3D capture results Frame2D and Frame3D.
 
UserSetcurrentUserSet ()
 Gets the UserSet currently in use.Through UserSet, you can access all available parameters of the camera related to 2D and 3D data acquisition. You can also use UserSet to directly set and get the parameter values instead of using Parameter interface.
 
UserSetManageruserSetManager ()
 Gets the UserSetManager of the camera. UserSetManager provides various operations for managing all user sets saved in the camera, including adding and deleting user sets and selecting the user set to be used. It also provides the methods for saving all user sets to a JSON file and load all user sets from a JSON file.
 
ErrorStatus capture3D (Frame3D &frame3D, unsigned int timeoutMs=5000) const
 Projects structured light and captures a single 3D frame. 3D information is computed on the camera. The result is retrieved after the computation is completed.
 
ErrorStatus capture3DWithNormal (Frame3D &frame3D, unsigned int timeoutMs=10000) const
 Projects structured light and captures a single 3D frame. 3D information and normal vector are computed on the camera. The result is retrieved after the computation is completed.
 
ErrorStatus capture2D (Frame2D &frame2D, unsigned int timeoutMs=5000) const
 Captures a single 2D frame using the 2D camera in the 3D camera. The result is retrieved after the capture is completed.
 
ErrorStatus capture2DAnd3D (Frame2DAnd3D &frame2DAnd3D, unsigned int timeoutMs=10000) const
 Simultaneously captures a single 2D frame and 3D frame. 3D information is computed on the camera. Both 2D and 3D capture results are retrieved after the capturing and computation processes are completed. Using this method, you can easily generate the textured point cloud from both 2D and 3D data.
 
ErrorStatus capture2DAnd3DWithNormal (Frame2DAnd3D &frame2DAnd3D, unsigned int timeoutMs=15000) const
 Simultaneously captures a single 2D frame and 3D frame. 3D information and normal vector are computed on the camera. Both 2D and 3D capture results are retrieved after the capturing and computation processes are completed. Using this method, you can easily generate the texture point cloud from both 2D and 3D data.
 
ErrorStatus captureStereo2D (Frame2D &left, Frame2D &right, bool isRectified=false, unsigned int timeoutMs=5000) const
 Captures the 2D images from both 2D cameras in the 3D camera. This method is only available for DEEP, LSR S, LSR L, and PRO XS.
 
ErrorStatus setPointCloudUnit (CoordinateUnit unit)
 Sets the unit of the point cloud.
 
ErrorStatus getPointCloudUnit (CoordinateUnit &unit) const
 Gets the current unit of the point cloud.
 

Static Public Member Functions

static std::vector< CameraInfodiscoverCameras ()
 Discovers all available cameras and returns the list of information of all available cameras. If a camera is not successfully discovered, please check the network connection and indicator lights on the camera.
 

Friends

class HandEyeCalibration
 
class CameraEvent
 
class InternalInterfaces
 

Detailed Description

Operates the camera. Use Camera::connect to connect an available camera, and then call the corresponding methods to perform data acquisition, configure parameters, and so on.

Definition at line 54 of file Camera.h.

Member Function Documentation

◆ capture2D()

ErrorStatus mmind::eye::Camera::capture2D ( Frame2D & frame2D,
unsigned int timeoutMs = 5000 ) const

Captures a single 2D frame using the 2D camera in the 3D camera. The result is retrieved after the capture is completed.

Parameters
[out]frame2DThe capture result. See Frame2D for details.
[in]timeoutMsThe timeout period (in ms) for the capturing process. If no data is received within the timeout period, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ capture2DAnd3D()

ErrorStatus mmind::eye::Camera::capture2DAnd3D ( Frame2DAnd3D & frame2DAnd3D,
unsigned int timeoutMs = 10000 ) const

Simultaneously captures a single 2D frame and 3D frame. 3D information is computed on the camera. Both 2D and 3D capture results are retrieved after the capturing and computation processes are completed. Using this method, you can easily generate the textured point cloud from both 2D and 3D data.

Parameters
[out]frame2DAnd3DThe capture result containing Frame2D and Frame3D. See Frame2DAnd3D for details.
[in]timeoutMsThe timeout period (in ms) for the capturing process. If no data is received within the timeout period, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ capture2DAnd3DWithNormal()

ErrorStatus mmind::eye::Camera::capture2DAnd3DWithNormal ( Frame2DAnd3D & frame2DAnd3D,
unsigned int timeoutMs = 15000 ) const

Simultaneously captures a single 2D frame and 3D frame. 3D information and normal vector are computed on the camera. Both 2D and 3D capture results are retrieved after the capturing and computation processes are completed. Using this method, you can easily generate the texture point cloud from both 2D and 3D data.

Parameters
[out]frame2DAnd3DThe capture result containing Frame2D and Frame3D. See Frame2DAnd3D for details.
[in]timeoutMsThe timeout period (in ms) for the capturing process. If no data is received within the timeout period, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ capture3D()

ErrorStatus mmind::eye::Camera::capture3D ( Frame3D & frame3D,
unsigned int timeoutMs = 5000 ) const

Projects structured light and captures a single 3D frame. 3D information is computed on the camera. The result is retrieved after the computation is completed.

Parameters
[out]frame3DThe capture result. See Frame3D for details.
[in]timeoutMsThe timeout period (in ms) for the capturing process. If no data is received within the timeout period, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ capture3DWithNormal()

ErrorStatus mmind::eye::Camera::capture3DWithNormal ( Frame3D & frame3D,
unsigned int timeoutMs = 10000 ) const

Projects structured light and captures a single 3D frame. 3D information and normal vector are computed on the camera. The result is retrieved after the computation is completed.

Parameters
[out]frame3DThe capture result. See Frame3D for details.
[in]timeoutMsThe timeout period (in ms) for the capturing process. If no data is received within the timeout period, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ captureStereo2D()

ErrorStatus mmind::eye::Camera::captureStereo2D ( Frame2D & left,
Frame2D & right,
bool isRectified = false,
unsigned int timeoutMs = 5000 ) const

Captures the 2D images from both 2D cameras in the 3D camera. This method is only available for DEEP, LSR S, LSR L, and PRO XS.

Since
V2.2.1
Parameters
[out]leftThe 2D image of the left 2D camera. See Frame2D for details.
[out]rightThe 2D image of the right 2D camera. See Frame2D for details.
[in]isRectifiedWhether to perform stereo rectification. After the rectification, The left image and the depth map are aligned pixel-to-pixel. If true, the rectified 2D images are returned. If false, the original images are returned.
[in]timeoutMsThe timeout period (in ms) for the capturing process. If no data is received within the timeout period, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.
Note
Different camera models have different parameters for adjusting the exposure of these 2D images. For DEEP, LSR S, and LSR L, adjust DepthSourceExposureMode and DepthSourceExposureTime. For the other models, adjust ExposureMode and ExposureTime.

◆ connect() [1/2]

ErrorStatus mmind::eye::Camera::connect ( const CameraInfo & info,
unsigned int timeoutMs = 5000 )

Connects to a camera using CameraInfo.

Parameters
[in]infoThe information of the camera to be connected. You can use Camera::discoverCameras to discover all available cameras.
[in]timeoutMsThe timeout period (in ms) for connecting to a camera. If the camera connection does not succeed after the timeout period has passed, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_INPUT_ERROR IP address format error.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE IP address not corresponding to an available device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ connect() [2/2]

ErrorStatus mmind::eye::Camera::connect ( const std::string & ipAddress,
unsigned int timeoutMs = 5000 )

Connects to a camera using the IP address.

Parameters
[in]ipAddressThe IP address of the camera to be connected. The format of a valid IP address: 100.100.1.1.
[in]timeoutMsThe timeout period (in ms) for connecting to a camera. If the camera connection does not succeed after the timeout period has passed, this method returns ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_INPUT_ERROR IP address format error.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE IP address not corresponding to an available device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ currentUserSet()

UserSet & mmind::eye::Camera::currentUserSet ( )

Gets the UserSet currently in use.Through UserSet, you can access all available parameters of the camera related to 2D and 3D data acquisition. You can also use UserSet to directly set and get the parameter values instead of using Parameter interface.

Returns
See UserSet for details.

◆ discoverCameras()

static std::vector< CameraInfo > mmind::eye::Camera::discoverCameras ( )
static

Discovers all available cameras and returns the list of information of all available cameras. If a camera is not successfully discovered, please check the network connection and indicator lights on the camera.

Returns
The list of information of all available cameras.

◆ getCameraInfo()

ErrorStatus mmind::eye::Camera::getCameraInfo ( CameraInfo & info) const

Gets the basic information of the camera, such as the model, serial number, firmware version, and IP configuration.

Parameters
[out]SeeCameraInfo for details.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.

◆ getCameraIntrinsics()

ErrorStatus mmind::eye::Camera::getCameraIntrinsics ( CameraIntrinsics & intrinsics) const

Gets the camera intrinsic parameters. The camera intrinsic parameters include the intrinsic parameters of the texture 2D camera and the intrinsic parameters of the depth 2D camera(s) based on the pinhole camera model, which correspond to the 2D and 3D capture results Frame2D and Frame3D. The camera intrinsic parameters also include the transformation relationship between the texture 2D camera and depth 2D camera(s).

Parameters
[out]SeeCameraIntrinsics for details.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.

◆ getCameraResolutions()

ErrorStatus mmind::eye::Camera::getCameraResolutions ( CameraResolutions & resolutions) const

Gets the image resolutions of the camera. Two image resolutions are provided, 2D image (texture) and depth map, which correspond to the 2D and 3D capture results Frame2D and Frame3D.

Parameters
[out]SeeCameraResolutions for details.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.

◆ getCameraStatus()

ErrorStatus mmind::eye::Camera::getCameraStatus ( CameraStatus & status) const

Gets various statuses of the camera.

Parameters
[out]SeeCameraStatus for details.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.

◆ getPointCloudUnit()

ErrorStatus mmind::eye::Camera::getPointCloudUnit ( CoordinateUnit & unit) const

Gets the current unit of the point cloud.

Parameters
[out]unitThe current CoordinateUnit of the point cloud.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ setHeartbeatInterval()

ErrorStatus mmind::eye::Camera::setHeartbeatInterval ( unsigned int timeIntervalMs)

Sets the time interval at which the client sends periodic heartbeat messages to the camera side. The default time interval is 10s.

Parameters
[in]timeIntervalMsThe time interval for periodic sending heartbeat messages in milliseconds. The valid setting range is from 1s to 3600s.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_OUT_OF_RANGE_ERROR Invalid parameter input.

◆ setPointCloudUnit()

ErrorStatus mmind::eye::Camera::setPointCloudUnit ( CoordinateUnit unit)

Sets the unit of the point cloud.

Parameters
[in]unitThe new CoordinateUnit of the point cloud.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR No frame data obtained. Some error may have occurred on the device.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model.
ErrorStatus::MMIND_STATUS_TIMEOUT_ERROR Timeout error.

◆ userSetManager()

UserSetManager & mmind::eye::Camera::userSetManager ( )

Gets the UserSetManager of the camera. UserSetManager provides various operations for managing all user sets saved in the camera, including adding and deleting user sets and selecting the user set to be used. It also provides the methods for saving all user sets to a JSON file and load all user sets from a JSON file.

Returns
See UserSetManager for details.

Friends And Related Symbol Documentation

◆ CameraEvent

Definition at line 364 of file Camera.h.

◆ HandEyeCalibration

Definition at line 363 of file Camera.h.

◆ InternalInterfaces

friend class InternalInterfaces
friend

Definition at line 365 of file Camera.h.


The documentation for this class was generated from the following file: