Mech-Eye API 2.3.1
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::Frame2DAnd3D Class Reference

Represents the 2D and 3D scanning result, which can be obtained by calling Camera::capture2DAnd3D or Camera.captureAll2D3DWithNormal. 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, and PointXYZWithNormal. The class supports saving 3D point cloud data to the file. More...

#include <Frame2DAnd3D.h>

Public Member Functions

 Frame2DAnd3D ()
 Constructor.
 
 ~Frame2DAnd3D ()
 Destructor.
 
 Frame2DAnd3D (const Frame2DAnd3D &other) noexcept
 Copy constructor.
 
Frame2DAnd3Doperator= (const Frame2DAnd3D &other) noexcept
 Copy assignment.
 
Frame2D frame2D () const
 Gets the Frame2D data part.
 
Frame3D frame3D () const
 Gets the Frame3D data part.
 
void clear ()
 Clears the data in Frame2DAnd3D and releases the related resources.
 
TexturedPointCloud getTexturedPointCloud () const
 Gets the pixel-aligned 2D and 3D data with the PointXYZBGR pixel data format. Each point in TexturedPointCloud contains the X, Y, and Z data represented in the camera coordinate system and the texture information. X, Y, and Z data unit is in mm, and invalid data is in nan.
 
TexturedPointCloudWithNormals getTexturedPointCloudWithNormals () const
 Gets the pixel-aligned 2D and 3D data with the PointXYZBGRWithNormals pixel data format. Each point in TexturedPointCloudWithNormals contains the X, Y, and Z data represented in the camera coordinate system and the texture information. X, Y, and Z data unit is in mm, and invalid data is in nan. Normal vectors are computed for each point. If the Frame2DAnd3D is obtained by Camera::capture2DAnd3DWithNormal, the normal vectors are computed at the camera side.
 
ErrorStatus saveTexturedPointCloud (FileFormat fileFormat, const std::string &fileName, bool isOrganized=false) const
 Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, and red fields. The 3D data unit is in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 
ErrorStatus saveTexturedPointCloudWithNormals (FileFormat fileFormat, const std::string &fileName, bool isOrganized=false) const
 Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, red, normalX, normalY, and normalZ fields. The 3D data unit is in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 

Static Public Member Functions

static ErrorStatus savePointCloud (const TexturedPointCloud &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false)
 Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, and red fields. The 3D data unit is in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 
static ErrorStatus savePointCloudWithNormals (const TexturedPointCloudWithNormals &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false)
 Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, red, normalX, normalY, and normalZ fields. The 3D data unit is in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.
 

Friends

class CameraImpl
 

Detailed Description

Represents the 2D and 3D scanning result, which can be obtained by calling Camera::capture2DAnd3D or Camera.captureAll2D3DWithNormal. 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, and PointXYZWithNormal. The class supports saving 3D point cloud data to the file.

Definition at line 80 of file Frame2DAnd3D.h.

Member Function Documentation

◆ getTexturedPointCloud()

TexturedPointCloud mmind::eye::Frame2DAnd3D::getTexturedPointCloud ( ) const

Gets the pixel-aligned 2D and 3D data with the PointXYZBGR pixel data format. Each point in TexturedPointCloud contains the X, Y, and Z data represented in the camera coordinate system and the texture information. X, Y, and Z data unit is in mm, and invalid data is in nan.

Returns
See TexturedPointCloud for details.

◆ getTexturedPointCloudWithNormals()

TexturedPointCloudWithNormals mmind::eye::Frame2DAnd3D::getTexturedPointCloudWithNormals ( ) const

Gets the pixel-aligned 2D and 3D data with the PointXYZBGRWithNormals pixel data format. Each point in TexturedPointCloudWithNormals contains the X, Y, and Z data represented in the camera coordinate system and the texture information. X, Y, and Z data unit is in mm, and invalid data is in nan. Normal vectors are computed for each point. If the Frame2DAnd3D is obtained by Camera::capture2DAnd3DWithNormal, the normal vectors are computed at the camera side.

Returns
See TexturedPointCloudWithNormals for details.

◆ savePointCloud()

static ErrorStatus mmind::eye::Frame2DAnd3D::savePointCloud ( const TexturedPointCloud pointCloud,
FileFormat  fileFormat,
const std::string &  fileName,
bool  isOrganized = false 
)
static

Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, and red fields. The 3D data unit is in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.

Parameters
[in]pointCloudThe input point cloud. See TexturedPointCloud 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 Frame2DAnd3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error writing point cloud file.

◆ savePointCloudWithNormals()

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

Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, red, normalX, normalY, and normalZ fields. The 3D data unit is in mm. Point cloud can be saved in organized or unorganized form with ACSII mode.

Parameters
[in]pointCloudThe input point cloud. See TexturedPointCloudWithNormals 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 Frame2DAnd3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error writing point cloud file.

◆ saveTexturedPointCloud()

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

Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, and red fields. The 3D data unit is 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 Frame2DAnd3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error writing point cloud file.

◆ saveTexturedPointCloudWithNormals()

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

Saves the textured point cloud to a file with input file format and input file name. Each point contains X, Y, Z, blue, green, red, normalX, normalY, and normalZ fields. The 3D data unit is 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 Frame2DAnd3D 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 214 of file Frame2DAnd3D.h.


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