Mech-Eye API 2.2.0
API reference documentation for Mech-Eye Industrial 3D Camera
All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
mmind::eye::Frame3D Class Reference

Represents the 3D scanning result, which can be obtained by calling Camera::capture3D or Camera::capture3DWithNormal. Use a 2D array to represent it while each pixel represents its corresponding 3D data. The 3D data can be in the form of PointZ, PointXYZ, PointXYZWithNormal. The class supports saving 3D point cloud data to the 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 information of Frame3D.
 
bool isEmpty () const
 Judges whether Frame3D is empty.
 
void clear ()
 Clears the data in Frame3D and releases the related resources.
 
PointCloud getUntexturedPointCloud () const
 Obtains 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 unit is in mm, and invalid data is in nan.
 
PointCloudWithNormals getUntexturedPointCloudWithNormals () const
 Obtains 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 unit is in mm, 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
 Obtains the organized 3D data map with a PointZ pixel data format. Each point in DepthMap contains the Z data represented in the camera coordinate system. If only Z information is considered for the application scenario, using DepthMap can be more efficient. The depth data unit is in mm, and invalid data is in nan.
 
DepthMap getOrthogonalDepthMap (double &xScale, double &yScale, double &xOffset, double &yOffset) const
 Obtains the 3D data map with the PointZ pixel 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 represented in camera coordinate system according to the formula: 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 with input file format and input file name. Each point contains X, Y, and Z fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 
ErrorStatus saveUntexturedPointCloudWithNormals (FileFormat fileFormat, const std::string &fileName, bool isOrganized=false) const
 Saves the untextured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, normalX, normalY, and normalZ fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 

Static Public Member Functions

static ErrorStatus savePointCloud (const PointCloud &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false)
 Saves the untextured point cloud to a file with input file format and input file name. Each point contains X, Y, and Z fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 
static ErrorStatus savePointCloudWithNormals (const PointCloudWithNormals &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false)
 Saves the untextured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, normalX, normalY, and normalZ fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 

Friends

class CameraImpl
 
class Frame2DAnd3D
 

Detailed Description

Represents the 3D scanning result, which can be obtained by calling Camera::capture3D or Camera::capture3DWithNormal. Use a 2D array to represent it while each pixel represents its corresponding 3D data. The 3D data can be in the form of PointZ, PointXYZ, PointXYZWithNormal. The class supports saving 3D point cloud data to the file.

Definition at line 104 of file Frame3D.h.

Member Function Documentation

◆ getDepthMap()

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

Obtains the organized 3D data map with a PointZ pixel data format. Each point in DepthMap contains the Z data represented in the camera coordinate system. If only Z information is considered for the application scenario, using DepthMap can be more efficient. The depth data unit is in mm, and invalid data is in 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 map with the PointZ pixel 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 represented in camera coordinate system according to the formula: 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

Obtains 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 unit is in mm, and invalid data is in nan.

Returns
See PointCloud for details.

◆ getUntexturedPointCloudWithNormals()

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

Obtains 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 unit is in mm, 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 
)
static

Saves the untextured point cloud to a file with input file format and input file name. Each point contains X, Y, and Z fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.

Parameters
[in]pointCloudThe input point cloud. See PointCloud for details.
[in]fileFormatThe output file format, which supports PLY, PCD, and CSV file formats. See FileFormat for details.
[in]fileNameThe output file name.
[in]isOrganizedAn 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 writing point cloud file.

◆ savePointCloudWithNormals()

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

Saves the untextured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, normalX, normalY, and normalZ fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.

Parameters
[in]pointCloudThe input point cloud. See PointCloudWithNormals for details.
[in]fileFormatThe output file format, which supports PLY, PCD, and CSV file formats.
[in]fileNameThe output file name.
[in]isOrganizedAn 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 writing 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 with input file format and input file name. Each point contains X, Y, and Z fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.

Parameters
[in]fileFormatThe output file format, which supports PLY, PCD, and CSV file formats. See FileFormat for details.
[in]fileNameThe output file name.
[in]isOrganizedAn 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 writing 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 with input file format and input file name. Each point contains X, Y, Z, normalX, normalY, and normalZ fields with the unit in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.

Parameters
[in]fileFormatThe output file format, which supports PLY, PCD, and CSV file formats. See FileFormat for details.
[in]fileNameThe output file name.
[in]isOrganizedAn 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 writing point cloud file.

Friends And Related Symbol Documentation

◆ CameraImpl

friend class CameraImpl
friend

Definition at line 256 of file Frame3D.h.

◆ Frame2DAnd3D

friend class Frame2DAnd3D
friend

Definition at line 257 of file Frame3D.h.


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