java.lang.Object
imagingbook.calibration.zhang.Calibrator
This is an implementation of the camera calibration method
described in
Z. Zhang, "A flexible new technique for camera calibration",
IEEE Transactions on Pattern Analysis and Machine Intelligence,
22(11), pp. 1330-1334, 2000.
See also
http://research.microsoft.com/en-us/um/people/zhang/Calib/
and
http://research.microsoft.com/en-us/um/people/zhang/Papers/TR98-71.pdf
- Version:
- 2018/12/29
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Inner class representing a set of parameters for instantiating new objects of type ofCalibrator
. -
Constructor Summary
ConstructorsConstructorDescriptionCalibrator
(Calibrator.Parameters params, Pnt2d[] model) The only constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new observation (a sequence of 2D image points) of the planar calibration pattern.Performs the actual camera calibration based on the provided sequence of views.Returns the final camera model (including lens distortion).Returns the sequence of final camera views (extrinsics, including lens distortion).Returns the initial camera model (no lens distortion).Returns the sequence of initial camera views (extrinsics, no lens distortion).double
getProjectionError
(Camera cam, ViewTransform[] views, Pnt2d[][] observed) Calculates the squared projection error for a sequence of views, associated with a sequence of observed image point sets.double
getProjectionError
(Camera cam, ViewTransform view, Pnt2d[] observed) Calculates the squared projection error for a single view, associated with a set of observed image points.
-
Constructor Details
-
Calibrator
The only constructor.- Parameters:
params
- a parameter object (default parameters are used ifnull
is passed)model
- a sequence of 2D points specifying the x/y coordinates of the planar calibration pattern (assuming zero z-coordinates)
-
-
Method Details
-
addView
Adds a new observation (a sequence of 2D image points) of the planar calibration pattern.- Parameters:
pts
- a sequence of 2D image points
-
calibrate
Performs the actual camera calibration based on the provided sequence of views.- Returns:
- the estimated camera intrinsics as a
Camera
object
-
getProjectionError
Calculates the squared projection error for a single view, associated with a set of observed image points.- Parameters:
cam
- a camera model (camera intrinsics)view
- a view transformation (camera extrinsics)observed
- a set of observed image points- Returns:
- the squared projection error (measured in pixel units)
-
getProjectionError
Calculates the squared projection error for a sequence of views, associated with a sequence of observed image point sets.- Parameters:
cam
- a camera model (camera intrinsics)views
- a sequence of view transformations (camera extrinsics)observed
- a sequence of sets of observed image points- Returns:
- the squared projection error (measured in pixel units)
-
getInitialCamera
Returns the initial camera model (no lens distortion).- Returns:
- the initial camera model
-
getFinalCamera
Returns the final camera model (including lens distortion).- Returns:
- the final camera model
-
getInitialViews
Returns the sequence of initial camera views (extrinsics, no lens distortion).- Returns:
- the sequence of initial camera views
-
getFinalViews
Returns the sequence of final camera views (extrinsics, including lens distortion).- Returns:
- the sequence of final camera views
-