CVB.Net 14.1
Calibrator3D Class Reference

Object used to reconstruct point clouds. More...

Inherits INativeHandle.

Inherited by LaserPlaneCalibrator3D, MatrixCalibrator3D, and PinholeCameraCalibrator3D.

Public Member Functions

void Dispose ()
 IDisposable implementation.
 
PointCloud CreatePointCloud< T > (Image rangeMap)
 Creates a calibrated PointCloud with point type T from the given rangeMap . More...
 
PointCloud CreatePointCloud (Image rangeMap, PointCloudFlags flags)
 Creates a calibrated PointCloud using the given rangeMap and flags . More...
 
PointCloud CreatePointCloud (Image rangeMap, PointCloudFlags flags, SensorSettings settings, double encoderStep)
 Creates a calibrated PointCloud using the given rangeMap and flags . More...
 

Static Public Member Functions

static Calibrator3D FromFile (string fileName)
 Loads a 3D calibration file (ASCII string version). More...
 
static T FromFile< T > (string fileName)
 Loads a 3D calibration file (ASCII string version). More...
 
static Calibrator3D FromHandle (IntPtr nativeHandle, ShareObject doShare)
 Create a Calibrator3D from a native handle and potentially increment the unmanaged reference count on the native handle. More...
 

Protected Member Functions

 Calibrator3D (IntPtr handle)
 Constructor. More...
 
virtual void Dispose (bool disposing)
 IDisposable helper function. More...
 

Properties

IntPtr Handle [get]
 Native handle of the calibrator.
 
bool IsDisposed [get]
 Gets if the native handle has been disposed.
 
AffineMatrix3D ExtrinsicMatrix [get, set]
 Gets/sets the extrinsic transformation matrix of the calibrator. More...
 
double? RangeMapIgnoreValue [get, set]
 Gets/sets the ignore value for range maps. More...
 
- 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

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

Object used to reconstruct point clouds.

Constructor & Destructor Documentation

◆ Calibrator3D()

Calibrator3D ( IntPtr  handle)
protected

Constructor.

Parameters
handleNative handle of the calibrator.
Exceptions
ArgumentExceptionWhen handle is IntPtr.Zero.

Member Function Documentation

◆ CreatePointCloud() [1/2]

PointCloud CreatePointCloud ( Image  rangeMap,
PointCloudFlags  flags 
)

Creates a calibrated PointCloud using the given rangeMap and flags .

Depending on the calibration method the resulting point cloud is a DensePointCloud or a SparsePointCloud.

Note, that if the output point cloud is dense, the confidence layer is always available. Background range map pixels are set non-confident. In case of a sparse point cloud, points representing background values and also the confidence layer are removed (except the user explicitly wants to keep the confidence layer which can be fixed via the point cloud flags).

The following DataType.BytesPerPixel as input for unsigned integer DataType values are supported: 1, 2 and 4. For floating point DataType values only 4 and 8 DataType.BytesPerPixel are supported. Note, that only linear access is supported (check with function ImagePlane.TryGetLinearAccess).

Parameters
rangeMapRange map to use.
flagsFlags used for point cloud creation.
Returns
Newly created, calibrated point cloud.

◆ CreatePointCloud() [2/2]

PointCloud CreatePointCloud ( Image  rangeMap,
PointCloudFlags  flags,
SensorSettings  settings,
double  encoderStep 
)

Creates a calibrated PointCloud using the given rangeMap and flags .

Note, that the calibration parameters always refer to the whole sensor (with no mirroring of the pixel coordinates). If the camera settings indicate, that a sensor ROI is given or pixel coordinates are mirrored, the range map values will be transformed to the sensor coordinates before applying the calibration parameters. If the user acquires the range map to be calibrated and uses sensor settings different from the default ones, he has to set them correctly via this function.

If you only like to change one or two settings and do not want to care about the other parameters, you can get the default settings via LaserPlaneCalibrator3D.SensorSettings, change the relevant settings within the struct and pass it to CreatePointCloud. The default encoder step can also be get from the calibrator via LaserPlaneCalibrator3D.YFactor.

Depending on the calibration method the resulting point cloud is a DensePointCloud or a SparsePointCloud.

Note, that if the output point cloud is dense, the confidence layer is always available. Background range map pixels are set non-confident. In case of a sparse point cloud, points representing background values and also the confidence layer are removed (except the user explicitly wants to keep the confidence layer which can be fixed via the point cloud flags).

The following DataType.BytesPerPixel as input for unsigned integer DataType values are supported: 1, 2 and 4. For floating point DataType values only 4 and 8 DataType.BytesPerPixel are supported. Note, that only linear access is supported (check with function ImagePlane.TryGetLinearAccess).

Parameters
rangeMapRange map to use.
flagsFlags used for point cloud creation.
settingsSensor settings applied during the acquisition of the range map.
encoderStepEncoder step.
Returns
Newly created, calibrated point cloud.

◆ CreatePointCloud< T >()

PointCloud CreatePointCloud< T > ( Image  rangeMap)

Creates a calibrated PointCloud with point type T from the given rangeMap .

The following DataType.BytesPerPixel as input for unsigned integer DataType values are supported: 1, 2 and 4. For floating point DataType values only 4 and 8 DataType.BytesPerPixel are supported. Note, that only linear access is supported (check with function ImagePlane.TryGetLinearAccess).

Template Parameters
TPoint type to create; e.g. Point3Dcf.
Parameters
rangeMapRange map to use.
Returns
Newly created, calibrated point cloud.
Type Constraints
T :struct 

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDisposable helper function.

Parameters
disposing

◆ FromFile()

static Calibrator3D FromFile ( string  fileName)
static

Loads a 3D calibration file (ASCII string version).

Parameters
fileNameFull path to the file to load.
Returns
Calibrator for the loaded calibration file.
Exceptions
ArgumentExceptionWhen the fileName is null or empty.
CvbExceptionWhen loading the Calibrator3D from file failed.

◆ FromFile< T >()

static T FromFile< T > ( string  fileName)
static

Loads a 3D calibration file (ASCII string version).

Parameters
fileNameFull path to the file to load.
Template Parameters
TType of the calibrator.
Returns
Calibrator for the loaded calibration file.
Exceptions
ArgumentExceptionWhen the fileName is null or empty.
CvbExceptionWhen loading the Calibrator3D from file failed.
Type Constraints
T :Calibrator3D 

◆ FromHandle()

static Calibrator3D FromHandle ( IntPtr  nativeHandle,
ShareObject  doShare 
)
static

Create a Calibrator3D from a native handle and potentially increment the unmanaged reference count on the native handle.

Note that this function is not intended for general use. Providing invalid values on the nativeHandle parameter will most likely lead to severe problems in your application.

Parameters
nativeHandleHandle to create the image from.
doShareShareObject.Yes if nativeHandle is to be shared.
Returns
Newly created calibrator or null of no object could be created.

Property Documentation

◆ ExtrinsicMatrix

AffineMatrix3D ExtrinsicMatrix
getset

Gets/sets the extrinsic transformation matrix of the calibrator.

Exceptions
CvbExceptionWhen setting or getting the extrinsic matrix failed.

◆ RangeMapIgnoreValue

double? RangeMapIgnoreValue
getset

Gets/sets the ignore value for range maps.

An value equal to this one in an input range map will have its confidence in the resulting point being set to 0.

If a non-null value is set the resulting point cloud will always have a confidence plane!

Value to ignore in an input range map; null if no values are to be ignored.

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.