Topic · Geometry

Camera calibration

Everything on this site about camera calibration, in the order to read it: a page is listed after the pages it builds on. The figures below are the ones those pages use to explain it; each is live: move a slider and it recomputes.

In reading order

The figures these pages use

Pulled from the pages above. Move a slider and the figure recomputes, exactly as on its page.

From Finding the Camera From Known Points — P by Least Squares › 1. Two Equations per Point

0.5690
Camera: focal length and principal point
500320240
Camera 2: move it and turn it
1.00.00.0100.0
Finding camera 2 from known corners. The rust camera photographs an L-shaped target whose 32 corners we know to the millimetre. From the corners and their noisy pixels alone, the straight-line estimate gives back a whole camera, drawn grey: the one marked “found”. Go from 6 to 32 corners: the residual grows from 0.348 to 0.749 px, while the camera lands 0.051 m from the truth instead of 0.442 m. Fold the floor flat and no single camera fits any more. Drag one corner in camera 2's picture, camera 2 itself, or the background to turn the scene. Open the camera panels to move the cameras, or change the focal length and the principal point.

From Finding the Camera From Known Points — P by Least Squares › 4. The Residual Trap

0.5
A small residual is not a small error. The rust camera found again from 6 to 32 corners. The residual is measured against the noisy pixels the estimate was fitted to; the error is measured against the true pixels. The measured residual follows the book's expected curve. Drag σ: every curve scales, but at six points the residual always sits far below the true error.

From Finding the Camera From Known Points — P by Least Squares › 5. Taking P Apart

1 / 5 · M = K R
Camera: focal length and principal point
500320240
Camera 2: move it and turn it
1.00.00.0100.0
Three turns take M = K R apart. The left block of camera 2's matrix, M = K R, multiplied by one turn at a time. Each turn zeroes one number below the diagonal (rust); the right grid is the rotation collected so far. Step through: three turns zero three numbers; the last step only flips two signs. Open the camera panels to move the cameras, or change the focal length and the principal point.

From Lens Distortion — Bending Straight Lines Back › 1. Where the Lens Bends

-0.200
Camera: focal length and principal point
500320240
What the lens does to a straight grid. The grey grid is what a pinhole would see; the blue grid is what the lens delivers. Each point slides along its own radius by a factor that depends only on how far out it is, so the middle barely moves and the corners move most. Drag the ring to pick a pixel; switch to "after undistortion" to see where the picture's own border ends up. Open the camera panel to change the focal length and the principal point.

From Lens Distortion — Bending Straight Lines Back › 4. Undoing It Takes a Few Guesses

-0.22
Camera: focal length and principal point
500320240
Undoing the lens, one guess at a time. Zoomed in on the top-left corner of the picture. The lens moved the corner pixel to the rust dot; each blue guess divides by the bend at the previous guess, and the guesses close in on the true corner. The small plot tracks the distance left after each guess. Open the camera panel to change the focal length and the principal point.

From Lens Distortion — Bending Straight Lines Back › 5. Undistorting a Whole Picture

0
Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.00.0
Straight lines tell you the lens. Camera 1 looks at a doorframe and a long board, all straight edges. Through the lens they bow; the rust curves are the same edges corrected with the guessed k₁. Play the guess and watch the bow flip from one side to the other: the edges come out straight at one value only. Drag the background to turn the scene. Open the camera panels to move the camera, or change the focal length and the principal point.

From What calibrateCamera Actually Does › 1. One Photo of a Board Is One Homography

00
Camera: focal length and principal point
500320240
Camera 2: move it and turn it
1.00.00.0100.0
One photo of a board is one homography. Camera 2 (rust) photographs the board on the wall. Because the board is flat, the whole photo is one 3×3 matrix H, and its first two columns are where the board's two axes vanish in the picture. Grab the board's top edge to tilt it back, or its right edge to turn it, and watch h₂ swing in from infinity. Drag the background to turn the scene. Open the camera panels to move the cameras, or change the focal length and the principal point.

From What calibrateCamera Actually Does › 3. How Many Photos, and Why Tilted

Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.00.0
Camera 2: move it and turn it
1.00.00.0100.0
Three photos at different angles pin K down. Three photos of the same board: camera 1 face-on (blue), camera 2 (rust) and camera 2 tilted down 20°. Each photo adds two equations on ω's five unknowns. Switch a photo off and a second near-zero value appears: K is no longer pinned down. Add 0.5 px of corner noise and see how far one try can drift. Drag the background to turn the scene. Open the camera panels to move the cameras, or change the focal length and the principal point.

From What calibrateCamera Actually Does › 5. The Same Idea With One Photo

Camera: focal length and principal point
500320240
Camera 2: move it and turn it
1.00.00.01020
Focal length from one photo of a box. Camera 2 (rust), pitched down 20°, photographs a box. Its three edge directions vanish at v_x, v_y and v_z, far outside the frame. Because the edges are at right angles, any two of those points give f, and the triangle's three altitudes meet at the principal point. Level the camera: v_y runs off to infinity, f still comes out with the centre assumed, but the centre itself is only known to lie on one row. Open the camera panels to move the cameras, or change the focal length and the principal point.

Tags that go with it

Camera models 2Projective geometry 1