Cloud of 3D points. More...
Functions | |
cvbres_t | CVC3DCreateDensePointCloud (cvbdim_t Width, cvbdim_t Height, cvbval_t Flags, CVCOMPOSITE &PointCloud) |
Creates a new dense Cartesian 3D PointCloud. More... | |
cvbres_t | CVC3DCreateSparsePointCloud (cvbint64_t NumPoints, cvbval_t Flags, CVCOMPOSITE &PointCloud) |
Creates a new sparse Cartesian 3D PointCloud. More... | |
cvbres_t | CVC3DPointCloudAnalyzeLayout (CVCOMPOSITE PointCloud, CVC3DPointCloudLayout &Layout) |
Analyzes the available buffers/planes of the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetDatatype (CVCOMPOSITE PointCloud, cvbdatatype_t &DT) |
Gets the cvbdatatype_t of the x,y,z(,w) components of the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetLatticeSize (CVCOMPOSITE PointCloud, cvbdim_t &Width, cvbdim_t &Height) |
Gets the number of x,y,z(,w) point rows and columns of the given dense PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetNumPoints (CVCOMPOSITE PointCloud, cvbint64_t &NumPoints) |
Gets the number of x,y,z(,w) points in the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointCDsPointer (CVCOMPOSITE PointCloud, CVC3DPointCD *&pPoints, size_t &NumPoints) |
Tries to get the 3D points from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointCFsPointer (CVCOMPOSITE PointCloud, CVC3DPointCF *&pPoints, size_t &NumPoints) |
Tries to get the 3D points from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointComponentsPointers (CVCOMPOSITE PointCloud, void *&pXs, intptr_t &XsInc, void *&pYs, intptr_t &YsInc, void *&pZs, intptr_t &ZsInc, void *&pWs, intptr_t &WsInc, size_t &NumPoints) |
Tries to get the point components from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointDsPointer (CVCOMPOSITE PointCloud, CVC3DPointD *&pPoints, size_t &NumPoints) |
Tries to get the 3D points from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointFsPointer (CVCOMPOSITE PointCloud, CVC3DPointF *&pPoints, size_t &NumPoints) |
Tries to get the 3D points from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointHDsPointer (CVCOMPOSITE PointCloud, CVC3DPointHD *&pPoints, size_t &NumPoints) |
Tries to get the 3D points from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointHFsPointer (CVCOMPOSITE PointCloud, CVC3DPointHF *&pPoints, size_t &NumPoints) |
Tries to get the 3D points from the given PointCloud. More... | |
cvbres_t | CVC3DPointCloudGetPointsConfidencePointer (CVCOMPOSITE PointCloud, void *&pConfidences, intptr_t &Increment, cvbdatatype_t &DataType) |
Tries to get the confidence components from the given PointCloud. More... | |
Cloud of 3D points.
At its core the PointCloud is a collection of 3D points (x,y,z, and optionally w). The components' data type can either be float or double. To be flexible for various use cases additional information can also be aggregated via the IComposite.
A point cloud is a CVCOMPOSITE with at least three planes denoting Cartesian point components. If possible, these point components are aggregated in one or more __IPFNCBuffer__s. Other information like an ITransformation can be attached to the IComposite.
The functions in this section simplify PointCloud access, so you don't need to enumerate and analyze the **IPlane**s manually. Here you find functions to access the points (or point components), the number of points and the structural information like cvbdatatype_t and CVC3DPointCloudLayout.
Sparse **PointCloud**s are – logically seen, not from a memory perspective – an array of points. The IPlane objects aggregated by the cloud's IComposite are one-dimensional (rank of 1). They give no assurance of the ordering of the points.
Dense **PointCloud**s are placed on a lattice with a given width and height. Their **IPlane**s are two-dimensional (rank of 2). The advantage of dense clouds is, that you have immediate neighbor information. The disadvantage is, that you cannot have arbitrary clouds (e.g. rotating a dense cloud quickly breaks the lattice view). Also points behind other points cannot be addressed (same x,y components with differing z components).
In memory there are no gaps in a dense cloud. You need to work around that with a confidence IPlane (CVCPR_PixConfidence plane role). And as dense clouds are also just points, you can access dense clouds like sparse clouds.
The easiest way to determine whether you have a dense point cloud is to call CVC3DPointCloudGetLatticeSize.
Confidence planes are especially important to dense **PointCloud**s as we cannot remove points without destroying the lattice. The confidence for a point ranges from 0 to 1 (inclusive), where 0 is 0% and 1 is 100%. A value of 0.5 thus has 50% confidence.
A confidence value in the confidence plane relates to the point with the same index in the x, y, z (, w) component planes. There is also a special point type available (CVC3DPointCF/CVC3DPointCD) which makes the confidence information directly available. You can create such **PointCloud**s by adding CVC3DPCF_XYZConfidence to the creation flags.
__PointCloud__s do not have a fixed buffer layout. Following Common Vision Blox's plane model, each point component can be enumerated individually. With this approach various buffer layouts can be handled (see CVC3DPointCloudLayout for additional information on the possible layouts).
You can enumerate these planes and buffers with the CVCore library's IPlaneEnum, IPlane, IComposite and IPFNCBuffer functions.
cvbres_t CVC3DCreateDensePointCloud | ( | cvbdim_t | Width, |
cvbdim_t | Height, | ||
cvbval_t | Flags, | ||
CVCOMPOSITE & | PointCloud | ||
) |
Creates a new dense Cartesian 3D PointCloud.
The resulting point cloud will always have a contiguous point array (CVC3DPCL_Interleaved) with the cvbdatatype_t of the point components being DT_Float | DT_Signed | 32 if CVC3DPCF_DTFloat is set in the Flags; DT_Float | DT_Signed | 64 if CVC3DPCF_DTDouble is set. The buffer's PFNC format is Coord3D_ABC32f if CVC3DPCF_XYZ is set; CVC3DPCF_XYZW and CVC3DPCF_XYZConfidence have no PFNC representation.
Creating the point cloud with with CVC3DPCF_XYZConfidence will provide interleaved XYZConfidence (PointCloudLayout will be CVC3DPCL_Linear), whereas creating it with CVC3DPCF_WithConfidence, only XYZ will be interleaved but not the confidence plane (PointCloudLayout will be CVC3DPCL_Interleaved).
[in] | Width | Number of Cartesian X, Y, Z(, W) points on the x-component of the lattice. |
[in] | Height | Number of Cartesian X, Y, Z(, W) points on the y-component of the lattice. |
[in] | Flags | CVC3DPointCloudFlags specifying the kind of point cloud to be created. |
[out] | PointCloud | Variable to receive the handle of the point cloud object as a CVCOMPOSITE. |
cvbres_t CVC3DCreateSparsePointCloud | ( | cvbint64_t | NumPoints, |
cvbval_t | Flags, | ||
CVCOMPOSITE & | PointCloud | ||
) |
Creates a new sparse Cartesian 3D PointCloud.
The resulting point cloud will have a contiguous point array (CVC3DPCL_Interleaved) with the cvbdatatype_t of the point components being DT_Float | DT_Signed | 32 if CVC3DPCF_DTFloat is set in the Flags; DT_Float | DT_Signed | 64 if CVC3DPCF_DTDouble is set. The buffer's PFNC format is Coord3D_ABC32f if CVC3DPCF_XYZ is set; CVC3DPCF_XYZW and CVC3DPCF_XYZConfidence have no PFNC representation.
Creating the point cloud with with CVC3DPCF_XYZConfidence will provide interleaved XYZConfidence (PointCloudLayout will be CVC3DPCL_Linear), whereas creating it with CVC3DPCF_WithConfidence, only XYZ will be interleaved but not the confidence plane (PointCloudLayout will be CVC3DPCL_Interleaved).
[in] | NumPoints | Number of Cartesian X, Y, Z(, W) points. |
[in] | Flags | CVC3DPointCloudFlags specifying the kind of point cloud to be created. |
[out] | PointCloud | Variable to receive the handle of the point cloud object as a CVCOMPOSITE. |
cvbres_t CVC3DPointCloudAnalyzeLayout | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointCloudLayout & | Layout | ||
) |
Analyzes the available buffers/planes of the given PointCloud.
This function queries the IPFNCBuffer and then the IPlaneEnum interfaces.
[in] | PointCloud | Point cloud to analyze. |
[out] | Layout | CVC3DPointCloudLayout of PointCloud. |
cvbres_t CVC3DPointCloudGetDatatype | ( | CVCOMPOSITE | PointCloud, |
cvbdatatype_t & | DT | ||
) |
Gets the cvbdatatype_t of the x,y,z(,w) components of the given PointCloud.
[in] | PointCloud | Point cloud of which the point component cvbdatatype_t is to queried. |
[out] | DT | The cvbdatatype_t of the x,y,z(,w) components of the PointCloud points. |
cvbres_t CVC3DPointCloudGetLatticeSize | ( | CVCOMPOSITE | PointCloud, |
cvbdim_t & | Width, | ||
cvbdim_t & | Height | ||
) |
Gets the number of x,y,z(,w) point rows and columns of the given dense PointCloud.
[in] | PointCloud | Point cloud of which the number of points is to be queried. |
[out] | Width | Variable to be filled with the number of columns. |
[out] | Height | Variable to be filled with the number of rows. |
cvbres_t CVC3DPointCloudGetNumPoints | ( | CVCOMPOSITE | PointCloud, |
cvbint64_t & | NumPoints | ||
) |
Gets the number of x,y,z(,w) points in the given PointCloud.
[in] | PointCloud | Point cloud of which the number of points is to be queried. |
[out] | NumPoints | Variable to be filled with the number of points in the PointCloud. |
cvbres_t CVC3DPointCloudGetPointCDsPointer | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointCD *& | pPoints, | ||
size_t & | NumPoints | ||
) |
Tries to get the 3D points from the given PointCloud.
This function gets the pointer to the internal array of X, Y, Z, C float points if it available.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points are to be accessed. |
[out] | pPoints | Variable to be filled with pointer to first point in PointCloud. |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointCFsPointer | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointCF *& | pPoints, | ||
size_t & | NumPoints | ||
) |
Tries to get the 3D points from the given PointCloud.
This function gets the pointer to the internal array of X, Y, Z, C float points if it available.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points are to be accessed. |
[out] | pPoints | Variable to be filled with pointer to first point in PointCloud. |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointComponentsPointers | ( | CVCOMPOSITE | PointCloud, |
void *& | pXs, | ||
intptr_t & | XsInc, | ||
void *& | pYs, | ||
intptr_t & | YsInc, | ||
void *& | pZs, | ||
intptr_t & | ZsInc, | ||
void *& | pWs, | ||
intptr_t & | WsInc, | ||
size_t & | NumPoints | ||
) |
Tries to get the point components from the given PointCloud.
This function gets the pointers to the internal buffer(s) of X, Y, Z point components.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points components are to be accessed. |
[out] | pXs | Variable to receive the pointer to the first X-component of the first point. |
[out] | XsInc | Increment to the next X-component of the next point in bytes. |
[out] | pYs | Variable to receive the pointer to the first Y-component of the first point. |
[out] | YsInc | Increment to the next Y-component of the next point in bytes. |
[out] | pZs | Variable to receive the pointer to the first Z-component of the first point. |
[out] | ZsInc | Increment to the next Z-component of the next point in bytes. |
[out] | pWs | Variable to receive the pointer to the first W-component of the first point (if present; nullptr if not). |
[out] | WsInc | Increment to the next W-component of the next point in bytes (if present; 0 if not). |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointDsPointer | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointD *& | pPoints, | ||
size_t & | NumPoints | ||
) |
Tries to get the 3D points from the given PointCloud.
This function gets the pointer to the internal array of X, Y, Z double points if it available.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points are to be accessed. |
[out] | pPoints | Variable to be filled with pointer to first point in PointCloud. |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointFsPointer | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointF *& | pPoints, | ||
size_t & | NumPoints | ||
) |
Tries to get the 3D points from the given PointCloud.
This function gets the pointer to the internal array of X, Y, Z float points if it available.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points are to be accessed. |
[out] | pPoints | Variable to be filled with pointer to first point in PointCloud. |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointHDsPointer | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointHD *& | pPoints, | ||
size_t & | NumPoints | ||
) |
Tries to get the 3D points from the given PointCloud.
This function gets the pointer to the internal array of X, Y, Z, W double points if it available.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points are to be accessed. |
[out] | pPoints | Variable to be filled with pointer to first point in PointCloud. |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointHFsPointer | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointHF *& | pPoints, | ||
size_t & | NumPoints | ||
) |
Tries to get the 3D points from the given PointCloud.
This function gets the pointer to the internal array of X, Y, Z, W float points if it available.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points are to be accessed. |
[out] | pPoints | Variable to be filled with pointer to first point in PointCloud. |
[out] | NumPoints | Variable to be filled with the number of points in PointCloud. |
cvbres_t CVC3DPointCloudGetPointsConfidencePointer | ( | CVCOMPOSITE | PointCloud, |
void *& | pConfidences, | ||
intptr_t & | Increment, | ||
cvbdatatype_t & | DataType | ||
) |
Tries to get the confidence components from the given PointCloud.
This is a companion function to be used with any point access function like CVC3DPointCloudGetPointComponentsPointers to access the internal buffer of the confidence plane.
rowIncrement = pointIncrement * latticeWidth
(see CVC3DPointCloudGetLatticeSize)[in] | PointCloud | Point cloud of which the points confidence are to be accessed. |
[out] | pConfidences | Variable to receive the pointer to the first confidence component of the first point. |
[out] | Increment | Increment to the next confidence component of the next point in bytes. |
[out] | DataType | Variable to receive the data type of the confidence plane. |