Mech-Eye API 2.5.1
API reference documentation for Mech-Eye 3D Laser Profiler
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends
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.

Member Typedef Documentation

◆ DepthMap

using DepthMap = BatchArray<float>

◆ EncoderArray

using EncoderArray = BatchArray<unsigned int>

◆ IntensityImage

using IntensityImage = BatchArray<unsigned char>

◆ PointCloud

◆ ProfileIndexArray

using ProfileIndexArray = BatchArray<unsigned int>

◆ TexturedPointCloud

◆ UntexturedPointCloud

Member Enumeration Documentation

◆ BatchFlag

enum class BatchFlag
strong

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.

Constructor & Destructor Documentation

◆ ProfileBatch()

ProfileBatch ( size_t  width)

Constructor.

◆ ~ProfileBatch()

~ProfileBatch ( )
default

Default destructor.

Member Function Documentation

◆ append()

bool append ( const ProfileBatch batch)

Appends the data of one ProfileBatch object to another.

◆ checkFlag()

bool checkFlag ( BatchFlag  flag) const

Checks if the BatchFlag value of the ProfileBatch object matches the input value.

◆ clear()

void clear ( )

Clears the data in the ProfileBatch object.

◆ getDepthMap()

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.

◆ getEncoderArray()

EncoderArray getEncoderArray ( ) const

Gets an array of encoder values of all profiles in the batch. Each profile data corresponds to an encoder value.

◆ getErrorStatus()

ErrorStatus getErrorStatus ( ) const

Gets the error code and description of the function.

◆ getFlag()

int getFlag ( ) const

Gets the flags of the ProfileBatch object. See BatchFlag for details.

◆ getIntensityImage()

IntensityImage getIntensityImage ( ) const

Gets the intensity image data in the batch. The invalid data of intensity image is 0.

◆ getProfile()

Profile getProfile ( size_t  profileIndex) const

Gets a profile in the batch by inputting the index of the profile.

◆ getProfileIndexArray()

ProfileIndexArray getProfileIndexArray ( ) const

Gets an array of indices of all profiles in the batch. Each profile data corresponds to an index.

◆ getTexturedPointCloud()

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.

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 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.

◆ height()

size_t height ( ) const

Returns the height of the ProfileBatch object (the number of profiles in the batch).

◆ isEmpty()

bool isEmpty ( ) const

Checks if the ProfileBatch object has no elements.

◆ reserve()

void reserve ( size_t  height)

Reserves the input height for the ProfileBatch object.

◆ saveTexturedPointCloud() [1/2]

static ErrorStatus 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 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 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 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.

◆ validHeight()

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).

◆ width()

size_t width ( ) const

Returns the width of the ProfileBatch object (the number of data points per profile).

Friends And Related Symbol Documentation

◆ ProfilerImpl

friend class ProfilerImpl
friend

◆ VirtualProfilerImpl

friend class VirtualProfilerImpl
friend

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