documentation

VLIntrinsicDataWrapper Class Reference

The VLIntrinsicDataWrapper is a wrapper for an IntrinsicData object. IntrinsicData objects represent the intrinsic camera parameters (focal length, principal point, skew and distortion parameters). More...

Inherits IDisposable.

Public Member Functions

 VLIntrinsicDataWrapper (IntPtr handle, bool owner)
 Constructor of VLIntrinsicDataWrapper. More...
 
 VLIntrinsicDataWrapper (int width, int height, double fxNorm, double fyNorm, double cxNorm, double cyNorm, double skewNorm)
 
VLIntrinsicDataWrapper Clone ()
 Creates a copy of this object and returns a Wrapper of it. More...
 
void Dispose ()
 Explicitly releases references to unmanaged resources. More...
 
bool GetCalibrated ()
 Returns whether the intrinsic parameters are valid. More...
 
double GetCalibrationError ()
 Returns the calibration error. More...
 
double GetCxNorm ()
 Returns the normalized x-component of the principal point. More...
 
double GetCyNorm ()
 Returns the normalized y-component of the principal point. More...
 
double GetFxNorm ()
 Returns the normalized focal length of the intrinsic camera calibration in x direction. More...
 
double GetFyNorm ()
 Returns the normalized focal length of the intrinsic camera calibration in y direction. More...
 
IntPtr getHandle ()
 
int GetHeight ()
 Returns the height of the intrinsic camera calibration. More...
 
bool GetProjectionMatrix (float nearFact, float farFact, int screenWidth, int screenHeight, VLRenderRotation renderRotation, int mode, float[] matrix)
 Computed the projection matrix from the intrinsic camera parameters. More...
 
bool GetRadialDistortion (double[] k)
 Retrieves the radial distortion parameters. More...
 
double GetSkewNorm ()
 Returns the normalized skew of the intrinsic camera calibration. More...
 
int GetWidth ()
 Returns the width of the intrinsic camera calibration. More...
 
bool SetRadialDistortion (double[] k)
 Sets the radial distortion parameters. More...
 

Detailed Description

The VLIntrinsicDataWrapper is a wrapper for an IntrinsicData object. IntrinsicData objects represent the intrinsic camera parameters (focal length, principal point, skew and distortion parameters).

See also
VLDataSetWrapper.GetIntrinsicData

Constructor & Destructor Documentation

◆ VLIntrinsicDataWrapper()

VLIntrinsicDataWrapper.VLIntrinsicDataWrapper ( IntPtr  handle,
bool  owner 
)
inline

Constructor of VLIntrinsicDataWrapper.

Don't call this constructor directly. Use the VLAbstractApplicationWrapper.GetDataSet and VLDataSetWrapper.GetIntrinsicData methods instead.

Parameters
handleHandle to the native object.
ownertrue, if the VLIntrinsicDataWrapper is the owner of the native object; false, otherwise.

Member Function Documentation

◆ Clone()

VLIntrinsicDataWrapper VLIntrinsicDataWrapper.Clone ( )
inline

Creates a copy of this object and returns a Wrapper of it.

Returns
A wrapper of a copy of this object.

◆ Dispose()

void VLIntrinsicDataWrapper.Dispose ( )
inline

Explicitly releases references to unmanaged resources.

Call Dispose when you are finished using the VLIntrinsicDataWrapper. The Dispose method leaves the VLIntrinsicDataWrapper in an unusable state. After calling Dispose, you must release all references to the VLIntrinsicDataWrapper so the garbage collector can reclaim the memory that the VLIntrinsicDataWrapper was occupying.

◆ GetCalibrated()

bool VLIntrinsicDataWrapper.GetCalibrated ( )
inline

Returns whether the intrinsic parameters are valid.

A intrinsic camera calibration used for tracking should always be valid.

Returns
true, if the intrinsic calibration is valid; false otherwise.

◆ GetCalibrationError()

double VLIntrinsicDataWrapper.GetCalibrationError ( )
inline

Returns the calibration error.

The reprojection error in pixel. This is interesting for evaluating the quality of a camera calibration.

Returns
NormalizedThe reprojection error in pixel.

◆ GetCxNorm()

double VLIntrinsicDataWrapper.GetCxNorm ( )
inline

Returns the normalized x-component of the principal point.

The x-component was normalized through a division by the width of the camera calibration.

Returns
Normalized x-component of the principal point.

◆ GetCyNorm()

double VLIntrinsicDataWrapper.GetCyNorm ( )
inline

Returns the normalized y-component of the principal point.

The y-component was normalized through a division by the height of the camera calibration.

Returns
Normalized y-component of the principal point.

◆ GetFxNorm()

double VLIntrinsicDataWrapper.GetFxNorm ( )
inline

Returns the normalized focal length of the intrinsic camera calibration in x direction.

The focal length in x direction was normalized through a division by the width of the camera calibration.

Returns
Normalized focal length in x direction.

◆ GetFyNorm()

double VLIntrinsicDataWrapper.GetFyNorm ( )
inline

Returns the normalized focal length of the intrinsic camera calibration in y direction.

The focal length in y direction was normalized through a division by the height of the camera calibration.

Returns
Normalized focal length in y direction.

◆ GetHeight()

int VLIntrinsicDataWrapper.GetHeight ( )
inline

Returns the height of the intrinsic camera calibration.

Returns
The height in pixels.

◆ GetProjectionMatrix()

bool VLIntrinsicDataWrapper.GetProjectionMatrix ( float  nearFact,
float  farFact,
int  screenWidth,
int  screenHeight,
VLRenderRotation  renderRotation,
int  mode,
float []  matrix 
)
inline

Computed the projection matrix from the intrinsic camera parameters.

The returned matrix is stored in the following order (column-major order):

\[ \begin{bmatrix} 0 & 4 & 8 & 12\\ 1 & 5 & 9 & 13\\ 2 & 6 & 10 & 14\\ 3 & 7 & 11 & 15\\ \end{bmatrix} \]

Returns
true, if the projection matrix was gotten successfully; false otherwise.
Parameters
nearFactValue for the near clipping plane.
farFactValue for the far clipping plane.
screenWidthWidth of the screen.
screenHeightHeight of the screen.
renderRotationHow the rendering is rotated relative to the orientation of the images received from the VisionLib. E.g., if the rendering happens in landscape-left mode and the images are also in landscape-left mode, then VLRenderRotation.CCW0 should be used. If the rendering happens in portrait mode, but the images are in landscape-left mode, then VLRenderRotation.CCW270 should be used. A default rotation for a given ScreenRotation can be obtained from VLUnityCameraHelper.GetRenderRotation.
modeThe mode defines how to handle mismatching aspect ratios. Right now the mode value is ignored, but later we will support different modes like 'cover' (scale the projection surface up until it covers the whole screen) and 'contain' (scale the projection surface down until it is completely contained inside the screen).
matrixFloat array with 16 elements for storing the projection matrix.

◆ GetRadialDistortion()

bool VLIntrinsicDataWrapper.GetRadialDistortion ( double []  k)
inline

Retrieves the radial distortion parameters.

Returns
true, on success; false otherwise.
Parameters
kDouble array with 5 elements for storing the distortion parameters.

◆ GetSkewNorm()

double VLIntrinsicDataWrapper.GetSkewNorm ( )
inline

Returns the normalized skew of the intrinsic camera calibration.

The skew was normalized through a division by the width of the camera calibration.

Returns
Normalized skew.

◆ GetWidth()

int VLIntrinsicDataWrapper.GetWidth ( )
inline

Returns the width of the intrinsic camera calibration.

Returns
The width in pixels.

◆ SetRadialDistortion()

bool VLIntrinsicDataWrapper.SetRadialDistortion ( double []  k)
inline

Sets the radial distortion parameters.

Returns
true, on success; false otherwise.
Parameters
tDouble array with 5 elements, which contains the distortion parameters.