Functions to work with PointCloud mesh objects. More...
Modules | |
Point Cloud | |
Cloud of 3D points. | |
Data Structures | |
struct | CVC3DCuboid |
3D rectangle More... | |
struct | CVC3DFactors |
Linear transformation factors for a point. More... | |
struct | CVC3DPlane |
3D plane in Hessian normal form. More... | |
struct | CVC3DPointCD |
Cartesian 3D point with confidence information (X, Y, Z, C) with double components. More... | |
struct | CVC3DPointCF |
Cartesian 3D point with confidence information (X, Y, Z, C) with float components. More... | |
struct | CVC3DPointD |
Cartesian 3D point (X, Y, Z) with double components. More... | |
struct | CVC3DPointF |
Cartesian 3D point (X, Y, Z) with float components. More... | |
struct | CVC3DPointHD |
Cartesian, homogeneous 3D point (X, Y, Z, W) with double components. More... | |
struct | CVC3DPointHF |
Cartesian, homogeneous 3D point (X, Y, Z, W) with float components. More... | |
struct | CVC3DRange |
One dimensional, inclusive range. More... | |
struct | CVC3DSensorSettings |
Camera sensor settings. More... | |
Typedefs | |
typedef cvbuint32_t * | CVC3DPolygonIndexTable |
List of polygon indices. More... | |
typedef void * | CVCOMPOSITE |
A PointCloud as seen from this library. | |
Enumerations | |
enum | CVC3DDownsampleMode { CVC3DDownsampleByFactor , CVC3DRemoveRandomly } |
enum | CVC3DPointCloudFileFormat { CVC3DPCFF_Ascii , CVC3DPCFF_Ply , CVC3DPCFF_Stl , CVC3DPCFF_WavefrontObj , CVC3DPCFF_Tiff , CVC3DPCFF_Pcd } |
enum | CVC3DPointCloudFlags { CVC3DPCF_DTFloat = 0 << 0 , CVC3DPCF_DTDouble = 1 << 0 , CVC3DPCF_XYZ = 0 << 0 , CVC3DPCF_XYZW = 1 << 5 , CVC3DPCF_XYZConfidence = 1 << 6 , CVC3DPCF_WithConfidence = 1 << 12 , CVC3DPCF_NoExtrinsic = 1 << 24 , CVC3DPCF_NoMeshIndices = 1 << 25 } |
enum | CVC3DPointCloudLayout { CVC3DPCL_Invalid , CVC3DPCL_Linear , CVC3DPCL_SeparatePlanar , CVC3DPCL_Planar , CVC3DPCL_Interleaved } |
Functions | |
cvbres_t | CVC3DCalculatePlaneFromPointDs (const CVC3DPointD *pPoints, size_t NumPoints, CVC3DPlane &Plane) |
Fits a plane into the given double pPoints. More... | |
cvbres_t | CVC3DCalculatePlaneFromPointFs (const CVC3DPointF *pPoints, size_t NumPoints, CVC3DPlane &Plane) |
Fits a plane into the given float pPoints. More... | |
cvbres_t | CVC3DConvertSparseToDensePointCloudAutomatic (CVCOMPOSITE SparseCloudIn, CVCOMPOSITE &DenseCloudOut, size_t &DroppedPoints) |
Creates a dense pointcloud from a sparse cloud. More... | |
cvbres_t | CVC3DCreateCroppedPointCloud (CVCOMPOSITE PointCloudIn, const CVC3DCuboid &ClipBox, CVCOMPOSITE &PointCloudOut) |
Creates a new point cloud which only consists of the points inside the ClipBox. More... | |
cvbres_t | CVC3DCreateDownsampledPointCloud (CVCOMPOSITE PointCloudIn, CVC3DDownsampleMode Mode, cvbint64_t Value, CVCOMPOSITE &PointCloudOut) |
Creates a new point cloud which has several points being removed dependent on the downsample Mode and Value. More... | |
cvbres_t | CVC3DCreateDuplicatePointCloud (CVCOMPOSITE PointCloudIn, CVCOMPOSITE &PointCloudOut) |
Creates a new point cloud which is a copy from PointCloudIn. More... | |
cvbres_t | CVC3DCreateFrustrumCroppedPointCloud (CVCOMPOSITE PointCloudIn, const CVC3DCuboid &ClipBox, const double Theta, const double Phi, CVCOMPOSITE &PointCloudOut) |
Creates a new point cloud which only consists of the points inside the ClipBox, where the orientation of the two boundary planes Z=Zmin and Z=Zmax can be modified by angles Theta and Phi. More... | |
cvbres_t | CVC3DCreateFrustumCroppedPointCloud (CVCOMPOSITE PointCloudIn, const CVC3DCuboid &ClipBox, double Theta, double Phi, CVCOMPOSITE &PointCloudOut) |
Creates a new point cloud which only consists of the points inside the ClipBox, where the orientation of the two boundary planes Z=Zmin and Z=Zmax can be modified by angles Theta and Phi. More... | |
cvbres_t | CVC3DCreatePlaneCroppedPointCloud (CVCOMPOSITE PointCloudIn, const CVC3DPlane &Plane, const CVC3DRange &Range, enum CVC3DCropRange CropRange, CVCOMPOSITE &PointCloudOut) |
Creates a new point cloud where points within or outside a range parallel to given Plane are cropped. More... | |
cvbres_t | CVC3DCreateRasterMeshToDensePointCloud (CVCOMPOSITE Mesh, const CVC3DMatrix CameraRotation, const CVC3DVector CameraTranslation, double XResIncrement, double YResIncrement, CVCOMPOSITE SparseTempBuffer, CVCOMPOSITE &DenseCloudOut) |
Rasters a sparse mesh into a zbuffer and stores the result a newly created DenseCloud. More... | |
cvbres_t | CVC3DCreateShrinkedDensePointCloud (CVCOMPOSITE DensePointCloudIn, CVCOMPOSITE &PointCloudOut) |
Creates a new dense point cloud where lines and columns at the borders containing only non-confident points are removed. More... | |
cvbres_t | CVC3DCreateSparseFromDensePointCloud (CVCOMPOSITE DensePointCloudIn, CVCOMPOSITE &SparsePointCloudOut) |
Creates a sparse point cloud from a dense point cloud with confidence plane. More... | |
cvbres_t | CVC3DCreateSparsePointCloudFromPointer (void **pPlaneBasePtrs, cvbdim_t NumPlanes, cvbdatatype_t Datatype, cvbint64_t NumPoints, intptr_t PlaneIncs[], PFFINALRELEASE ReleaseCallback, void *pPrivate, CVCOMPOSITE &PointCloud) |
Creates a PointCloud from the given memory without copying the data. More... | |
cvbres_t | CVC3DCreateTargetDensePointCloud (const CVCOMPOSITE &Mesh, double XResolution, double YResolution, cvbval_t Flags, CVCOMPOSITE &DensePointCloud) |
Creates a target dense pointcloud to be used for orthographic rastering. More... | |
cvbres_t | CVC3DLoadFile (const char *FileName, cvbval_t Flags, CVCOMPOSITE &PointCloud) |
Loads a 3D point, polygon or mesh file (ASCII string version). More... | |
cvbres_t | CVC3DLoadFileW (const wchar_t *FileName, cvbval_t Flags, CVCOMPOSITE &PointCloud) |
Loads a 3D point, polygon or mesh file (Unicode string version). More... | |
cvbres_t | CVC3DMemoryToPointCloud (void *Memory, size_t Size, cvbval_t Flags, CVC3DPointCloudFileFormat FileFormat, CVCOMPOSITE &PointCloud) |
Creates a point cloud from given Memory. More... | |
cvbres_t | CVC3DPointCloudCalculateBoundingBox (CVCOMPOSITE PointCloud, CVC3DCuboid &BoundingBox) |
Calculates the minimum and maximum extent of the PointCloud. More... | |
cvbres_t | CVC3DPointCloudCalculateCenterOfGravity (CVCOMPOSITE PointCloud, CVC3DPointD &Center) |
Calculates the center of gravity of the PointCloud. More... | |
cvbres_t | CVC3DPointCloudCalculateCovarianceMatrix (CVCOMPOSITE PointCloud, CVC3DMatrix Covariance) |
Calculates the covariance matrix of the PointCloud. More... | |
cvbres_t | CVC3DPointCloudCalculatePlaneFromCuboid (CVCOMPOSITE PointCloud, const CVC3DCuboid &AOI, CVC3DPlane &Plane) |
Fits a plane into the given pPoints. More... | |
cvbres_t | CVC3DPointCloudGetPolygonTable (CVCOMPOSITE Mesh, CVC3DPolygonIndexTable &PolygonTable, cvbint64_t &NumPolygons) |
Gets the mesh's polygon vertex indices embedded into the PointCloud. More... | |
cvbres_t | CVC3DPointCloudToMemory (CVCOMPOSITE PointCloud, cvbval_t Flags, CVC3DPointCloudFileFormat FileFormat, void *Memory, size_t Size) |
Saves the given PointCloud to the Memory in the given FileFormat. More... | |
cvbres_t | CVC3DPointCloudToMemorySize (CVCOMPOSITE PointCloud, cvbval_t Flags, CVC3DPointCloudFileFormat FileFormat, size_t &Size) |
Determine the amount of memory needed for CVC3DMemoryToPointCloud. More... | |
cvbres_t | CVC3DRasterMeshToDensePointCloud (CVCOMPOSITE Mesh, const CVC3DMatrix CameraRotation, const CVC3DVector CameraTranslation, CVCOMPOSITE SparseTempBuffer, CVCOMPOSITE DenseCloud) |
Rasters a sparse mesh into a zbuffer and stores the result into the given DenseCloud. More... | |
cvbres_t | CVC3DWriteFile (CVCOMPOSITE PointCloud, cvbval_t Flags, const char *FileName) |
Saves the given PointCloud to the file with the given FileName (ASCII string version). More... | |
cvbres_t | CVC3DWriteFileW (CVCOMPOSITE PointCloud, cvbval_t Flags, const wchar_t *FileName) |
Saves the given PointCloud to the file with the given FileName (Unicode string version). More... | |
Functions to work with PointCloud mesh objects.
Functions to create, copy and access PointCloud objects.
Functions to crop PointCloud objects.
Functions to raster PointCloud mesh objects to dense PointClouds..
List of polygon indices.
This structure is filled in by CVC3DPointCloudGetPolygonTable from a pointcloud that was loaded with a mesh's face information. See the documentation there on interpretation of the contents.
enum CVC3DDownsampleMode |
enum CVC3DPointCloudFlags |
Enumerator | |
---|---|
CVC3DPCF_DTFloat | Create the point cloud with float components. |
CVC3DPCF_DTDouble | Create the point cloud with double components. |
CVC3DPCF_XYZ | Create the point cloud with three Cartesian components x, y, z. |
CVC3DPCF_XYZW | Create the point cloud with four Cartesian, homogeneous components x, y, z, w. |
CVC3DPCF_XYZConfidence | Create the point cloud with three Cartesian components x, y, z and an interleaved confidence component. This implies CVC3DPCF_WithConfidence. |
CVC3DPCF_WithConfidence | Create the point cloud with an additional confidence plane. If CVC3DPCF_XYZConfidence is specified the confidence components are interleaved; an extra plane is generate otherwise. |
CVC3DPCF_NoExtrinsic | Only apply intrinsic calibration in CVC3DCreateCalibratedPointCloudFromRangeMap. |
CVC3DPCF_NoMeshIndices | Do not load mesh information in CVC3DLoadFile, even if present. |
Enumerator | |
---|---|
CVC3DPCL_Invalid | No known/supported point cloud format. |
CVC3DPCL_Linear | No known buffer layout. For this layout only the plane roles CVCPR_CoordCartesian_X, CVCPR_CoordCartesian_Y and CVCPR_CoordCartesian_Z are known with their increments. Thus the PointCloud composite either has no buffer or no buffer that can be mapped via a PFNC value. |
CVC3DPCL_SeparatePlanar | Each plane is in its own, contiguous buffer. For each plane role CVCPR_CoordCartesian_X, CVCPR_CoordCartesian_Y and CVCPR_CoordCartesian_Z exists one distinct buffer. Increment to the next element is element sized as in a simple array. If the component __cvbdatatype_t__s are float, the composite has at least three buffers with PFNC values Coord3D_A32f, Coord3D_B32f and Coord3D_C32f. |
CVC3DPCL_Planar | All planes are in one planar, contiguous buffer. All plane roles CVCPR_CoordCartesian_X, CVCPR_CoordCartesian_Y and CVCPR_CoordCartesian_Z lay component wise one after the other. First all x, then all y and finally all z components. If the component cvbdatatype_t is float, the composite has at least one buffer with a PFNC value of Coord3D_ABC32f_Planar. |
CVC3DPCL_Interleaved | All points are stored x,y,z interleaved as in CVC3DPointF. All plane roles CVCPR_CoordCartesian_X, CVCPR_CoordCartesian_Y and CVCPR_CoordCartesian_Z lay point wise one after the other. If the component cvbdatatype_t is float, the composite has at least one buffer with a PFNC value of Coord3D_ABC32f. |
cvbres_t CVC3DCalculatePlaneFromPointDs | ( | const CVC3DPointD * | pPoints, |
size_t | NumPoints, | ||
CVC3DPlane & | Plane | ||
) |
Fits a plane into the given double pPoints.
Any plane in 3D space can be found. It uses a Hessian Normal representation for the plane.
[in] | pPoints | Pointer to array of points. |
[in] | NumPoints | Number of points in pPoints. |
[out] | Plane | Reference to structure to be filled with plane data. |
cvbres_t CVC3DCalculatePlaneFromPointFs | ( | const CVC3DPointF * | pPoints, |
size_t | NumPoints, | ||
CVC3DPlane & | Plane | ||
) |
Fits a plane into the given float pPoints.
Any plane in 3D space can be found. It uses a Hessian Normal representation for the plane.
[in] | pPoints | Pointer to array of points. |
[in] | NumPoints | Number of points in pPoints. |
[out] | Plane | Reference to structure to be filled with plane data. |
cvbres_t CVC3DConvertSparseToDensePointCloudAutomatic | ( | CVCOMPOSITE | SparseCloudIn, |
CVCOMPOSITE & | DenseCloudOut, | ||
size_t & | DroppedPoints | ||
) |
Creates a dense pointcloud from a sparse cloud.
This function maps the points of a sparse pointcloud into a newly created dense pointcloud. First, a resolution is determined that minimizes the points lost by the conversion.
Similarly to CVC3DCreateRangeMapFromPointCloud, if multiple points map onto the same x, y position in the dense cloud, the one with the larger z value is retained. The output cloud always has a confidence plane, which is set to 0 if no point of the sparse cloud matched the location. It is set to 1 if a point of the sparse cloud could be mapped to that location.
If the sparse cloud has a w component, it is replicated as well.
[in] | SparseCloudIn | The source sparse point cloud. |
[out] | DenseCloudOut | Receives the newly created and filled dense point cloud. |
[out] | DroppedPoints | The number of source points that overlapped in x and y and thus got dropped. |
cvbres_t CVC3DCreateCroppedPointCloud | ( | CVCOMPOSITE | PointCloudIn, |
const CVC3DCuboid & | ClipBox, | ||
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new point cloud which only consists of the points inside the ClipBox.
The given PointCloudIn must have a valid CVC3DPointCloudLayout.
If the input point cloud is sparse, PointCloudOut has the same properties as if a new point cloud was created via CVC3DCreateSparsePointCloud.
[in] | PointCloudIn | Handle to point cloud object to copy from. |
[in] | ClipBox | Cuboid defining the bounds for the points to be copied (min/max are inclusive). |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateDownsampledPointCloud | ( | CVCOMPOSITE | PointCloudIn, |
CVC3DDownsampleMode | Mode, | ||
cvbint64_t | Value, | ||
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new point cloud which has several points being removed dependent on the downsample Mode and Value.
The following removal strategies are supported (Mode):
The given PointCloudIn must have a valid CVC3DPointCloudLayout.
[in] | PointCloudIn | Handle to point cloud object to copy from. |
[in] | Mode | Downsample strategy as described above. |
[in] | Value | Positive, non-null downsample value as described above. |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateDuplicatePointCloud | ( | CVCOMPOSITE | PointCloudIn, |
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new point cloud which is a copy from PointCloudIn.
The given PointCloudIn must have a valid CVC3DPointCloudLayout.
[in] | PointCloudIn | Handle to point cloud object to copy. |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateFrustrumCroppedPointCloud | ( | CVCOMPOSITE | PointCloudIn, |
const CVC3DCuboid & | ClipBox, | ||
const double | Theta, | ||
const double | Phi, | ||
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new point cloud which only consists of the points inside the ClipBox, where the orientation of the two boundary planes Z=Zmin and Z=Zmax can be modified by angles Theta and Phi.
For Theta, Phi = 0,0 the function will give the same result as CVC3DCreateCroppedPointCloud. Angle Theta tilts the two Z-boundary planes towards the (positive) Y-axis. Additionally, Phi rotates the tilted Z-boundary planes around the Z-axis (for Theta=0, Phi will have no effect, because it is then just an inplane-rotation). The two Z-boundary planes will stay parallel, but no longer necessarily orthogonal to the lateral boundary planes. Note, that only the Z-boundaries are tilted and not the whole bounding box, i.e. X- and Y-boundaries will stay the same.
The given PointCloudIn must have a valid CVC3DPointCloudLayout.
[in] | PointCloudIn | Handle to point cloud object to copy from. |
[in] | ClipBox | Cuboid defining the bounds for the points to be copied (min/max are inclusive). |
[in] | Theta | Tilt angle of the two Z-boundary planes Z=Zmin and Z=Zmax towards the positive Y-axis (in degrees). |
[in] | Phi | Rotation angle of the tilted Z-boundary planes around the Z-axis (in degrees). If Theta = 0, Phi will have no effect. |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateFrustumCroppedPointCloud | ( | CVCOMPOSITE | PointCloudIn, |
const CVC3DCuboid & | ClipBox, | ||
double | Theta, | ||
double | Phi, | ||
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new point cloud which only consists of the points inside the ClipBox, where the orientation of the two boundary planes Z=Zmin and Z=Zmax can be modified by angles Theta and Phi.
For Theta, Phi = 0,0 the function will give the same result as CVC3DCreateCroppedPointCloud. Angle Theta tilts the two Z-boundary planes towards the (positive) Y-axis. Additionally, Phi rotates the tilted Z-boundary planes around the Z-axis (for Theta=0, Phi will have no effect, because it is then just an inplane-rotation). The two Z-boundary planes will stay parallel, but no longer necessarily orthogonal to the lateral boundary planes. Note, that only the Z-boundaries are tilted and not the whole bounding box, i.e. X- and Y-boundaries will stay the same.
The given PointCloudIn must have a valid CVC3DPointCloudLayout.
If the input point cloud is sparse, PointCloudOut has the same properties as if a new point cloud was created via CVC3DCreateSparsePointCloud.
[in] | PointCloudIn | Handle to point cloud object to copy from. |
[in] | ClipBox | Cuboid defining the bounds for the points to be copied (min/max are inclusive). |
[in] | Theta | Tilt angle of the two Z-boundary planes Z=Zmin and Z=Zmax towards the positive Y-axis (in degrees). |
[in] | Phi | Rotation angle of the tilted Z-boundary planes around the Z-axis (in degrees). If Theta = 0, Phi will have no effect. |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreatePlaneCroppedPointCloud | ( | CVCOMPOSITE | PointCloudIn, |
const CVC3DPlane & | Plane, | ||
const CVC3DRange & | Range, | ||
enum CVC3DCropRange | CropRange, | ||
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new point cloud where points within or outside a range parallel to given Plane are cropped.
The Plane is defined by the hessian normal form:
Points are cropped within or outside a range parallel to the given Plane. The range is defined by Range. Note, that Range.Max and Range.Min are applied along normal direction.
In order to define a range around the plane, maximum and minimum range has to be positive and negative respectively.
With this function it is also possible to crop below or above a plane. Therefore a plane parallel to the xy plane has to be given and the minimum or maximum range has to be extended to infinite or very large values.
If the input point cloud is sparse, PointCloudOut has the same properties as if a new point cloud was created via CVC3DCreateSparsePointCloud.
If this function returns successfully you need to release the returned PointCloudOut via ReleaseObject if not needed anymore.
[in] | PointCloudIn | Handle to point cloud object to copy from. |
[in] | Plane | Points will be cropped parallel to this plane. |
[in] | Range | Points will be cropped within or outside this range. |
[in] | CropWithinBand | Indicates whether points should be cropped within or outside the range. |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateRasterMeshToDensePointCloud | ( | CVCOMPOSITE | Mesh, |
const CVC3DMatrix | CameraRotation, | ||
const CVC3DVector | CameraTranslation, | ||
double | XResIncrement, | ||
double | YResIncrement, | ||
CVCOMPOSITE | SparseTempBuffer, | ||
CVCOMPOSITE & | DenseCloudOut | ||
) |
Rasters a sparse mesh into a zbuffer and stores the result a newly created DenseCloud.
The resulting DenseCloudOut's lattice size is determined by the bounding box of the camera transformed Mesh and the pixel sizes XResIncrement and YResIncrement. The z values are calculated in the center of each pixel.
Note: This function expects a scene based camera with camera position and camera rotation. All mesh points are therefore transformed via R*x+R*t = y, where R is the rotation from CameraRotation and t is the translation from CameraTranslation
[in] | Mesh | Handle to pointcloud object with mesh information, usually loaded from a mesh file. |
[in] | CameraRotation | Rotation matrix for the camera. |
[in] | CameraTranslation | Translation vector of the camera. |
[in] | XResIncrement | The pixel size in x-direction. |
[in] | YResIncrement | The pixel size in y-direction. |
[in] | SparseTempBuffer | (optional) A sparse pointcloud of exactly the same size as Mesh, used as temporary storage to avoid potentially costly allocations. If an invalid object is given (e.g. NULL) a temporary buffer is allocated on each call (recommended, if you are not sure about the size of Mesh). |
[out] | DenseCloudOut | A new dense pointcloud that is filled with the rastered mesh. The lattice size of this pointcloud is defined by the bounding box of the transformed mesh and the XResIncrement and YResIncrement. |
cvbres_t CVC3DCreateShrinkedDensePointCloud | ( | CVCOMPOSITE | DensePointCloudIn, |
CVCOMPOSITE & | PointCloudOut | ||
) |
Creates a new dense point cloud where lines and columns at the borders containing only non-confident points are removed.
[in] | PointCloudIn | Handle to point cloud object to copy from. |
[out] | PointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateSparseFromDensePointCloud | ( | CVCOMPOSITE | DensePointCloudIn, |
CVCOMPOSITE & | SparsePointCloudOut | ||
) |
Creates a sparse point cloud from a dense point cloud with confidence plane.
Non-confident points will be removed and the confidence plane is not kept. PointCloudOut has the same planes as PointCloudIn (except confidence).
[in] | DensePointCloudIn | Handle to point cloud object to copy from. |
[out] | SparsePointCloudOut | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateSparsePointCloudFromPointer | ( | void ** | pPlaneBasePtrs, |
cvbdim_t | NumPlanes, | ||
cvbdatatype_t | Datatype, | ||
cvbint64_t | NumPoints, | ||
intptr_t | PlaneIncs[], | ||
PFFINALRELEASE | ReleaseCallback, | ||
void * | pPrivate, | ||
CVCOMPOSITE & | PointCloud | ||
) |
Creates a PointCloud from the given memory without copying the data.
This function creates a view on the given memory buffer(s) and creates a point cloud from it. It does not own the memory given. If you need to get notified on the disposal of the created PointCloud, you can pass a ReleaseCallback with its pPrivate. The base pointer passed to the ReleaseCallback will be pPlaneBasePtrs[0].
[in] | pPlaneBasePtrs | Base pointers of the X, Y, Z and optionally W component planes. |
[in] | NumPlanes | Number of pPlaneBasePtrs. |
[in] | Datatype | Datatype of the pPlaneBasePtrs. |
[in] | NumPoints | Number of elements in each plane. |
[in] | PlaneIncs | Offset to the next component in the respective plane in bytes. |
[in] | ReleaseCallback | Optional callback to get notified when the returned PointCloud is released. |
[in] | pPrivate | Private data pointer, e.g. object pointer, to be passed to the ReleaseCallback. |
[out] | PointCloud | Variable to receive the handle of the resulting point cloud. |
cvbres_t CVC3DCreateTargetDensePointCloud | ( | const CVCOMPOSITE & | Mesh, |
double | XResolution, | ||
double | YResolution, | ||
cvbval_t | Flags, | ||
CVCOMPOSITE & | DensePointCloud | ||
) |
Creates a target dense pointcloud to be used for orthographic rastering.
This function creates a dense point cloud with suitable size to raster the given mesh from all angles. It will calculate the maximum size for the sensor to store all rastered points and preallocate the necessary storage.
Using this function prior to rastering an object from multiple angles and positions will speed up the progress.
Note: This calculation depends on the given X and Y resolutions. While the position and rotation of the camera as well as the object can change, the resolution must be fixed.
[in] | Mesh | The mesh object to process. |
[in] | XResolution | The horizontal scan resolution of the sensor in object-units per pixel |
[in] | YResolution | The vertical scan resolution of the sensor in object - units per pixel. |
[in] | Flags | CVC3DPointCloudFlags specifying the kind of point cloud to be created. |
[out] | DensePointCloud | Target dense pointcloud with prealocated storage. |
cvbres_t CVC3DLoadFile | ( | const char * | FileName, |
cvbval_t | Flags, | ||
CVCOMPOSITE & | PointCloud | ||
) |
Loads a 3D point, polygon or mesh file (ASCII string version).
The following file formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Stereo Lithography | stl |
Wavefront OBJ | obj |
TIFF | tif, tiff |
ASCII | asc, pts, txt, xyz |
PCL Format | pcd |
The resulting point cloud is created via CVC3DCreateSparsePointCloud except for TIFF which maybe created via CVC3DCreateDensePointCloud if the image height is larger than one.
[in] | FileName | Full path to the file to load. |
[in] | Flags | CVC3DPointCloudFlags specifying the kind of point cloud to be created. |
[out] | PointCloud | Variable to receive the loaded object. |
NULL
or Flags have an unsupported combination.cvbres_t CVC3DLoadFileW | ( | const wchar_t * | FileName, |
cvbval_t | Flags, | ||
CVCOMPOSITE & | PointCloud | ||
) |
Loads a 3D point, polygon or mesh file (Unicode string version).
The following file formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Stereo Lithography | stl |
Wavefront OBJ | obj |
TIFF | tif, tiff |
ASCII | asc, pts, txt, xyz |
PCL Format | pcd |
The resulting point cloud is created via CVC3DCreateSparsePointCloud except for TIFF which maybe created via CVC3DCreateDensePointCloud if the image height is larger than one.
[in] | FileName | Full path to the file to load. |
[in] | Flags | CVC3DPointCloudFlags specifying the kind of point cloud to be created. |
[out] | PointCloud | Variable to receive the loaded object. |
NULL
or Flags have an unsupported combination.cvbres_t CVC3DMemoryToPointCloud | ( | void * | Memory, |
size_t | Size, | ||
cvbval_t | Flags, | ||
CVC3DPointCloudFileFormat | FileFormat, | ||
CVCOMPOSITE & | PointCloud | ||
) |
Creates a point cloud from given Memory.
The following data formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Wavefront OBJ | obj |
Stereo Lithography | stl |
ASCII | asc, pts, txt, xyz |
The resulting point cloud is created via CVC3DCreateSparsePointCloud .
[in] | Memory | Buffer containing the data that is to be read. |
[in] | Size | The number of bytes in the Memory buffer. |
[in] | Flags | CVC3DPointCloudFlags specifying the kind of point cloud to be created. |
[in] | FileFormat | The data format the buffer is in. |
[out] | PointCloud | Variable to receive the loaded object. |
NULL
, Size is 0, or Flags have an unsupported combination.cvbres_t CVC3DPointCloudCalculateBoundingBox | ( | CVCOMPOSITE | PointCloud, |
CVC3DCuboid & | BoundingBox | ||
) |
Calculates the minimum and maximum extent of the PointCloud.
[in] | PointCloud | Point cloud of which to calculate the extend. |
[out] | BoundingBox | Variable to receive the extent. |
cvbres_t CVC3DPointCloudCalculateCenterOfGravity | ( | CVCOMPOSITE | PointCloud, |
CVC3DPointD & | Center | ||
) |
Calculates the center of gravity of the PointCloud.
[in] | PointCloud | Point cloud of which to calculate the extend. |
[out] | Center | Variable to receive the center. |
cvbres_t CVC3DPointCloudCalculateCovarianceMatrix | ( | CVCOMPOSITE | PointCloud, |
CVC3DMatrix | Covariance | ||
) |
Calculates the covariance matrix of the PointCloud.
The trace of this matrix contains the components variances (xx, yy, zz). The other cells the respective covariances (xy, xz, ...).
[in] | PointCloud | Point cloud of which to calculate the extend. |
[out] | Covariance | Matrix to be filled. |
cvbres_t CVC3DPointCloudCalculatePlaneFromCuboid | ( | CVCOMPOSITE | PointCloud, |
const CVC3DCuboid & | AOI, | ||
CVC3DPlane & | Plane | ||
) |
Fits a plane into the given pPoints.
Any plane in 3D space can be found. It uses a Hessian Normal representation for the plane.
[in] | PointCloud | Point cloud of which points are to be taken. |
[in] | AOI | Cuboid of the region of points to be considered for plane fit. |
[out] | Plane | Reference to structure to be filled with plane data. |
cvbres_t CVC3DPointCloudGetPolygonTable | ( | CVCOMPOSITE | Mesh, |
CVC3DPolygonIndexTable & | PolygonTable, | ||
cvbint64_t & | NumPolygons | ||
) |
Gets the mesh's polygon vertex indices embedded into the PointCloud.
If PointCloud was loaded with mesh information, this is retrieved otherwise NumPolygons is set to 0 and an error code is returned.
[in] | Mesh | Handle to pointcloud object with mesh information. |
[out] | PolygonTable | Pointer to receive the address to the index table. |
[out] | NumPolygons | The number of polygons represented in PolygonTable. |
cvbres_t CVC3DPointCloudToMemory | ( | CVCOMPOSITE | PointCloud, |
cvbval_t | Flags, | ||
CVC3DPointCloudFileFormat | FileFormat, | ||
void * | Memory, | ||
size_t | Size | ||
) |
Saves the given PointCloud to the Memory in the given FileFormat.
The data format to be used is determined by the FileFormat. The following file formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Wavefront OBJ | obj |
Stereo Lithography | stl |
ASCII | asc, pts, txt, xyz |
CVC3DPointCloudToMemorySize can be used to determine the required size for Memory.
[in] | PointCloud | Point cloud object to save. |
[in] | Flags | Ignored so far. |
[in] | FileFormat | The data format to be used for the export. |
[in,out] | Memory | The buffer, that the export should be written to. |
[in] | Size | The size of the buffer in bytes. |
NULL
or Size is 0. cvbres_t CVC3DPointCloudToMemorySize | ( | CVCOMPOSITE | PointCloud, |
cvbval_t | Flags, | ||
CVC3DPointCloudFileFormat | FileFormat, | ||
size_t & | Size | ||
) |
Determine the amount of memory needed for CVC3DMemoryToPointCloud.
The data format to be considered is determined by the FileFormat. The following file formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Wavefront OBJ | obj |
Stereo Lithography | stl |
ASCII | asc, pts, txt, xyz |
[in] | PointCloud | Point cloud object to save. |
[in] | Flags | Ignored so far. |
[in] | FileFormat | The data format to be used for the export. |
[in,out] | Size | The size of the buffer in bytes. |
cvbres_t CVC3DRasterMeshToDensePointCloud | ( | CVCOMPOSITE | Mesh, |
const CVC3DMatrix | CameraRotation, | ||
const CVC3DVector | CameraTranslation, | ||
CVCOMPOSITE | SparseTempBuffer, | ||
CVCOMPOSITE | DenseCloud | ||
) |
Rasters a sparse mesh into a zbuffer and stores the result into the given DenseCloud.
The z values are calculated in the center of each pixel.
Note: This function expects a scene based camera with camera position and camera rotation. All mesh points are therefore transformed via R*x+R*t = y, where R is the rotation from CameraRotation and t is the translation from CameraTranslation
[in] | Mesh | Handle to pointcloud object with mesh information, usually loaded from a mesh file. |
[in] | CameraRotation | Rotation matrix for the camera. |
[in] | CameraTranslation | Translation vector of the camera. |
[in] | SparseTempBuffer | (optional) A sparse pointcloud of exactly the same size as Mesh, used as temporary storage to avoid potentially costly allocations. If an invalid object is given (e.g. NULL) a temporary buffer is allocated on each call (recommended, if you are not sure about the size of Mesh). |
[in,out] | DenseCloud | The preallocated dense pointcloud with confidence plane that is filled with the rastered mesh. The lattice size of this pointcloud defines the resolution that is used for rasterization. |
cvbres_t CVC3DWriteFile | ( | CVCOMPOSITE | PointCloud, |
cvbval_t | Flags, | ||
const char * | FileName | ||
) |
Saves the given PointCloud to the file with the given FileName (ASCII string version).
The type of file to be saved is determined by the FileName extension. The following file formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Wavefront OBJ | obj |
Stereo Lithography | stl |
TIFF | tif, tiff |
ASCII | asc, pts, txt, xyz |
PCL Format | pcd |
[in] | PointCloud | Point cloud object to save. |
[in] | Flags | Ignored so far. |
[in] | FileName | Full path where to save the file to. |
NULL
cvbres_t CVC3DWriteFileW | ( | CVCOMPOSITE | PointCloud, |
cvbval_t | Flags, | ||
const wchar_t * | FileName | ||
) |
Saves the given PointCloud to the file with the given FileName (Unicode string version).
The type of file to be saved is determined by the FileName extension. The following file formats are supported:
Name | Extension(s) |
---|---|
Polygon File Format | ply |
Wavefront OBJ | obj |
Stereo Lithography | stl |
TIFF | tif, tiff |
ASCII | asc, pts, txt, xyz |
PCL Format | pcd |
[in] | PointCloud | Point cloud object to save. |
[in] | Flags | Ignored so far. |
[in] | FileName | Full path where to save the file to. |
NULL