← Todos os artigos

aiNov 21, 20261 min de leitura

How Camera Calibration Finds the Lens Numbers

In my last post I wrote that calibration gives us the rule for how a fisheye lens bends light. This post shows how that rule is found.

Animation: cyan detected checkerboard corners and orange model predictions joined by pink error lines; as the focal length and distortion are adjusted the lines shrink and the reprojection error drops from about 36 px to under 0.5 px
Code-generated illustration (simulated fisheye camera and checkerboard), not real data.

We take photos of a printed checkerboard. A corner detector finds the corners in each photo; these are the cyan dots. We also know where the corners are on the real board, because every square has the same size. The lens model has a few unknown numbers, here the focal length f and one distortion term k1. For any guess of these numbers, the model predicts where each corner should appear in the image. These predictions are the orange crosses.

The pink lines show the gap between each prediction and the detected corner. Their average length is called the reprojection error. An optimiser changes f and k1 step by step to make this error smaller. In the GIF, the first guess is about 36 pixels off, and the final model is off by less than half a pixel. A small number left over is normal, because the corner detector itself is not perfect.

In practice, we use 15 to 30 photos of the board taken from different angles and distances, so that the corners cover the whole image, including the edges where a fisheye bends the most. A low reprojection error on these photos is the first sign that the lens model can be trusted.

Comentar

Comentários

Seja o primeiro a comentar

Seu e-mail nunca será exibido. Os comentários aparecem após revisão.