CVB.Net 14.0
SparsePointCloud Class Reference

Sparse point cloud object. More...

Inherits PointCloud.

Public Member Functions

 SparsePointCloud (long numPoints)
 Constructor. More...
 
 SparsePointCloud (long numPoints, PointCloudFlags flags)
 Constructor. More...
 
SparseComponentsPointer3D< T > GetComponentsPointer3D< T > ()
 Gets the generic components pointer for this point cloud. More...
 
DensePointCloud ToDensePointCloud (ConversionMode conversionMode=ConversionMode.Automatic)
 Creates a dense pointcloud from a sparse cloud. More...
 
DensePointCloud ToDensePointCloud (out long numDroppedPoints, ConversionMode conversionMode=ConversionMode.Automatic)
 Creates a dense pointcloud from a sparse cloud. More...
 
- Public Member Functions inherited from PointCloud
void Dispose ()
 IDisposable implementation.
 
PointCloud Clone ()
 Creates a new point cloud which is a copy of this point cloud. More...
 
IEnumerable< T > TryEnumeratePointsAs< T > ()
 Tries to get the points of this point cloud. More...
 

Static Public Member Functions

static SparsePointCloud Create< T > (long numPoints)
 Creates a new point cloud with the specified numPoints and components of the given type T . More...
 
- Static Public Member Functions inherited from PointCloud
static PointCloud FromFile (string fileName)
 Loads a point cloud from the given fileName . More...
 
static PointCloud FromFile (string fileName, PointCloudFlags flags)
 Loads a point cloud from the given fileName with the specified flags . More...
 
static PointCloud FromComposite (Composite obj)
 Create a point cloud from the given Composite obj . More...
 
static PointCloud FromHandle (IntPtr handle, ShareObject doShare)
 Creates a point cloud from the given handle . More...
 
static PointCloud FromMemory< T > (byte[] buffer, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 
static PointCloud FromMemory (byte[] buffer, PointCloudFlags flags, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 
static PointCloud FromMemory< T > (IntPtr buffer, long bufferSize, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 
static PointCloud FromMemory (IntPtr buffer, long bufferSize, PointCloudFlags flags, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PointCloud
 PointCloud (IntPtr handle)
 Constructor. More...
 
 PointCloud (IntPtr handle, UseMemoryPressure useMemoryPressure)
 Constructor. More...
 
virtual void Dispose (bool disposing)
 IDisposable helper function. More...
 
- Properties inherited from PointCloud
IntPtr Handle [get]
 Native handle of the PointCloud.
 
bool IsDisposed [get]
 Gets if the native handle has been disposed.
 
PointCloudLayout Layout [get]
 The layout of the buffer / planes.
 
DataType DataType [get]
 The data type.
 
long NumPoints [get]
 Number of points.
 
ComponentsPointer3D PointComponents [get]
 The pointer components for the points.
 
PlaneEnumerator Planes [get]
 Gets all the component planes of this point cloud.
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 
- Events inherited from PointCloud
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method. More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Sparse point cloud object.

A sparse point cloud is logically seen an array of 3D points. There is no order or neighboring information between the single points.

It has less memory than a dense point cloud.

Conversion to a dense point cloud is difficult, as the grid thus neighbor information is missing.

Constructor & Destructor Documentation

◆ SparsePointCloud() [1/2]

SparsePointCloud ( long  numPoints)

Constructor.

Parameters
numPointsAmount of points to create.

◆ SparsePointCloud() [2/2]

SparsePointCloud ( long  numPoints,
PointCloudFlags  flags 
)

Constructor.

For detailed information see SparsePointCloud.CreateHandle.


Parameters
numPointsAmount of points to create.
flagsFlags to create point cloud with.

Member Function Documentation

◆ Create< T >()

static SparsePointCloud Create< T > ( long  numPoints)
static

Creates a new point cloud with the specified numPoints and components of the given type T .

For detailed information see SparsePointCloud.CreateHandle.


Template Parameters
TOne of the Stemmer.Cvb.Point3D point types.
Parameters
numPointsAmount of points to create.
Returns
Newly created point cloud.
Exceptions
ArgumentExceptionWhen T is not double or float.
CvbExceptionWhen creating the sparse point cloud failed.
Type Constraints
T :struct 

◆ GetComponentsPointer3D< T >()

SparseComponentsPointer3D< T > GetComponentsPointer3D< T > ( )

Gets the generic components pointer for this point cloud.

Template Parameters
TType of the points.
Returns
Generic components pointer for this point cloud.
Type Constraints
T :struct 

◆ ToDensePointCloud() [1/2]

DensePointCloud ToDensePointCloud ( ConversionMode  conversionMode = ConversionMode.Automatic)

Creates a dense pointcloud from a sparse cloud.

Parameters
conversionModeMode used to convert pointcloud.
Returns
Newly created and filled dense point 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. If multiple points map onto the same x,y position in the dense point 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.

◆ ToDensePointCloud() [2/2]

DensePointCloud ToDensePointCloud ( out long  numDroppedPoints,
ConversionMode  conversionMode = ConversionMode.Automatic 
)

Creates a dense pointcloud from a sparse cloud.

Parameters
numDroppedPointsThe number of source points that overlapped in x and y and thus got dropped.
conversionModeMode used to convert pointcloud.
Returns
Newly created and filled dense point 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. If multiple points map onto the same x,y position in the dense point 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.