|< << >> >|

Camera Calibration (2011/05/23)

I am currently working on camera calibration. Many implementations require the user to manuallly point out corners. Here is an idea on how to detect and label corners automatically.

  1. Apply Otsu Thresholding to input image.
  2. Take difference of dilated and eroded image to get edge regions.
  3. Label connected components.
  4. Compute corners of input image (and use non-maxima suppression).
  5. Count corners in each component.
  6. Look for a component which contains exactly 40 corners.
  7. Get largest component of inverse of grid (i.e. the surroundings).
  8. Grow that component and find all corners on it (i.e. corners on the boundary of the grid).
  9. Find centre of gravity of all corners and compute vectors from centre to each boundary corner.
  10. Sort boundary corners by angle of those vectors.
  11. Use non-maxima suppression on list of length of vectors to get the 4 “corner corners” (convexity).
  12. Use the locations of the 4 “corner corners” to compute a planar homography mapping the image coordinates of the 8 times 5 grid to the ranges 0..7 and 0..4 respectively.
  13. Use the homography to transform the 40 corners and round the coordinates.
  14. Order the points using the rounded coordinates.

Further work is about taking several images to perform the actual camera calibration.

Thanks to Manuel Boissenin for suggesting convexity for finding the “corner corners”.


After calibrating the camera the ratio of focal length to pixel size is known (also see Zhengyou Zhang’s camera calibration). Once the camera is calibrated, it is possible to estimate the 3D pose of the calibration grid in every frame.

I have created a screencast on how to locate the chequerboard calibration pattern.

See also:

blog comments powered by Disqus