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

Represents the 2D and 3D capture results, which can be obtained by calling Camera::capture2DAnd3D. 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 <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 associated resources.
 
TexturedPointCloud getTexturedPointCloud () const
 Gets the 2D and 3D data aligned pixel-to-pixel with the PointXYZBGR data format. Each point in TexturedPointCloud contains the coordinate data in the camera reference frame and texture information. The default unit of the coordinates is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D), and the invalid data is represented by "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 default unit is in mm (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D), 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 of the input file format and filename. Each point contains x, y, z, blue, green, and red fields. The default unit of the coordinate data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D). Point cloud can be saved in organized or unorganized structure with ACSII mode.
 
ErrorStatus saveTexturedPointCloudWithNormals (FileFormat fileFormat, const std::string &fileName, bool isOrganized=false) const
 Saves the textured point cloud to a file of the input file format and filename. Each point contains x, y, z, blue, green, red, normalX, normalY, and normalZ fields. The default unit of the coordinate is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D). Point cloud can be saved in organized or unorganized structure with ACSII mode.
 

Static Public Member Functions

static ErrorStatus savePointCloud (const TexturedPointCloud &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false, CoordinateUnit pointCloudUnit=CoordinateUnit::Millimeter)
 Saves the textured point cloud to a file of the input file format and filename. Each point contains x, y, z, blue, green, and red 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 TexturedPointCloudWithNormals &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false, CoordinateUnit pointCloudUnit=CoordinateUnit::Millimeter)
 Saves the textured point cloud to a file of the input file format and filename. Each point contains x, y, z, blue, green, red, 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 InternalInterfaces
 

Detailed Description

Represents the 2D and 3D capture results, which can be obtained by calling Camera::capture2DAnd3D. 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 100 of file Frame2DAnd3D.h.

Member Function Documentation

◆ getTexturedPointCloud()

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

Gets the 2D and 3D data aligned pixel-to-pixel with the PointXYZBGR data format. Each point in TexturedPointCloud contains the coordinate data in the camera reference frame and texture information. The default unit of the coordinates is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D), and the invalid data is represented by "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 default unit is in mm (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D), 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,
CoordinateUnit pointCloudUnit = CoordinateUnit::Millimeter )
static

Saves the textured point cloud to a file of the input file format and filename. Each point contains x, y, z, blue, green, and red 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 TexturedPointCloud for details.
[in]fileFormatThe format of the point cloud file. Possible values include PLY, PCD, and CSV.
[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 Frame2DAnd3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ savePointCloudWithNormals()

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

Saves the textured point cloud to a file of the input file format and filename. Each point contains x, y, z, blue, green, red, 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 TexturedPointCloudWithNormals for details.
[in]fileFormatThe format of the point cloud file. Possible values include PLY, PCD, and CSV.
[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 Frame2DAnd3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the 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 of the input file format and filename. Each point contains x, y, z, blue, green, and red fields. The default unit of the coordinate data is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D). 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 Frame2DAnd3D is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the 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 of the input file format and filename. Each point contains x, y, z, blue, green, red, normalX, normalY, and normalZ fields. The default unit of the coordinate is millimeter (You can change the unit by calling Camera::setPointCloudUnit before calling Camera::capture2DAnd3D). 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. 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. ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR Frame2DAnd3D 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 254 of file Frame2DAnd3D.h.

◆ InternalInterfaces

friend class InternalInterfaces
friend

Definition at line 255 of file Frame2DAnd3D.h.


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