Camera Calibration23 May 2011
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.
- Apply Otsu Thresholding to input image.
- Take difference of dilated and eroded image to get edge regions.
- Label connected components.
- Compute corners of input image (and use non-maxima suppression).
- Count corners in each component.
- Look for a component which contains exactly 40 corners.
- Get largest component of inverse of grid (i.e. the surroundings).
- Grow that component and find all corners on it (i.e. corners on the boundary of the grid).
- Find centre of gravity of all corners and compute vectors from centre to each boundary corner.
- Sort boundary corners by angle of those vectors.
- Use non-maxima suppression on list of length of vectors to get the 4 “corner corners” (convexity).
- 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.
- Use the homography to transform the 40 corners and round the coordinates.
- 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.