Topic · Geometry

Camera models

Everything on this site about camera models, 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

  1. Read
  2. Read
  3. Read
  4. Read
  5. Read

The figures these pages use

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

From The Pinhole Camera — A Pixel Is a Ray › 1. A Dark Room With a Hole

(0.3, -0.2)4.0
Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.00.0
A world point becomes a pixel. Camera 1 sits at C₁ and looks down its principal axis; its image plane is drawn one unit in front, with the sensor's true 4:3 shape. The two grey triangles share the centre: the big one is X's sideways offset and its depth, the small one is the pixel's offset and f. Drag X and watch its pixel move in the camera's own picture; play Z and the pixel creeps toward the principal point. 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 The Pinhole Camera — A Pixel Is a Ray › 4. What Each Number in K Does

0
Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.00.0
What each number in K does. Two cubes, one near and one far, and the point X. Change f and the picture grows about the principal point; drag the principal point (the cross in the camera's picture) and the picture slides; add skew and it shears. The image plane in the scene follows K, with the default plane as a grey outline. Whatever you do, the far cube's corners that hide inside the near cube's outline stay the same ones. 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 The Pinhole Camera — A Pixel Is a Ray › 5. A Pixel Is a Ray

4.0
Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.00.0
A pixel is a ray. Run the camera backwards. The pixel x₁ does not give back a point: it gives the whole ray from C₁ through it, and every point on that ray lands on the same pixel. Play λ and X runs along the ray while its pixel never moves; the hollow points are three more places X could have been. Drag x₁ in the camera's picture to pick another pixel, and 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 The Pinhole Camera — A Pixel Is a Ray › 6. Focal Length Is Not Distance

4.0
Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.0
Walk back and zoom in. Press play. The camera walks back from the post while its focal length grows in step, so the post stays 125 px tall in the camera's picture; the two posts 8 m behind it swell. The picture's size is set by f; how things stack up in it is set only by where the camera stands. Hold the zoom to see the difference, and 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 Where Is the Camera? — R, C and t › 1. Where It Stands and Where It Looks

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
Where camera 2 stands and where it looks. Camera 1 (blue) sits at the world's origin; camera 2 (rust) stands at C₂ and is turned toward it. The rows of R are camera 2's own axes x₂, y₂, z₂, written in world coordinates, and the dashed arrow is t: the world origin as camera 2 sees it. Drag a camera's centre to move it along the floor, and drag the background to look around. Try this: turn camera 2 without moving it; C̃ stays (1, 0, 0), but t swings round. Open the camera panels to move the cameras, or change the focal length and the principal point.

From Where Is the Camera? — R, C and t › 3. One Matrix From World to Pixel

1 / 4 · the world point(0.3, -0.2)
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
From a world point to a pixel, one step at a time. Camera 2 (rust) stands at (1, 0, 0), turned 10° toward camera 1. Step through: the point X in world metres, the same point measured along camera 2's own axes, slid down its ray onto the plane one metre in front (that is the division by depth), and finally K turning it into a pixel. Drag X to move it on the wall z = 4 m, drag a camera's centre to move it along the floor, and drag the background to look around. Try this: press Next three times; only the third step divides. Open the camera panels to move the cameras, or change the focal length and the principal point.

From Points at Infinity — Horizons, Vanishing Points and the Floor › 1. Lines Are Three Numbers Too

Two lines meet at a cross product. Each line is drawn through two points you can drag, and written as three numbers (a, b, c). The meet of the two lines is the cross product of those two triples. Try this: drag D until the two lines are parallel; the meet runs off and its last number falls to 0.

From Points at Infinity — Horizons, Vanishing Points and the Floor › 3. Vanishing Points Are the Columns of P

7
Camera: focal length and principal point
500320240
Camera 2: move it and turn it
1.00.00.0100.0
Where parallel lines meet. Camera 2 (rust) stands 1 m to the right of camera 1, turned 10° toward it. The rails and the floor lines run in the world's z and x directions; in camera 2's zoomed-out picture each family meets at one point, and those points are the first columns of P₂; the two upright posts point along y. Try this: pitch camera 2 down, and v_y, the third vanishing point, comes in from infinity below the picture while the horizon rises to row 58. 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 Points at Infinity — Horizons, Vanishing Points and the Floor › 4. The Floor in One Matrix

Camera: focal length and principal point
500320240
Camera 1: move it and turn it
0.00.00.00.00.0
From a pixel back to the floor. Camera 1 (blue) stands h metres above the floor. Every floor point has only two numbers, x and z, so the camera's map from the floor to its picture is one 3×3 matrix H, and H⁻¹ takes a pixel back to the floor. Try this: drag the pixel up toward the horizon; the floor point runs away, and past the horizon the ray never lands. 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 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.

Tags that go with it

Projective geometry 3Camera calibration 2