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>
|
| Frame3D () |
| Constructor.
|
|
| ~Frame3D () |
| Destructor.
|
|
| Frame3D (const Frame3D &other) noexcept |
| Copy constructor.
|
|
Frame3D & | operator= (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 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.
|
|
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.
◆ 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] | xScale | The output parameter. |
[out] | yScale | The output parameter. |
[out] | xOffset | The output parameter. |
[out] | yOffset | The 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()
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] | pointCloud | The input point cloud. See PointCloud for details. |
[in] | fileFormat | The output file format, which supports PLY, PCD, and CSV file formats. See FileFormat for details. |
[in] | fileName | The output file name. |
[in] | isOrganized | 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 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] | pointCloud | The input point cloud. See PointCloudWithNormals for details. |
[in] | fileFormat | The output file format, which supports PLY, PCD, and CSV file formats. |
[in] | fileName | The output file name. |
[in] | isOrganized | 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 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] | fileFormat | The output file format, which supports PLY, PCD, and CSV file formats. See FileFormat for details. |
[in] | fileName | The output file name. |
[in] | isOrganized | 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 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] | fileFormat | The output file format, which supports PLY, PCD, and CSV file formats. See FileFormat for details. |
[in] | fileName | The output file name. |
[in] | isOrganized | 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 writing point cloud file.
◆ CameraImpl
◆ Frame2DAnd3D
The documentation for this class was generated from the following file: