Mech-Eye API 2.5.0
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
mmind::eye::ProfileBatch Class Reference

Represents a batch of profiles, which can be obtained by calling Profiler::retrieveBatchData(). It contains four elements of profile index, encoder value, intensity image, and depth map. More...

#include <ProfileData.h>

Public Types

enum class  BatchFlag { Success , Incomplete = 0x1 }
 Describes the status of the ProfileBatch object. More...
 
using ProfileIndexArray = BatchArray< unsigned int >
 
using EncoderArray = BatchArray< unsigned int >
 
using IntensityImage = BatchArray< unsigned char >
 
using DepthMap = BatchArray< float >
 
using UntexturedPointCloud = BatchArray< PointXYZ >
 
using PointCloud = UntexturedPointCloud
 
using TexturedPointCloud = BatchArray< PointXYZI >
 

Public Member Functions

 ProfileBatch (size_t width)
 Constructor.
 
 ~ProfileBatch ()=default
 Default destructor.
 
size_t width () const
 Returns the width of the ProfileBatch object (the number of data points per profile).
 
size_t height () const
 Returns the height of the ProfileBatch object (the number of profiles in the batch).
 
size_t validHeight () const
 Returns the valid height of the ProfileBatch object (the number of profiles with valid intensity and depth data in the batch).
 
bool isEmpty () const
 Checks if the ProfileBatch object has no elements.
 
void reserve (size_t height)
 Reserves the input height for the ProfileBatch object.
 
bool append (const ProfileBatch &batch)
 Appends the data of one ProfileBatch object to another.
 
void clear ()
 Clears the data in the ProfileBatch object.
 
Profile getProfile (size_t profileIndex) const
 Gets a profile in the batch by inputting the index of the profile.
 
ProfileIndexArray getProfileIndexArray () const
 Gets an array of indices of all profiles in the batch. Each profile data corresponds to an index.
 
EncoderArray getEncoderArray () const
 Gets an array of encoder values of all profiles in the batch. Each profile data corresponds to an encoder value.
 
IntensityImage getIntensityImage () const
 Gets the intensity image data in the batch. The invalid data of intensity image is 0.
 
DepthMap getDepthMap () const
 Gets the depth map data in the batch. Each point in DepthMap contains the Z information in the laser profiler coordinate system. The depth data unit is mm, and invalid data is nan.
 
UntexturedPointCloud getUntexturedPointCloud (double xResolution, double yResolution, bool useEncoderValues, int triggerInterval, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter) const
 Gets the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X, Y, and Z information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.
 
TexturedPointCloud getTexturedPointCloud (double xResolution, double yResolution, bool useEncoderValues, int triggerInterval, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter) const
 Gets the textured point cloud data in the batch. Each point in TexturedPointCloud contains the X, Y, Z, and Intensity information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.
 
ErrorStatus saveUntexturedPointCloud (double xResolution, double yResolution, bool useEncoderValues, int triggerInterval, FileFormat fileFormat, const std::string &fileName, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter, bool isOrganized=false) const
 Saves the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X, Y, and Z information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.
 
ErrorStatus saveTexturedPointCloud (double xResolution, double yResolution, bool useEncoderValues, int triggerInterval, FileFormat fileFormat, const std::string &fileName, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter, bool isOrganized=false) const
 Saves the textured point cloud data in the batch. Each point in TexturedPointCloud contains the X, Y, Z, and Intensity information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.
 
ErrorStatus getErrorStatus () const
 Gets the error code and description of the function.
 
int getFlag () const
 Gets the flags of the ProfileBatch object. See BatchFlag for details.
 
bool checkFlag (BatchFlag flag) const
 Checks if the BatchFlag value of the ProfileBatch object matches the input value.
 

Static Public Member Functions

static ErrorStatus saveUntexturedPointCloud (const UntexturedPointCloud &pointCloud, FileFormat fileFormat, const std::string &fileName, bool isOrganized=false, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter)
 Saves the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X, Y, and Z information in the laser profiler coordinate system. The depth data unit is mm, and invalid data is nan.
 
static ErrorStatus saveTexturedPointCloud (const TexturedPointCloud &pointCloud, FileFormat FileFormat, const std::string &fileName, bool isOrganized=false, CoordinateUnit coordinateUnit=CoordinateUnit::Millimeter)
 Saves the textured point cloud data in the batch. Each point in TexturedPointCloud contains the X, Y, Z, and Intensity information in the laser profiler coordinate system. The depth data unit is mm, and invalid data is nan.
 

Friends

class ProfilerImpl
 
class VirtualProfilerImpl
 

Detailed Description

Represents a batch of profiles, which can be obtained by calling Profiler::retrieveBatchData(). It contains four elements of profile index, encoder value, intensity image, and depth map.

Definition at line 41 of file ProfileData.h.

Member Typedef Documentation

◆ DepthMap

Definition at line 57 of file ProfileData.h.

◆ EncoderArray

Definition at line 55 of file ProfileData.h.

◆ IntensityImage

Definition at line 56 of file ProfileData.h.

◆ PointCloud

Definition at line 59 of file ProfileData.h.

◆ ProfileIndexArray

Definition at line 54 of file ProfileData.h.

◆ TexturedPointCloud

Definition at line 60 of file ProfileData.h.

◆ UntexturedPointCloud

Definition at line 58 of file ProfileData.h.

Member Enumeration Documentation

◆ BatchFlag

Describes the status of the ProfileBatch object.

Enumerator
Success 

All profiles in the ProfileBatch object contain valid intensity and depth data.

Incomplete 

Some profiles in the ProfileBatch object do not contain valid intensity and depth data.

Definition at line 47 of file ProfileData.h.

Member Function Documentation

◆ getTexturedPointCloud()

TexturedPointCloud mmind::eye::ProfileBatch::getTexturedPointCloud ( double  xResolution,
double  yResolution,
bool  useEncoderValues,
int  triggerInterval,
CoordinateUnit  coordinateUnit = CoordinateUnit::Millimeter 
) const

Gets the textured point cloud data in the batch. Each point in TexturedPointCloud contains the X, Y, Z, and Intensity information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.

Parameters
[in]xResolutiondetermines the space of the X coordinate data.
[in]yResolutiondetermines the space of the Y coordinate data.
[in]useEncoderValuesdetermines whether to use the encoder values or row index as the data source for Y coordinate data.
[in]triggerIntervaltrigger interval of the encoder values.
[in]coordinateUnitthe coordinate unit of the point cloud.
Returns
See UntexturedPointCloud for details.

◆ getUntexturedPointCloud()

UntexturedPointCloud mmind::eye::ProfileBatch::getUntexturedPointCloud ( double  xResolution,
double  yResolution,
bool  useEncoderValues,
int  triggerInterval,
CoordinateUnit  coordinateUnit = CoordinateUnit::Millimeter 
) const

Gets the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X, Y, and Z information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.

Parameters
[in]xResolutiondetermines the space of the X coordinate data.
[in]yResolutiondetermines the space of the Y coordinate data.
[in]useEncoderValuesdetermines whether to use the encoder values or row index as the data source for Y coordinate data.
[in]triggerIntervaltrigger interval of the encoder values.
[in]coordinateUnitthe coordinate unit of the point cloud.
Returns
See UntexturedPointCloud for details.

◆ saveTexturedPointCloud() [1/2]

static ErrorStatus mmind::eye::ProfileBatch::saveTexturedPointCloud ( const TexturedPointCloud pointCloud,
FileFormat  FileFormat,
const std::string &  fileName,
bool  isOrganized = false,
CoordinateUnit  coordinateUnit = CoordinateUnit::Millimeter 
)
static

Saves the textured point cloud data in the batch. Each point in TexturedPointCloud contains the X, Y, Z, and Intensity information in the laser profiler coordinate system. The depth data unit is mm, and invalid data is nan.

Parameters
[in]pointCloudThe point cloud to be saved. See TexturedPointCloud 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]coordinateUnitthe coordinate unit of the point cloud.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR ProfileBatch is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ saveTexturedPointCloud() [2/2]

ErrorStatus mmind::eye::ProfileBatch::saveTexturedPointCloud ( double  xResolution,
double  yResolution,
bool  useEncoderValues,
int  triggerInterval,
FileFormat  fileFormat,
const std::string &  fileName,
CoordinateUnit  coordinateUnit = CoordinateUnit::Millimeter,
bool  isOrganized = false 
) const

Saves the textured point cloud data in the batch. Each point in TexturedPointCloud contains the X, Y, Z, and Intensity information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.

Parameters
[in]xResolutiondetermines the space of the X coordinate data.
[in]yResolutiondetermines the space of the Y coordinate data.
[in]useEncoderValuesdetermines whether to use the encoder values or row index as the data source for Y coordinate data.
[in]triggerIntervaltrigger interval of the encoder values.
[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]coordinateUnitthe coordinate unit of the point cloud.
[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 ProfileBatch is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ saveUntexturedPointCloud() [1/2]

static ErrorStatus mmind::eye::ProfileBatch::saveUntexturedPointCloud ( const UntexturedPointCloud pointCloud,
FileFormat  fileFormat,
const std::string &  fileName,
bool  isOrganized = false,
CoordinateUnit  coordinateUnit = CoordinateUnit::Millimeter 
)
static

Saves the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X, Y, and Z information in the laser profiler coordinate system. The depth data unit is mm, and invalid data is nan.

Parameters
[in]pointCloudThe point cloud to be saved. See UntexturedPointCloud 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]coordinateUnitthe coordinate unit of the point cloud.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_NO_DATA_ERROR ProfileBatch is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

◆ saveUntexturedPointCloud() [2/2]

ErrorStatus mmind::eye::ProfileBatch::saveUntexturedPointCloud ( double  xResolution,
double  yResolution,
bool  useEncoderValues,
int  triggerInterval,
FileFormat  fileFormat,
const std::string &  fileName,
CoordinateUnit  coordinateUnit = CoordinateUnit::Millimeter,
bool  isOrganized = false 
) const

Saves the untextured point cloud data in the batch. Each point in UntexturedPointCloud contains the X, Y, and Z information in the laser profiler coordinate system. The space of the X coordinate data is determined by the xResolution argument. The X coordinate data is determined by the column index. The space of the Y coordinate data is determined by yResolution argument. The Y coordinate data is determined by the encoder values if the useEncoderValues argument is set to true and row index otherwise. The depth data unit is mm, and invalid data is nan.

Parameters
[in]xResolutiondetermines the space of the X coordinate data.
[in]yResolutiondetermines the space of the Y coordinate data.
[in]useEncoderValuesdetermines whether to use the encoder values or row index as the data source for Y coordinate data.
[in]triggerIntervaltrigger interval of the encoder values.
[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]coordinateUnitthe coordinate unit of the point cloud.
[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 ProfileBatch is empty.
ErrorStatus::MMIND_STATUS_FILE_IO_ERROR Error occurred while writing the point cloud file.

Friends And Related Symbol Documentation

◆ ProfilerImpl

friend class ProfilerImpl
friend

Definition at line 303 of file ProfileData.h.

◆ VirtualProfilerImpl

friend class VirtualProfilerImpl
friend

Definition at line 304 of file ProfileData.h.


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