Back to FabImage Library website
You are here: Start » Function Reference » Computer Vision » Camera Calibration » CalibrateCamera_Deprecated

CalibrateCamera_Deprecated
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | Calibration |
Finds the camera intrinsic and extrinsic parameters from the input arrays of image and real-world coordinates. Uses pinhole camera model (perspective camera).
Applications: Recognition of lens distortion. Usually followed by CreateUndistortionMap_Deprecated.
Syntax
void fil::CalibrateCamera_Deprecated ( const ftl::Array<ftl::Array<fil::Point3D> >& inObjectPoints, const ftl::Array<ftl::Array<fil::Point2D> >& inImagePoints, int inImageWidth, int inImageHeight, bool inFixPrincipalPoint, bool inFixAspectRatio, bool inZeroTangentDist, ftl::Optional<const fil::Matrix&> inInitialCameraMatrix, bool inUseRationalModel, bool inUseThinPrismModel, fil::Matrix& outCameraMatrix, fil::LensDistortion& outDistortion, ftl::Array<float>& outUnitScales, ftl::Optional<ftl::Array<fil::Position3D>&> outCameraPositions = ftl::NIL, ftl::Optional<float&> outError = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inObjectPoints | const Array<Array<Point3D> >& | Array, for each view: array of 3D points of the calibration pattern. | ||
![]() |
inImagePoints | const Array<Array<Point2D> >& | Array, for each view: array of corresponding 2D points in the picture. | ||
![]() |
inImageWidth | int | 1 - ![]() |
640 | Image width, only used to initialize camera matrix, not used when inInitialCameraMatrix present. |
![]() |
inImageHeight | int | 1 - ![]() |
480 | Image height, only used to initialize camera matrix, not used when inInitialCameraMatrix present. |
![]() |
inFixPrincipalPoint | bool | The principal point is not changed during the global optimization. It stays in the center of the image, or as in the initial camera matrix. | ||
![]() |
inFixAspectRatio | bool | The functions considers only fy as a free parameter. The ratio fx/fy stays 1, or as in the initial camera matrix. | ||
![]() |
inZeroTangentDist | bool | Tangential distortion coefficients (p_1, p_2) are assumed zero. | ||
![]() |
inInitialCameraMatrix | Optional<const Matrix&> | NIL | Optional initial camera matrix, required for inFixPrincipalPoint and inFixAspectRatio. | |
![]() |
inUseRationalModel | bool | |||
![]() |
inUseThinPrismModel | bool | |||
![]() |
outCameraMatrix | Matrix& | |||
![]() |
outDistortion | LensDistortion& | |||
![]() |
outUnitScales | Array<float>& | Image scale: px / mm | ||
![]() |
outCameraPositions | Optional<Array<Position3D>&> | NIL | Positions of cameras in world coordinate system for the views | |
![]() |
outError | Optional<float&> | NIL | Final re-projection error value |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outCameraPositions, outError.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Error in CalibrateCamera: Error message |
DomainError | Fixing aspect ratio requested, but no initial camera matrix passed in CalibrateCamera. |
DomainError | Fixing principal point requested, but no initial camera matrix passed in CalibrateCamera. |
DomainError | Inconsistent sizes of inImagePoints and inObjectPoints in CalibrateCamera. |
DomainError | Missing inImagePoints or inObjectPoints in CalibrateCamera. |