You are here: Start » AVL.NET » AVL.CalibrateCamera_Telecentric

AVL.CalibrateCamera_Telecentric

Finds the telecentric camera intrinsic parameters from the input arrays of image and real-world coordinates.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void CalibrateCamera_Telecentric
(
	IList<IList<AvlNet.Point2D>> inImagePoints,
	IList<IList<AvlNet.Point2D>> inWorldPlanePoints,
	int inImageWidth,
	int inImageHeight,
	AvlNet.LensDistortionModelType inDistortionType,
	float inImagePointsStandardDeviation,
	out AvlNet.TelecentricCameraModel outCameraModel,
	out AvlNet.TelecentricCameraModel outCameraModelStdDev,
	out float outRmsError,
	IList<float> outMaxReprojectionErrors,
	IList<List<AvlNet.Segment2D>> outReprojectionErrorSegments
)

Parameters

Name Type Range Default Description
inImagePointsSystem.Collections.Generic.IList<System.Collections.Generic.IList<AvlNet.Point2D>>Array, for each view: array of 2D points of the calibration pattern, in the picture.
inWorldPlanePointsSystem.Collections.Generic.IList<System.Collections.Generic.IList<AvlNet.Point2D>>Array, for each view: array of 2D points of the calibration pattern, in a world coordinate plane.
inImageWidthint<1, INF>Image width, used for initial estimation of principal point.
inImageHeightint<1, INF>Image height, used for initial estimation of principal point.
inDistortionTypeAvlNet.LensDistortionModelTypePolynomialWithThinPrismLens distortion model. Default value: PolynomialWithThinPrism.
inImagePointsStandardDeviationfloat<0.0f, INF>0.1fAssumed uncertainty of inImagePoints. Used for robust optimization and outCameraModelStdDev estimation. Default value: 0.1f.
outCameraModelAvlNet.TelecentricCameraModel
outCameraModelStdDevAvlNet.TelecentricCameraModelStandard deviations of all model parameters, assuming that inImagePoints positions are disturbed with gaussian noise with standard deviation equal to inImagePointsStandardDeviation.
outRmsErrorfloatFinal reprojection RMS error, in pixels.
outMaxReprojectionErrorsSystem.Collections.Generic.IList<float>For each view, the maximum reprojection error among all points.
outReprojectionErrorSegmentsSystem.Collections.Generic.IList<System.Collections.Generic.List<AvlNet.Segment2D>>For each view, array of segments connecting input image points to reprojected world points.

Description

The filter estimates intrinsic camera parameters - magnification, principal point location and distortion coefficients from a set of planar calibration grids by means of robust minimization of RMS reprojection error - the square root of averaged squared distances between observed (inImagePoints) and projected (inWorldPlanePoints projected onto image plane using estimated parameters) point locations

A few distortion model types are supported. The divisional model supports most use cases, even when subpixel accuracy is expected. Higher order models can be more accurate, however they need a much larger dataset of high quality calibration points, and are only needed for achieving high levels of positional accuracy across the whole image - order of magnitude below 0.1 pix. Of course this is only a rule of thumb, as each lens is different and there are exceptions.

Distortion model types are compatible with OpenCV, and are expressed with equations using normalized image coordinates:

Divisional distortion model

Polynomial distortion model

PolynomialWithThinPrism distortion model

where , x' and y' are undistorted, x'' and y'' are distorted normalized image coordinates.

The filter provides a few methods for judging the feasibility of calculated solution.

  • The outRmsError is the final RMS reprojection error. The main contributor to that value is the random noise in inImagePoints positions. Model mismatch will also result in increased outRmsError.
  • The outMaxReprojectionErrors is an array of maximum reprojection errors, per view. It can be used to find suspicious calibration grids.
  • The outCameraModelStdDev contains standard deviations of all parameters of estimated model, assuming that inImagePoints positions have a standard deviation equal to inImagePointsStandardDeviation. It can be used to verify the stability of estimated parameters. High values may be a result of data deficiency in a sensitive region (e.g. lack of calibration points at the edges of image when high-order distortion model is used).
  • The outReprojectionErrorSegments consists of segments connecting input image points to reprojected world points, and thus it can be readily used for visualization of gross errors. The XY scatter plot of residual vectors (obtained by using SegmentVector on the outReprojectionErrorSegments) is a good insight into the residuals distribution, which in ideal case should follow a 2D gaussian distribution centered around point (0,0).

Examples

Usage of outReprojectionErrorSegments for identification of bad association of inImagePoints and inWorldPlanePoints - two points in either array are swapped.

Errors

List of possible exceptions:

Error type Description
DomainError Empty input array
DomainError Input array sizes differ

See also