Raytrix Light Field SDK  v3.1
Logo
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
Light Field Calibration API functions

Methods to perform a camera calibration. More...

Functions

RXLF_API void Rx::ApiLF::RxMetricCalibAddBoundImage (unsigned &nObjectId)
 Add the currently bound image to metric calibration. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibApplyCalibrationToBoundImage ()
 Apply the computed metric calibration to a newly bound image. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibEvaluatePointSpaceCoverage (CRxArrayDouble &aAreaCovered)
 Evaluate the metric calibration data set. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibExecute (Rx::ApiLF::EMetricCalibResult::ID &eResult, bool bCalibrateAfterInit=true)
 Performs the metric calibration. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibFinalize ()
 Clears the metric calibration. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibFindPoints (Rx::CRxImage &xRefocusedImage, Rx::CRxArray2DDouble &matPoints2D)
 Raytrix metric calib transform bound image to point model. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetAddImageResult (const unsigned uObjectId, Rx::CRxMetricCalibAddImageResult &smcAddObjectResult)
 Get result to an object id. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetAllObjectIds (CRxArrayUInt &aObjectIds)
 Get all valid object ids from the metric calibration. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetModelsList (Rx::CRxArray2DDouble &matModelsList)
 Get the list of all models extracted from the added image. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetPointConnections (const unsigned uId, const EMetricCalibPointType::ID ePointType, Rx::CRxArray2DDouble &matLines)
 Get All point connections. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetPointEllipses (const unsigned uId, const EMetricCalibPointFilter::ID ePointFilter, const Rx::CRxImageFormat &xTargetImageFormat, Rx::CRxArray2DDouble &matPointEllipses)
 Get the list of specific point ellipses. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetPoints (const unsigned uId, const EMetricCalibPointFilter::ID ePointFilter, const EMetricCalibPointType::ID ePointType, Rx::CRxArray2DDouble &matPoints)
 Get specific points from the models. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetRefocusedImage (const unsigned uObjectId, Rx::CRxImage &xImage)
 Get the refocused image from the metric calibration. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibGetResult (Rx::CRxMetricCalibResult &xMetricCalibResult)
 Evaluated the calibration result. That is, the error function of the calibration is executed once with the current parameter settings and mean residual, mean euclidean distance, min euclidean distance, max euclidean distance and the standard deviation. Note that this function also projects all test points of all test models to object space. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibInitialize (Rx::ApiLF::EMetricCalibrationType::ID eCalibrationType)
 Initialize metric calibration. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibLoadCalibration (const Rx::CRxString &sxFilename)
 Load a '.rxcalib' file from file system, containing a calibrated system. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibLoadPlanarModelData (const Rx::CRxString &sxFilename, CRxArrayUInt &aObjectIds)
 Load planar model data. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibProjectPointsIntoObjectSpace (const CRxArray2DDouble &matPoints2D, Rx::CRxImage &xDepthImage, CRxArray2DDouble &matPoints3D)
 Receive metric calib projection points into object space. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibRegisterCallbackFunctionWithMessageHandler (bool bRegister)
 Registers the callback function of the metric calibration to the api message handler. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibRemoveModelFromCalibrationSet (const unsigned nObjectId)
 Removes the models of the object given by its object id from the calibration set. Changes the result information related to this object id. You can receive the information of an object by calling Rx::ApiLF::RxMetricCalibGetAddImageResult. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibResetToNominal ()
 Reset the metric calibration to nominal values. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibSaveCalibration (const Rx::CRxString &sxFilename)
 Save the converged calibration result. More...
 
RXLF_API void Rx::ApiLF::RxMetricCalibSavePlanarModelData (const Rx::CRxString &sxFilename)
 Save planar model to filesystem. More...
 
RXLF_API void Rx::ApiLF::RxMlaCalibExecute (Rx::ApiLF::EMlaCalibResult::ID &eResult, bool bIgnoreImageQuality=true)
 Calibrate the micro lens image grid using white image from bound image. More...
 
RXLF_API void Rx::ApiLF::RxMlaCalibGetGridData (Rx::CRxArrayDouble &aLensCenter, float &fLensRadius, int iLensType)
 Get the lens center positions of given type in pixel coordinates. The corresponding lensRadius is returned. More...
 
RXLF_API bool Rx::ApiLF::RxMlaCalibParallelLightExecute ()
 Calibrate the MLA properties using a parallel light image. Calibration has to be augmented by a white-image calibration to be valid. More...
 
RXLF_API void Rx::ApiLF::RxMlaCalibRegisterCallbackFunction (bool bActivate)
 Enables/Disables progress callback of Rx::ApiLF::RxMlaCalibExecute / Rx::ApiLF::RxMlaCalibParallelLightExecute. More...
 

Detailed Description

Methods to perform a camera calibration.

Function Documentation

RXLF_API void Rx::ApiLF::RxMetricCalibAddBoundImage ( unsigned &  nObjectId)

Add the currently bound image to metric calibration.

The currently bound image is added to extract all planar models found in this image. Thereafter all test models are created from all extracted planar models. Afterwards the Test models are filtered for optimization reasons. The ID of the newly created object is returned in nObjectId

Precondition
An image must be bound before calling this function.
Parameters
[out]nObjectIdThe Id of the newly created object.
RXLF_API void Rx::ApiLF::RxMetricCalibApplyCalibrationToBoundImage ( )

Apply the computed metric calibration to a newly bound image.

RXLF_API void Rx::ApiLF::RxMetricCalibEvaluatePointSpaceCoverage ( CRxArrayDouble &  aAreaCovered)

Evaluate the metric calibration data set.

Parameters
[in,out]aAreaCoveredA vector containing the number of points in each area. The scene is divided into 12 parts and is sorted as follows
Index Area
0 Left Down Front
1 Left Down Middle
2 Left Down Back
3 Left Up Front
4 Left Up Middle
5 Left Up Back
6 Right Down Front
7 Right Down Middle
8 Right Down Back
9 Right Up Front
10 Right Up Middle
11 Right Up Back
RXLF_API void Rx::ApiLF::RxMetricCalibExecute ( Rx::ApiLF::EMetricCalibResult::ID eResult,
bool  bCalibrateAfterInit = true 
)

Performs the metric calibration.

Precondition
An image must be bound before calling this function.
Attention
Associated Api Parameters:
Parameters
eResultThe result.
bCalibrateAfterInit(Optional) Indicates whether the actual calibration should be performed after the first initial iteration. If not this function performs only the first iteration which includes the initial error evaluation. This can be used to display the point situation before calibration.
RXLF_API void Rx::ApiLF::RxMetricCalibFinalize ( )

Clears the metric calibration.

RXLF_API void Rx::ApiLF::RxMetricCalibFindPoints ( Rx::CRxImage xRefocusedImage,
Rx::CRxArray2DDouble matPoints2D 
)

Raytrix metric calib transform bound image to point model.

Parameters
[in]xRefocusedImageThe refocused image.
[out]matPoints2DThe mat points 2 d.
RXLF_API void Rx::ApiLF::RxMetricCalibGetAddImageResult ( const unsigned  uObjectId,
Rx::CRxMetricCalibAddImageResult smcAddObjectResult 
)

Get result to an object id.

Parameters
uObjectIdIdentifier for the object.
[in,out]smcAddObjectResultThe metric calibration add object result.
RXLF_API void Rx::ApiLF::RxMetricCalibGetAllObjectIds ( CRxArrayUInt &  aObjectIds)

Get all valid object ids from the metric calibration.

Parameters
[out]aObjectIdsList of identifiers for the objects.
RXLF_API void Rx::ApiLF::RxMetricCalibGetModelsList ( Rx::CRxArray2DDouble matModelsList)

Get the list of all models extracted from the added image.

Parameters
[out]matModelsListArray of the models (planar models, test models). The first element in the array (0,0) (0, 1) represents the count of the respective model type.
RXLF_API void Rx::ApiLF::RxMetricCalibGetPointConnections ( const unsigned  uId,
const EMetricCalibPointType::ID  ePointType,
Rx::CRxArray2DDouble matLines 
)

Get All point connections.

Attention
The point connections are only created when the Box-Calibration is performed
Parameters
uIdThe identifier.
[in,out]matList[in,out] An array of all connected points.
RXLF_API void Rx::ApiLF::RxMetricCalibGetPointEllipses ( const unsigned  uId,
const EMetricCalibPointFilter::ID  ePointFilter,
const Rx::CRxImageFormat xTargetImageFormat,
Rx::CRxArray2DDouble matPointEllipses 
)

Get the list of specific point ellipses.

Parameters
uIdThe identifier of the test model.
ePointFilterA filter specifying the point.
xTargetImageFormatThe target image format on which the ellipses are to be drawn.
[out]matPointEllipsesThe array of point ellipses.
RXLF_API void Rx::ApiLF::RxMetricCalibGetPoints ( const unsigned  uId,
const EMetricCalibPointFilter::ID  ePointFilter,
const EMetricCalibPointType::ID  ePointType,
Rx::CRxArray2DDouble matPoints 
)

Get specific points from the models.

Parameters
uIdThe identifier of the model.
ePointFilterA filter specifying the point.
ePointTypeType of the point.
[out]matPointsAn array of all points (x,y,z).
RXLF_API void Rx::ApiLF::RxMetricCalibGetRefocusedImage ( const unsigned  uObjectId,
Rx::CRxImage xImage 
)

Get the refocused image from the metric calibration.

Parameters
uObjectIdIdentifier for the object.
[in,out]xImageThe image.
RXLF_API void Rx::ApiLF::RxMetricCalibGetResult ( Rx::CRxMetricCalibResult xMetricCalibResult)

Evaluated the calibration result. That is, the error function of the calibration is executed once with the current parameter settings and mean residual, mean euclidean distance, min euclidean distance, max euclidean distance and the standard deviation. Note that this function also projects all test points of all test models to object space.

Attention
The calibration result contains: -The mean residual -The mean euclidean distance -The minimum euclidean distance -The maximum euclidean distance -The standard deviation. -The percentage error of the longest path found in the model
Parameters
[out]xMetricCalibResultThe metric calib result.
RXLF_API void Rx::ApiLF::RxMetricCalibInitialize ( Rx::ApiLF::EMetricCalibrationType::ID  eCalibrationType)

Initialize metric calibration.

Parameters
eCalibrationTypeType of the calibration.
RXLF_API void Rx::ApiLF::RxMetricCalibLoadCalibration ( const Rx::CRxString sxFilename)

Load a '.rxcalib' file from file system, containing a calibrated system.

Parameters
sxFilenameFilename of the calibration file.
RXLF_API void Rx::ApiLF::RxMetricCalibLoadPlanarModelData ( const Rx::CRxString sxFilename,
CRxArrayUInt &  aObjectIds 
)

Load planar model data.

Parameters
sxFilenameFilename of the model data.
[in]aObjectIdsList of identifiers for the objects.
RXLF_API void Rx::ApiLF::RxMetricCalibProjectPointsIntoObjectSpace ( const CRxArray2DDouble &  matPoints2D,
Rx::CRxImage xDepthImage,
CRxArray2DDouble &  matPoints3D 
)

Receive metric calib projection points into object space.

Parameters
matPoints2DThe matrix points 2 d.
[in]xDepthImageThe depth image.
[out]matPoints3DThe matrix points 3 d.
RXLF_API void Rx::ApiLF::RxMetricCalibRegisterCallbackFunctionWithMessageHandler ( bool  bRegister)

Registers the callback function of the metric calibration to the api message handler.

Parameters
bRegistertrue to register.
RXLF_API void Rx::ApiLF::RxMetricCalibRemoveModelFromCalibrationSet ( const unsigned  nObjectId)

Removes the models of the object given by its object id from the calibration set. Changes the result information related to this object id. You can receive the information of an object by calling Rx::ApiLF::RxMetricCalibGetAddImageResult.

Parameters
[in]nObjectIdIdentifier for the object.
RXLF_API void Rx::ApiLF::RxMetricCalibResetToNominal ( )

Reset the metric calibration to nominal values.

RXLF_API void Rx::ApiLF::RxMetricCalibSaveCalibration ( const Rx::CRxString sxFilename)

Save the converged calibration result.

Attention
The filename must end with '.rxcalib'.
Parameters
sxFilenameFilename of the calibration to save.
RXLF_API void Rx::ApiLF::RxMetricCalibSavePlanarModelData ( const Rx::CRxString sxFilename)

Save planar model to filesystem.

Parameters
sxFilenameFilename of the .calib file.
RXLF_API void Rx::ApiLF::RxMlaCalibExecute ( Rx::ApiLF::EMlaCalibResult::ID eResult,
bool  bIgnoreImageQuality = true 
)

Calibrate the micro lens image grid using white image from bound image.

This function attempts an automatic calibration of the micro lens image parameters. If a parallel light image calibration is available for the bound image, it is augmented. Else a standard white image calibration is performed.

Warning
If the micro-image parameter (i.e. position and pitch) are too far off, this function may not return a correct calibration. A white image has to be available for calibration estimation.
Precondition
There are currently two different calibration modes that can be selected via the parameter RxApiLF::EPar::MlaImg_CalibType . The available calibration modes are RxApiLF::ECalibGridMode::Full (including distortion models), RxApiLF::ECalibGridMode::Reduced (omitting distortions) and RxApiLF::ECalibGridMode::Plain (without homography).

This function reports on its progress using the set progress interface.

Parameters
eResult[out] The result.
bIgnoreImageQuality(Optional) True to ignore image quality.
RXLF_API void Rx::ApiLF::RxMlaCalibGetGridData ( Rx::CRxArrayDouble aLensCenter,
float &  fLensRadius,
int  iLensType 
)

Get the lens center positions of given type in pixel coordinates. The corresponding lensRadius is returned.

Parameters
[out]aLensCenterThe result list, containing the lens centers in pixel coordinates.
[out]fLensRadiusThe lens radius for the given Lens Type.
iLensTypeThe lens type number to retrieve.
RXLF_API bool Rx::ApiLF::RxMlaCalibParallelLightExecute ( )

Calibrate the MLA properties using a parallel light image. Calibration has to be augmented by a white-image calibration to be valid.

Tries to estimate the properties of the MLA, i.e., lens pitch, MLA rotation etc..

Precondition
The parallel light image has to be available in the bound raw image.
Attention
Writes the estimation result to the active camera format. Set's ParallelCalib-valid flag to true. To be used for master- calibration only!
Returns
True if it succeeds, false, if the estimation algorithm detected an invalid estimation.
RXLF_API void Rx::ApiLF::RxMlaCalibRegisterCallbackFunction ( bool  bActivate)

Enables/Disables progress callback of Rx::ApiLF::RxMlaCalibExecute / Rx::ApiLF::RxMlaCalibParallelLightExecute.

Standard interface is used.

  • ACG_Stage : reports active stage of algorithm (0 init, 1-3 respective stage, -1 finish)
  • ACG_Iteration : reports number of estimation steps performed in active stage.
Parameters
bActivateSet to 'true' to activate callback interface for progress information.