What calibrateCamera Actually Does

  1. 1The Pinhole Camera — A Pixel Is a Ray
  2. 2Where Is the Camera? — R, C and t
  3. 3Points at Infinity — Horizons, Vanishing Points and the Floor
  4. 4Finding the Camera From Known Points — P by Least Squares
  5. 5Lens Distortion — Bending Straight Lines Back
  6. 6What calibrateCamera Actually Does
  7. 7Epipolar Geometry — A Point Becomes a Line
  8. 8Triangulation — Two Rays That Almost Meet
  9. 9From Matches to Motion — Four Cameras, One Right Answer
  10. 10Stereo Depth — Rectification and Z = fB/d
  11. 11From Two Photos to a Point Cloud

Summary

Wave a printed checkerboard at a camera, call calibrateCamera, and get back K, the lens and an RMS. This read opens the box: every photo of the board is one homography, every homography gives two equations on one small matrix, three photos at different angles pin K down, and a final polish fits everything together. After it you know why calibration wants tilted boards, what its RMS means, and how to get f from a single photo of a box.

Table of Contents

  1. 1. One Photo of a Board Is One Homography2
  2. 2. Two Equations per Photo2
  3. 3. How Many Photos, and Why Tilted3
  4. 4. The Final Polish, and What Comes Back3
  5. 5. The Same Idea With One Photo4
  6. 6. In OpenCV4
  7. 7. What Came Next4
  8. 8. References4
  9. 9. Connections4
TrivediInformational[Page 1]
S. TrivediOct 2026

You print a checkerboard, wave it at the camera twenty times, call calibrateCamera, and get back an RMS and a matrix. What did it actually do with those twenty photos?

The whole read hangs on one chain of four steps:

  • one photo of a flat board is one homography H;
  • one homography gives two equations on a small 3×3 matrix ω;
  • three photos at different angles give enough equations to solve for ω, and K comes out of ω;
  • a final polish refines K, the lens and every photo's pose together.
one camera: a world point becomes a pixelworld pointX (metres)camera frameR X + tdivide by depth(x/z, y/z)lens bends itk₁ k₂ p₁ p₂into pixelsKpixel(u, v)this read: from pixels backtwo cameras: two pixels become a point againtwo pixelsx₁ ↔ x₂on one linel′ = F x₁camera 2R, t from Ecross raysX from x₁ x₂turn to rowsv₁ = v₂depthZ = fB/dpoint cloudevery pixelthis read: K, the lens and one pose per board photo, all from pixels
Fig. 1 What a checkerboard calibration estimates: K, the lens and one pose per board photo, all from pixels. The chain runs backwards from the pixels this time.

Brush up ;)

1. One Photo of a Board Is One Homography

Think of the board as a sheet of graph paper. However you hold it, the camera can only stretch, slant and squeeze that sheet in the picture; it can never fold it. A map of a flat sheet onto another flat sheet that keeps straight lines straight is a homography: one 3×3 matrix, nothing more.

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.

What the figure shows at its default (the board flat on the wall z = 4, camera 2 yawed 10°):

  • the 16 corners land in camera 2's picture as a slightly slanted grid;
  • the board's vertical edges stay parallel in the picture: their vanishing point h₂ is at infinity;
  • its horizontal edges meet far to the left, at h₁ = (−2515.64, 240) px, the same point read 3 found as the vanishing point of the world x axis.

Let's devise the equation. For each photo, put the world frame on the board: the board's corners are (a, b, 0), with a and b in metres along its two axes. Every board point has a zero third coordinate, so the third column of R never gets used:

𝐱=K[𝐫1𝐫2𝐫3𝐭](a,b,0,1)⊤=K[𝐫1𝐫2𝐭](a,b,1)⊤H=K[𝐫1𝐫2𝐭](1)
  • x is the pixel (with a 1 added), K the intrinsics, 𝐫1,𝐫2 the board's x and y axes written in the camera's frame, and t the board's origin in the camera's frame (metres).
  • H has 9 entries, 8 once its free scale is removed. It is book ex. 8.1, eq. 8.1 (Hartley & Zisserman, Ch. 8 More Single View Geometry, p. 196), and eq. 2 of Zhang's paper [ZHAN00].
  • The columns tell a story. Column 1 is K𝐫1, where the board's x axis vanishes (h₁). Column 2 is K𝐫2, where its y axis vanishes (h₂). Column 3 is where the board's origin lands.

The numbers, for the wall board in camera 2, with K = [[500, 0, 320], [0, 500, 240], [0, 0, 1]]:

Hwall,2=(436.83601171.014−41.676500987.091−0.17404.113)(2)
  • The second column is (0, 500, 0): its last entry is 0, so h₂ is a point at infinity. The board's vertical edges never meet in the picture.
  • The first column divides to (−2515.64, 240) px: h₁, far off the left of the 640-px frame.
  • The camera does not need to know any of this up front. From the 16 corner pixels alone, the DLT of Finding the Camera From Known Points — P by Least Squares finds H; this read asks what H tells us about K.

Why it exists. It turns a photo of a flat board into one 3×3 matrix that the corners alone can find, with K inside it. Everything after this section reads K out of H.

What it assumes. - The board is flat: every corner really has z = 0 (H&Z Ch. 8 More Single View Geometry, ex. 8.1, p. 196). - The camera is a pinhole: the corners land where straight lines put them. - a and b are the real printed positions, in metres.

Where it breaks. - A board that bows is not one plane, so no single H fits all its corners, and the leftover goes into the reprojection error. Print it on something rigid. - The lens hides inside H. With the series lens (k1=−0.2) the corners of the three photos of Section 3 move by up to 6.442 px, yet one homography per photo still fits them to within 0.260 px. Nothing looks wrong here; the damage shows in K (Section 3). - A wrong square size leaves K alone, since 𝐡1 and 𝐡2 scale together, but every t comes back scaled by the same wrong factor.

Try this: grab the board's top edge and tilt it back. The last entry of column 2 is no longer zero, and h₂ swings in from infinity, from above the picture.

2. Two Equations per Photo

030
Camera: focal length and principal point
500320240
Camera 2: move it and turn it
100100
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.

Here the board is tilted back 30°, and h₂ has come in from infinity to a point above the picture. Grab its top edge and keep tilting, and watch the two rows under the matrix change. The board itself knows two facts about its axes, whatever the photo:

The board's axesWhat it meansIn the picture
r₁ ⟂ r₂the grid is square, its axes at 90°h₁ᵀ ω h₂ = 0
|r₁| = |r₂|both are unit vectorsh₁ᵀ ω h₁ = h₂ᵀ ω h₂

Table. 1 Two facts about any square grid, and the two equations they give per photo (H&Z Ch. 8 *More Single View Geometry*, book eq. 8.12, p. 211; Zhang eqs. 3–4 [ZHAN00]).

What is ω? Think of it as a protractor for pixels (H&Z Ch. 8 More Single View Geometry, the book's own word for a calibrated camera, p. 209). Hand it two pixels and it tells you the angle between the two rays through them. K⁻¹ turns a pixel into its ray direction, 𝐱^=K−1𝐱 (The Pinhole Camera — A Pixel Is a Ray), and the angle between two rays comes from a dot product of those directions (divided by their lengths), so the protractor is K⁻¹ applied twice:

ω=K−⊤K−1=(KK⊤)−1𝐱^a⊤𝐱^b=𝐱a⊤ω𝐱b(3)
  • 𝐱a,𝐱b are two pixels of the same picture, each with a 1 added.
  • ω is a symmetric 3×3 matrix. It depends on K only: the camera's pose cancels out (H&Z Ch. 8 More Single View Geometry, §8.5.1, result 8.17, p. 210). The book calls it the image of the absolute conic; the protractor is all we need from it here.
  • It has 6 entries and a free scale, so 5 unknowns, the same 5 as K (α_x, α_y, s, c_x, c_y).
  • For our K, scaled so ω₁₁ = 1: ω = [[1, 0, −320], [0, 1, −240], [−320, −240, 410000]]. The 410000 is 320² + 240² + 500².

Why it exists. The board's two facts are about angles and lengths in the world, and ω is how a picture measures an angle. It carries exactly K's five unknowns and none of the pose, so solving for ω is solving for K.

What it assumes. - A pixel's ray is K−1𝐱: a pinhole, with the lens already taken out. - One K for every photo: ω belongs to K alone (H&Z Ch. 8 More Single View Geometry, result 8.17, p. 210), so focus and zoom must not change between photos.

Where it breaks. - Through our lens the corner pixel is seen at (40.96, 30.72), and ω reads its ray as 34.90° off the axis. The true ray is 38.66° off: 3.76° of error from the lens alone. Undistort the pixels first (Lens Distortion — Bending Straight Lines Back). - Autofocus between photos gives each photo its own ω, and the stacked equations of Section 3 then describe no single camera. Fix the focus while calibrating.

Now push the board's two facts through K. Since H = K[r₁ r₂ t] up to a scale λ, the board's axes are 𝐫1=λK−1𝐡1 and 𝐫2=λK−1𝐡2. A dot product of those is exactly the protractor:

𝐫1⊤𝐫2=0⇒𝐡1⊤ω𝐡2=0‖𝐫1‖=‖𝐫2‖⇒𝐡1⊤ω𝐡1=𝐡2⊤ω𝐡2(4)
  • 𝐡1,𝐡2 are the first two columns of H (known from the corners); ω is the unknown.
  • Both equations are linear in ω's six entries. That is the whole trick: every photo's two rows can be stacked into one system and solved like any DLT. Zhang calls the two rows v₁₂ and v₁₁ − v₂₂; the figure prints them under the matrix.
  • The numbers: for H_wall,2 and the true ω, the first equation comes out 0 and the second −1.1e−16, zero to rounding. Both hold, as they must.

Why it exists. The board knows two things about its axes, and these turn them into equations on ω that are linear, so photos can simply be stacked.

What it assumes. - The grid is square in the world: axes at 90°, and one square the same length in both directions (Table. 1).

Where it breaks. - A printer that stretches the board's x direction by a factor s breaks ‖𝐫1‖=‖𝐫2‖, and K comes out wrong. For a face-on photo the whole error lands in the pixel shape: the second row then says αx=sαy. Measure the printed squares both ways and enter what you measured. - How much the two equations say depends on the angle of the board: face-on, they only see skew and pixel shape (Section 3).

Try this: in the figure, watch the "equations from this photo" tile. It always says 2 of the 5 needed, however you hold the board. How useful those 2 are is the next question.

TrivediInformational[Page 1]
S. TrivediOct 2026

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.

What the figure shows at its default (three photos, exact corners):

  • photo 1 is camera 1, face-on to the board; photo 2 is camera 2; photo 3 is camera 2 tilted down 20°;
  • six equations for five unknowns, and K comes back as (α_x, α_y, s, c_x, c_y) = (500, 500, 0, 320, 240), exactly;
  • the board is small in every photo: about 94 px wide in photo 1 (u from 273.1 to 366.9 px).

Each photo's two rows go into one tall matrix V, and ω is the vector it sends to zero (H&Z Ch. 8 More Single View Geometry, book alg. 8.2, p. 225; Zhang §3.1 [ZHAN00]):

𝐛=(ω11,ω12,ω22,ω13,ω23,ω33)⊤V𝐛=0,2 rows of V per photo(5)
  • b is ω written as six numbers (Zhang calls them B₁₁ … B₃₃). V has 2n rows for n photos and 6 columns.
  • 5 unknowns at 2 equations a photo means three photos (two if you assume zero skew).
  • b is the right singular vector of V with the smallest singular value (the direction V squashes the most), the same step as in Finding the Camera From Known Points — P by Least Squares.

The numbers are in the singular values. With all three photos the two smallest are 23 and 7.92e−9: one is clearly zero, so there is one answer. Drop the tilted photo and the two smallest become 2.7e−6 and 1.1e−10: two near-zero values, so a whole family of ω fits the four equations, and K is not pinned down.

Why it exists. One photo gives 2 of the 5 equations. This is where the photos are pooled and ω is solved in one step, the DLT of Finding the Camera From Known Points — P by Least Squares again.

What it assumes. - At least three photos (two with zero skew), with boards that are not parallel to one another (the NOTE below). - Exact corners. With noise, b is the least-squares answer, not an exact one (H&Z Ch. 8 More Single View Geometry, p. 225).

Where it breaks. - Near-degenerate photos still return an answer, but noise picks which member of the family you get (H&Z Ch. 8 More Single View Geometry, pp. 225–226). That is the spread of f in the noisy tries below. - Corners that obey the lens, not the pinhole. With our k1=−0.2 and exact corners, the three photos give α_x = 927.6 px instead of 500, and (c_x, c_y) = (158.6, 310.3). The closed form is only a start; the polish of Section 4 fits the lens.

Why does the tilt matter so much? Look at what the face-on photo contributes. Written as rows of V:

  • h₁ᵀωh₂ = 0 becomes (0, 250000, 0, 0, 0, 0): it touches only ω₁₂, and says "no skew";
  • h₁ᵀωh₁ = h₂ᵀωh₂ becomes (250000, 0, −250000, 0, 0, 0): it touches only ω₁₁ − ω₂₂, and says "square pixels".

Neither row ever sees the principal point or f. A board facing the camera squarely looks the same whatever the focal length, only bigger or smaller, so it cannot tell you f. Here is the first figure again with the board turned to face camera 2: both vanishing points go to infinity, the two rows are exactly the ones above, and the last tile says so.

-100
Camera: focal length and principal point
500320240
Camera 2: move it and turn it
100100
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.

NOTE: Boards that are all parallel to one another add nothing either: if the camera only slides, every photo gives the same two equations again. The book names this degenerate case (H&Z Ch. 8 *More Single View Geometry*, pp. 225–226), and so does Zhang [ZHAN00]; the cure the book credits to Zhang is to photograph the board many times in different positions. Turn the board, or turn the camera, between photos.

With ω in hand, K comes back by Cholesky, a standard factorisation that splits a symmetric matrix into a triangle times its transpose. ω⁻¹ is KKᵀ up to scale, and K is upper-triangular with a positive diagonal, which is exactly the shape that comes out (H&Z Ch. 8 More Single View Geometry, p. 211, alg. 8.2 on p. 225):

KK⊤=ω−1(up to scale)KK⊤=(αx2+s2+cx2sαy+cxcycxsαy+cxcyαy2+cy2cycxcy1)(6)
  • α_x and α_y are the focal lengths in pixels across and down, s the skew, (c_x, c_y) the principal point in pixels, all as in The Pinhole Camera — A Pixel Is a Ray.
  • Our KKᵀ = [[352400, 76800, 320], [76800, 307600, 240], [320, 240, 1]]. Read it from the last column up:
  • c_x = 320 px and c_y = 240 px;
  • α_y² = 307600 − 240² = 250000, so α_y = 500 px;
  • s = (76800 − 320 × 240) / 500 = 0;
  • α_x² = 352400 − 320² − 0 = 250000, so α_x = 500 px.

Now the honest part. Switch on "0.5 px noise". Over 200 tries of half a pixel of corner noise, f has a median of 538.6 px, and the middle half of the tries lands anywhere from 460.6 to 612.5 px; in 2 of the 200 tries there is no real answer at all. Three photos of a 94-px board, one face-on, one turned only 10° and one also tilted 20°, are a weak experiment. The lesson is tilt more, and fill the frame, which is why the usual advice is many photos at many angles.

Try this: "drop the tilted photo" and watch the second near-zero value appear.

Why it exists. ω is the protractor, but what calibrateCamera hands back is K. Cholesky is the one step between them, and the answer is unique because K is upper-triangular with a positive diagonal (H&Z Ch. 8 More Single View Geometry, p. 211).

What it assumes. - ω, with the right sign, is positive definite: a true ω has no real points (H&Z Ch. 8 More Single View Geometry, p. 210).

Where it breaks. - Noise can push the fitted ω out of that shape, and then no K exists: the 2 tries of 200 above. - With every equation treated as soft, noise gives a K with a little skew and pixels that are not quite square, even for a camera with neither. The book's remedy is to build those facts into ω (H&Z Ch. 8 More Single View Geometry, p. 225), the same idea as the flags of Section 6.

4. The Final Polish, and What Comes Back

ReturnedWhat it isWhich read explains it
the return valueRMS reprojection error over every corner of every photo, pxFinding the Camera From Known Points — P by Least Squares, and below
cameraMatrixK, 3×3The Pinhole Camera — A Pixel Is a Ray, and Sections 2–3 here
distCoeffsthe lens, (k₁, k₂, p₁, p₂, k₃)Lens Distortion — Bending Straight Lines Back
rvecs, tvecsone pose per photo, board → cameraWhere Is the Camera? — R, C and t
perViewErrorsRMS per photo, px (from calibrateCameraExtended)below

Table. 2 What calibrateCamera returns (OpenCV 4.x documentation [OPEN24]).

The closed form of Sections 2–3 is only a starting guess. It ignores the lens, and it fits ω, not the pixels. So the last step refines everything at once (Zhang §3.2–3.3 [ZHAN00], outside the book):

  • the unknowns are K, the distortion coefficients, and one rotation and translation per photo;
  • the cost is the reprojection error: the squared pixel distance between each detected corner and where the current K, lens and pose put it, summed over every corner of every photo;
  • the solver is Levenberg–Marquardt, a least-squares method that takes careful steps downhill and shortens them when a step makes things worse.

It is the same idea as the polish in Finding the Camera From Known Points — P by Least Squares, only with many photos sharing one K. OpenCV's documentation describes exactly these three stages: a first guess of the intrinsics from the planar board, a first pose per photo, then one global run that minimises the reprojection error [OPEN24].

NOTE: OpenCV's own first guess is a smaller version of Section 3. Unless you pass CALIB_USE_INTRINSIC_GUESS, it puts the principal point at the image centre and solves only for the two focal lengths, by least squares, from each photo's homography (its documentation and source [OPEN24]). The full five-unknown closed form is Zhang's.

Reading the outputs:

  • The returned RMS is per corner: the square root of (the summed squared distances ÷ the number of corners). The book's residual is per coordinate, so for the same fit OpenCV's number is 1.414 times larger. Read 4's six-point fit, for example, is 0.348 px per corner and 0.246 px per coordinate.
  • perViewErrors gives the same RMS for each photo on its own. A photo with badly found corners stands out as the one view with a much larger error; drop it and calibrate again.
  • The lens is fitted in this step only: the closed form of Sections 2–3 assumes straight-line projection.

4.1 Where I Met This

On that project there was no checkerboard to wave. The ground was the board. I already had the camera's intrinsics, the focal length included, so K was known; what was missing was where the camera stood and where it pointed. I built the homography from the ground plane to the image plane by hand, points on the ground matched to their pixels, and gave them to MATLAB's estimateExtrinsics [MATL22]. It takes points on a plane at z = 0, their pixels and the intrinsics, and returns R and t.

That is Section 1 run backwards. With K known, nothing in H = K[r₁ r₂ t] is left to guess:

  • K⁻¹H gives r₁, r₂ and t, up to one scale;
  • r₁ must have length 1, which fixes that scale, and r₃ = r₁ × r₂ (Zhang's paper, Section 3.1 [ZHAN00]);
  • four ground points are enough; MATLAB asks for at least four.

No ω, no three tilted photos: those are only needed when K itself is unknown.

TrivediInformational[Page 2]
S. TrivediOct 2026

5. The Same Idea With One Photo

There is a board hidden in many ordinary photos: anything box-shaped. A room, a building, a shoebox on the floor. Its three edge directions are at right angles, just like the board's two axes, so the protractor works on them too.

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.

What the figure shows (camera 2, pitched down 20°, looking at a box on the floor):

  • the box's three edge directions vanish at v_x = (−2697.63, 58.01), v_y = (320, 1613.74) and v_z = (413.82, 58.01) px, all far outside the 640 × 480 frame;
  • the three points make a triangle. Drop a line from each corner square onto the opposite side (an altitude); the three altitudes meet in one point, the triangle's orthocentre, and here it is (320, 240): the principal point (H&Z Ch. 8 More Single View Geometry, p. 227).

Each pair of vanishing points comes from two directions at 90°, so it gives one equation 𝐯a⊤ω𝐯b=0 (H&Z Ch. 8 More Single View Geometry, §8.6.3, eq. 8.16, p. 219). For a camera with square pixels and no skew, ω is the matrix of Section 2 with f and p inside it, and the equation becomes a statement about distances in the picture (H&Z Ch. 8 More Single View Geometry, §8.8, ex. 8.27–8.28, pp. 226–228):

𝐯a⊤ω𝐯b=0⇔(𝐯a−𝐩)·(𝐯b−𝐩)+f2=0f2=−(𝐯a−𝐩)·(𝐯b−𝐩)(7)
  • 𝐯a,𝐯b are two vanishing points of perpendicular directions, in pixels; p is the principal point (c_x, c_y); f the focal length, in pixels.
  • The numbers: with p = (320, 240), v_x − p = (−3017.63, −181.99) and v_z − p = (93.82, −181.99). Their dot product is −250000 px² (to the rounding of the printed points), so f = 500 px. The other two pairs give 500 px as well, and v_xᵀωv_z = −1.4e−17.
  • With all three points you do not even need to assume p: the orthocentre of the triangle is p, here (320, 240).

Why it exists. It gets f from one ordinary photo with no board: any three edge directions at right angles stand in for the board's two axes.

What it assumes. - Zero skew and square pixels (H&Z Ch. 8 More Single View Geometry, ex. 8.27, p. 226), and the principal point known, or found as the orthocentre. - The two edge directions really are at 90°. - Straight edges stay straight: no lens, or the lens taken out first (Lens Distortion — Bending Straight Lines Back).

Where it breaks. - A centre guessed wrong moves f. Assume p = (330, 240) instead of (320, 240), and the same v_x and v_z give f = 469.7 px. - A corner that is not square. Turn the box's x edges toward its z edges so they meet at 89° instead of 90°, and f comes out 531.1 px; at 85°, 733.1 px. v_x sits about 3000 px out, so a small turn of its direction moves it a long way. - A vanishing point at infinity: the NOTE below.

NOTE: Level the camera and v_y runs off to infinity: vertical edges stay parallel. f from v_x and v_z is still 500 px, as long as you assume the centre is at (320, 240). What is lost is the centre itself: the altitudes only say it lies somewhere on the line through v_x and v_z, here row 240, and not where along it (H&Z Ch. 8 *More Single View Geometry*, p. 228). Given the centre, f is still found; the centre itself is not.

Try this: press "level camera" and watch the triangle open up into one dashed row while the first tile keeps saying 500 px.

6. In OpenCV

HereOpenCVShapeSeries value
board cornersfindChessboardCorners, then cornerSubPixN corners, row by row, left to right16 corners, ~94 px wide in photo 1
board pointsobjectPoints per photo, z = 0 on the boardN×3(a, b, 0), 0.25 m apart
RMSthe return value of calibrateCamerapx, per corner over all photos1.414 × the book's per-coordinate residual
KcameraMatrix3×3[[500, 0, 320], [0, 500, 240], [0, 0, 1]] (exact corners)
lensdistCoeffs5 numbers by default(−0.2, 0, 0, 0, 0)
one pose per photorvecs, tvecs (board → camera)one 3×1 pair per photo—
the bad photocalibrateCameraExtended → perViewErrorsone RMS per photo, px—
fewer unknownsCALIB_FIX_ASPECT_RATIO, CALIB_ZERO_TANGENT_DIST, CALIB_FIX_PRINCIPAL_POINT, CALIB_FIX_K3flags—

Table. 3 This read in OpenCV 4.x [OPEN24]. The lens value is the series lens from Lens Distortion — Bending Straight Lines Back.

  • The flags are the "fewer unknowns" of Section 3 in practice: CALIB_FIX_ASPECT_RATIO keeps fx/fy fixed, CALIB_ZERO_TANGENT_DIST sets p₁ and p₂ to zero, CALIB_FIX_PRINCIPAL_POINT keeps the centre where it starts, and CALIB_FIX_K3 holds k₃ (at 0 unless you give it a guess). Each one removes an unknown, so weak photos have less to get wrong.
  • findChessboardCorners returns the corners in order, row by row and left to right in every row; its documentation calls them approximate and points to cornerSubPix to place them more accurately [OPEN24].

7. What Came Next

One camera is done: K, its lens and its pose. Add a second camera, and a pixel that was a dead end, a whole ray, becomes something you can search along. Where on the second picture can the match of a pixel be? Always on one line, and Epipolar Geometry — A Point Becomes a Line finds it. Stay tuned :)

8. References

  1. [HART04] R. Hartley, A. Zisserman, Multiple View Geometry in Computer Vision, 2nd ed., Cambridge University Press, 2004. Chapters used in this read: Ch. 8 More Single View Geometry.
  2. [OPEN24] OpenCV 4.x documentation, Camera Calibration and 3D Reconstruction (calib3d): calibrateCamera, findChessboardCorners.
  3. [ZHAN00] Zhang. A Flexible New Technique for Camera Calibration. IEEE TPAMI 22(11), 2000.

9. Connections

What this page builds on, cites or links to, and what points back at it. A plain box is a “builds on”; “cited” and “linked in the text” are the lighter links. Hover a box for a preview.

POINTS AT THIS PAGEREADEpipolar Geometry — A Point Becomes aLineREAD · LINKED IN THE TEXTThe Pinhole Camera — A Pixel Is a RayREAD · LINKED IN THE TEXTFinding the Camera From Known Points — Pby Least SquaresREAD · LINKED IN THE TEXTLens Distortion — Bending Straight LinesBackREAD · LINKED IN THE TEXTFrom Matches to Motion — Four Cameras,One Right AnswerThis pageTHIS PAGE POINTS ATREADPoints at Infinity — Horizons, VanishingPoints and the FloorREADFinding the Camera From Known Points — Pby Least SquaresREADLens Distortion — Bending Straight LinesBackREFERENCE · CITEDMultiple View Geometry in ComputerVisionREFERENCE · CITEDestimateExtrinsics: Calculate locationof calibrated cameraREFERENCE · CITEDCamera Calibration and 3D Reconstruction(calib3d)REFERENCE · CITEDA Flexible New Technique for CameraCalibrationREAD · LINKED IN THE TEXTThe Pinhole Camera — A Pixel Is a RayREAD · LINKED IN THE TEXTWhere Is the Camera? — R, C and tREAD · LINKED IN THE TEXTEpipolar Geometry — A Point Becomes aLinePROJECT · LINKED IN THE TEXTVehicle Counting UI

Related

Go deeper

  1. Start with
    Read
  2. Read
  3. Read
  4. Read
  5. Read
  6. You are here
    What calibrateCamera Actually Does
    Read
  7. Then
    Read
  8. Read
  9. Read
  10. Read
  11. Read

Go broader

<- Older [Page 4] Newer ->