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::Frame3D Class Reference

Represents the 3D capture result, which can be obtained by calling Camera::capture3D. The 3D data can be in the form of PointZ or PointXYZ and is stored in a 2D array, with each element in the array representing a point. The class also provides methods for saving the point cloud data to a local file. More...

#include <Frame3D.h>

Public Member Functions

 Frame3D ()
 Constructor.
 
 ~Frame3D ()
 Destructor.
 
 Frame3D (const Frame3D &other) noexcept
 Copy constructor.
 
Frame3Doperator= (const Frame3D &other) noexcept
 Copy assignment.
 
Size imageSize () const
 Gets the image size of Frame3D.
 
uint64_t frameId () const
 The ID of the Frame3D frame.
 
bool isEmpty () const
 Judges whether Frame3D is empty.
 
void clear ()
 Clears the data in Frame3D and releases the associated resources.
 
PointCloud getUntexturedPointCloud () const
 Gets the organized 3D data map with a PointXYZ pixel data format. Each point in PointCloud contains the X, Y, and Z data represented in the camera coordinate system. The X, Y, and Z data default unit is in mm (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D), and invalid data is in nan.
 
PointCloudWithNormals getUntexturedPointCloudWithNormals () const
 Gets the organized 3D data map with a PointXYZWithNormals pixel data format. Each point in PointCloudWithNormals contains the X, Y, Z data represented in the camera coordinate system. The X, Y, and Z data default unit is in mm (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D), and invalid data is in nan. Normal vectors are computed for each point. If the Frame3D is obtained by Camera::capture3DWithNormal, the normal vectors are computed at the camera side.
 
DepthMap getDepthMap () const
 Gets the organized 3D data with the PointZ data format. Each point in DepthMap contains the depth (z-coordinate) data in the camera refrence frame. If the application only requires the depth data, obtaining the DepthMap is more efficient. The default unit of the depth data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D), and the invalid data is represented by "nan".
 
DepthMap getOrthogonalDepthMap (double &xScale, double &yScale, double &xOffset, double &yOffset) const
 Obtains the 3D data with the PointZ data format. The 3D data is projected under the orthographic projection camera model. Four parameters are provided to assist in converting depth pixel positions into coordinate values in the camera reference frame according to the following equation: X = col * xScale + xOffset, Y = row * yScale + yOffset.
 
ErrorStatus saveUntexturedPointCloud (FileFormat fileFormat, const std::string &fileName, bool isOrganized=false) const
 Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, and z fields. The default unit of the coordinate data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D). Point cloud can be saved in organized or unorganized structure with ACSII mode.
 
ErrorStatus saveUntexturedPointCloudWithNormals (FileFormat fileFormat, const std::string &fileName, bool isOrganized=false) const
 Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, z, normalX, normalY, and normalZ fields. The default unit of the coordinate data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D). Point cloud can be saved in organized or unorganized structure with ACSII mode.
 

Static Public Member Functions

static ErrorStatus savePointCloud (const PointCloud &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false, CoordinateUnit pointCloudUnit=CoordinateUnit::Millimeter)
 Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, and z fields. The default unit of the coordinate data is millimeter. Point cloud can be saved in organized or unorganized structure with ACSII mode.
 
static ErrorStatus savePointCloudWithNormals (const PointCloudWithNormals &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false, CoordinateUnit pointCloudUnit=CoordinateUnit::Millimeter)
 Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, z, normalX, normalY, and normalZ fields. The default unit of the coordinate data is millimeter. Point cloud can be saved in organized or unorganized structure with ACSII mode.
 

Friends

class CameraImpl
 
class Frame2DAnd3D
 
class InternalInterfaces
 

Detailed Description

Represents the 3D capture result, which can be obtained by calling Camera::capture3D. The 3D data can be in the form of PointZ or PointXYZ and is stored in a 2D array, with each element in the array representing a point. The class also provides methods for saving the point cloud data to a local file.

Definition at line 111 of file Frame3D.h.

Member Function Documentation

◆ getDepthMap()

DepthMap mmind::eye::Frame3D::getDepthMap ( ) const

Gets the organized 3D data with the PointZ data format. Each point in DepthMap contains the depth (z-coordinate) data in the camera refrence frame. If the application only requires the depth data, obtaining the DepthMap is more efficient. The default unit of the depth data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D), and the invalid data is represented by "nan".

Returns
See DepthMap for details.

◆ getOrthogonalDepthMap()

DepthMap mmind::eye::Frame3D::getOrthogonalDepthMap ( double & xScale,
double & yScale,
double & xOffset,
double & yOffset ) const

Obtains the 3D data with the PointZ data format. The 3D data is projected under the orthographic projection camera model. Four parameters are provided to assist in converting depth pixel positions into coordinate values in the camera reference frame according to the following equation: X = col * xScale + xOffset, Y = row * yScale + yOffset.

Parameters
[out]xScaleThe output parameter.
[out]yScaleThe output parameter.
[out]xOffsetThe output parameter.
[out]yOffsetThe output parameter.
Returns
See DepthMap for details.

◆ getUntexturedPointCloud()

PointCloud mmind::eye::Frame3D::getUntexturedPointCloud ( ) const

Gets the organized 3D data map with a PointXYZ pixel data format. Each point in PointCloud contains the X, Y, and Z data represented in the camera coordinate system. The X, Y, and Z data default unit is in mm (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D), and invalid data is in nan.

Returns
See PointCloud for details.

◆ getUntexturedPointCloudWithNormals()

PointCloudWithNormals mmind::eye::Frame3D::getUntexturedPointCloudWithNormals ( ) const

Gets the organized 3D data map with a PointXYZWithNormals pixel data format. Each point in PointCloudWithNormals contains the X, Y, Z data represented in the camera coordinate system. The X, Y, and Z data default unit is in mm (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D), and invalid data is in nan. Normal vectors are computed for each point. If the Frame3D is obtained by Camera::capture3DWithNormal, the normal vectors are computed at the camera side.

Returns
See PointCloudWithNormals for details.

◆ savePointCloud()

static ErrorStatus mmind::eye::Frame3D::savePointCloud ( const PointCloud & pointCloud,
FileFormat fileFormat,
const std::string & fileName,
bool isOrganized = false,
CoordinateUnit pointCloudUnit = CoordinateUnit::Millimeter )
static

Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, and z fields. The default unit of the coordinate data is millimeter. Point cloud can be saved in organized or unorganized structure with ACSII mode.

Parameters
[in]pointCloudThe point cloud data to be saved. See PointCloud for details.
[in]fileFormatThe format of the point cloud file. Possible values include PLY, PCD, and CSV. See FileFormat for details.
[in]fileNameThe filename of the point cloud file.
[in]isOrganizedWhether the point cloud is organized. An organized point cloud saves all points in order, with invalid data as nan, and an unorganized point cloud saves only valid points.
[in]pointCloudUnitThe unit of the coordinate data.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR Frame3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ savePointCloudWithNormals()

static ErrorStatus mmind::eye::Frame3D::savePointCloudWithNormals ( const PointCloudWithNormals & pointCloud,
FileFormat fileFormat,
const std::string & fileName,
bool isOrganized = false,
CoordinateUnit pointCloudUnit = CoordinateUnit::Millimeter )
static

Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, z, normalX, normalY, and normalZ fields. The default unit of the coordinate data is millimeter. Point cloud can be saved in organized or unorganized structure with ACSII mode.

Parameters
[in]pointCloudThe point cloud data to be saved. See PointCloudWithNormals for details.
[in]fileFormatThe format of the point cloud file. Possible values include PLY, PCD, and CSV. See FileFormat for details.
[in]fileNameThe filename of the point cloud file.
[in]isOrganizedWhether the point cloud is organized. An organized point cloud saves all points in order, with invalid data as nan, and an unorganized point cloud saves only valid points.
[in]pointCloudUnitThe unit of the coordinate data.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR Frame3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ saveUntexturedPointCloud()

ErrorStatus mmind::eye::Frame3D::saveUntexturedPointCloud ( FileFormat fileFormat,
const std::string & fileName,
bool isOrganized = false ) const

Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, and z fields. The default unit of the coordinate data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D). Point cloud can be saved in organized or unorganized structure with ACSII mode.

Parameters
[in]fileFormatThe format of the point cloud file. Possible values include PLY, PCD, and CSV. See FileFormat for details.
[in]fileNameThe filename of the point cloud file.
[in]isOrganizedWhether the point cloud is organized. An organized point cloud saves all points in order, with invalid data as nan, and an unorganized point cloud saves only valid points.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR Frame3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ saveUntexturedPointCloudWithNormals()

ErrorStatus mmind::eye::Frame3D::saveUntexturedPointCloudWithNormals ( FileFormat fileFormat,
const std::string & fileName,
bool isOrganized = false ) const

Saves the untextured point cloud to a file of the input file format and filename. Each point contains x, y, z, normalX, normalY, and normalZ fields. The default unit of the coordinate data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture3D). Point cloud can be saved in organized or unorganized structure with ACSII mode.

Parameters
[in]fileFormatThe format of the point cloud file. Possible values include PLY, PCD, and CSV. See FileFormat for details.
[in]fileNameThe filename of the point cloud file.
[in]isOrganizedWhether the point cloud is organized. An organized point cloud saves all points in order, with invalid data as nan, and an unorganized point cloud saves only valid points.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR Frame3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

Friends And Related Symbol Documentation

◆ CameraImpl

friend class CameraImpl
friend

Definition at line 290 of file Frame3D.h.

◆ Frame2DAnd3D

Definition at line 291 of file Frame3D.h.

◆ InternalInterfaces

friend class InternalInterfaces
friend

Definition at line 292 of file Frame3D.h.


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