Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to verify that the camera calibration is correct? (or how to estimate the error of reprojection)

The quality of calibration is measured by the reprojection error (is there an alternative?), which requires a knowledge world coordinates of some 3d point(s).

Is there a simple way to produce such known points? Is there a way to verify the calibration in some other way (for example, Zhang's calibration method only requires that the calibration object be planar and the geometry of the system need not to be known)

like image 835
Alex Kreimer Avatar asked Aug 05 '13 07:08

Alex Kreimer


3 Answers

You can verify the accuracy of the estimated nonlinear lens distortion parameters independently of pose. Capture images of straight edges (e.g. a plumb line, or a laser stripe on a flat surface) spanning the field of view (an easy way to span the FOV is to rotate the camera keeping the plumb line fixed, then add all the images). Pick points on said line images, undistort their coordinates, fit mathematical lines, compute error.

For the linear part, you can also capture images of multiple planar rigs at a known relative pose, either moving one planar target with a repeatable/accurate rig (e.g. a turntable), or mounting multiple planar targets at known angles from each other (e.g. three planes at 90 deg from each other).

As always, a compromise is in order between accuracy requirements and budget. With enough money and a friendly machine shop nearby you can let your fantasy run wild with rig geometry. I had once a dodecahedron about the size of a grapefruit, machined out of white plastic to 1/20 mm spec. Used it to calibrate the pose of a camera on the end effector of a robotic arm, moving it on a sphere around a fixed point. The dodecahedron has really nice properties in regard to occlusion angles. Needless to say, it's all patented.

like image 88
Francesco Callari Avatar answered Oct 13 '22 16:10

Francesco Callari


The images used in generating the intrinsic calibration can also be used to verify it. A good example of this is the camera-calib tool from the Mobile Robot Programming Toolkit (MRPT).

Per Zhang's method, the MRPT calibration proceeds as follows:

  1. Process the input images:

    • 1a. Locate the calibration target (extract the chessboard corners)
    • 1b. Estimate the camera's pose relative to the target, assuming that the target is a planar chessboard with a known number of intersections.
    • 1c. Assign points on the image to a model of the calibration target in relative 3D coordinates.
  2. Find an intrinsic calibration that best explains all of the models generated in 1b/c.

Once the intrinsic calibration is generated, we can go back to the source images.

For each image, multiply the estimated camera pose with the intrinsic calibration, then apply that to each of the points derived in 1c.

This will map the relative 3D points from the target model back to the 2D calibration source image. The difference between the original image feature (chessboard corner) and the reprojected point is the calibration error.

MRPT performs this test on all input images and will give you an aggregate reprojection error.

If you want to verify a full system, including both the camera intrinsics and the camera-to-world transform, you will probably need to build a jig that places the camera and target in a known configuration, then test calculated 3D points against real-world measurements.

like image 39
lnmx Avatar answered Oct 13 '22 16:10

lnmx


On Engine's question: the pose matrix is a [R|t] matrix where R is a pure 3D rotation and t a translation vector. If you have computed a homography from the image, section 3.1 of Zhang's Microsoft Technical Report (http://research.microsoft.com/en-us/um/people/zhang/Papers/TR98-71.pdf) gives a closed form method to obtain both R and t using the known homography and the intrinsic camera matrix K. ( I can't comment, so I added as a new answer)

like image 2
Rodrigo Cavalcanti Avatar answered Oct 13 '22 14:10

Rodrigo Cavalcanti