An indoor drone has no GNSS fallback: its position estimate comes from the pixels its cameras deliver. Every lens, however good, bends straight lines outward at the edges and sits a fraction of a millimetre off the sensor centre, and a navigation loop that treats distorted pixels as true bearings will map walls in the wrong place and clip obstacles it saw perfectly. This page sets out what geometric camera calibration measures, how to run it on a board-level camera, and the numbers that tell you the result is good enough to fly.
What geometric calibration gives a navigation pipeline
A visual navigation loop runs one geometric operation thousands of times a second: it turns a pixel position into a bearing, and two bearings into a position. That needs the camera's intrinsic parameters — the focal lengths fx and fy in pixels, the principal point cx and cy where the optical axis meets the sensor, and the distortion coefficients that straighten the lens. It also needs the extrinsics: the rotation and translation that place the camera in the airframe's frame beside the IMU. The names here follow the OpenCV convention; other libraries reorder or rescale the same handful of numbers.
These numbers belong to one physical unit, not to a design. Two cameras of the same model differ because each lens sits at a slightly different distance and angle on its sensor, and those placement tolerances produce bearing errors larger than a navigation loop's own budget. Production calibration therefore runs per serial number, storing results in the camera or in a file keyed to it — the same pattern as depth sensors, where you read fx and fy from the ToF camera's calibration model. When depth and colour come from separate sensors, the intrinsics must be converted between them before the streams merge, as in converting intrinsic parameters for depth and texture images.
The pinhole model and the distortion terms
(X, Y, Z) is a point in metres in the camera frame, p the pixel pitch in millimetres, and (u, v) the pixel it lands on; (xn, yn) is the same point measured in units of fx and fy. k1 does most of the work on real lenses: negative k1 is barrel distortion, typical of short focal lengths, where a wide board-camera lens commonly lands between -0.05 and -0.15 in these normalized units. p1 and p2 are tangential terms from lens decentering and run one to two orders below k1. A calibration that returns a large k2 or k3 usually means the image set never covered the frame corners, not that the lens needs them.
Pick the field of view before you calibrate, because fx fixes it: enter cruise working distance and the width you need to see, and the calculator below returns the focal length that produces it. The same logic drives M12 lens selection for board cameras, where format, focal length and IR cut decide the fit.
Running the checkerboard calibration
Zhang's method — estimate the intrinsics from many views of a planar pattern, then refine everything jointly by bundle adjustment — is the standard path, and OpenCV's camera calibration tutorial walks the full sequence. The image set decides the quality:
- Print or buy a flat target. Measure its square size once with calipers and enter the true value, because fx absorbs any scale error in it.
- Lock focus mechanically at the cruise working distance. Refocusing later invalidates the calibration.
- Capture 20-40 sharp images: distances from about one third to twice the working distance, the target tilted between 15° and 45°, placed in all four frame corners and the centre, even lighting, no motion blur.
- Solve and inspect the residuals. If a few images dominate the error, decide for each whether to discard it or retake the pose.
- Store fx, fy, cx, cy, k1, k2, p1 and p2 tagged with serial number, date and focus setting.
Corner coverage is what pins the distortion model: an image set confined to the frame centre returns a confident fx and a meaningless k1.
Worked example: bearing error at the frame corner of a 12 MP board camera
- Sensor format
- 1/2"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- 12 MP
The LS-BCM-0056 is a 12 MP GigE board camera with 1.6 μm × 1.6 μm pixels on a 1/2" sensor and a C-mount; the geometry below is independent of readout type. Inputs: an 8 mm C-mount lens chosen for indoor flight, focus held at 10 m, and a target at the frame corner.
Twelve megapixels at a 1.6 μm pitch is a 4000 × 3000 array covering 6.4 mm × 4.8 mm. Focal length in pixels: fx = f / p = 8 mm / 0.0016 mm = 5000 px. Horizontal field of view: 2·arctan(6.4 / (2 × 8)) = 2 × 21.8° = 43.6°. One pixel subtends p / f = 0.0016 / 8 = 0.2 mrad, which is 2 mm of lateral position at 10 m range.
The frame corner sits at a half-diagonal of √(2000² + 1500²) = 2500 px, a normalized radius r = 2500 / 5000 = 0.50. Take a mid-range barrel result for a short lens, k1 = -0.08. The correction factor at the corner is 1 + k1·r² = 1 − 0.08 × 0.25 = 0.98, so the measured corner point lands 2% short of its pinhole position: 0.02 × 2500 = 50 px.
Fifty pixels is 50 × 0.2 mrad = 10 mrad of bearing error: a feature seen at the corner at 10 m is misplaced by 100 mm on the map, while the corrected pixel scale at that range is 2 mm. The decision follows. Every bearing used for mapping or triangulation must come from the undistorted image, and after correction the same corner residual drops below 0.5 px — about 1 mm at 10 m, inside what feature matching resolves.
Reprojection error: the number that decides
RMS reprojection error is the mean distance, in pixels, between where the model places each detected corner and where it was measured. Feature detectors localize corners to a few tenths of a pixel, so an RMS below 0.5 px means the model fits within measurement noise, and visual odometry is comfortable below 0.3 px. Above 1 px, something is unmodeled: wrong distortion order, focus breathing, rolling-shutter smear or a warped target — not a shortage of images. Judge per image as well as in aggregate, because a mean can hide two 3 px outliers. To quantify how much barrel distortion a correction really removes, project straight edges and measure them as in measuring barrel distortion correction accuracy; the same undistortion step is what makes pixel-to-mm measurements accurate.
Extrinsics: mount pose and stereo depth
Extrinsics are one rigid-body transform: a 3 × 3 rotation and a translation of a few centimetres from camera to body or IMU frame. A wrong lever arm makes the pose estimate oscillate with attitude, so measure it and refine it, and keep every camera on a multi-camera airframe in one shared coordinate frame.
Stereo depth falls out of the same intrinsics as Z = fx·B / d, with baseline B in metres and disparity d in pixels. A binocular module freezes the baseline in one rigid housing:
- Sensor format
- 1/2"
- Lens mount
- M12
- Interface
- USB3
- Resolution
- Up to 3 MP
The LS-BCM-0043 pairs two 1/2" global-shutter sensors at 1280 × 1024 over USB3. For this example, mount it with a 60 mm baseline and a 4 mm lens per camera: the pixel pitch is 6.4 mm / 1280 px = 5 μm, so fx = 4 / 0.005 = 800 px. A feature at 5 m sits at d = fx·B / Z = 800 × 0.06 / 5 = 9.6 px of disparity, and 0.5 px of matching noise moves the depth by Z²·δd / (fx·B) = 25 × 0.5 / 48 = 0.26 m.
At 5 m a stereo pair with this geometry locates an obstacle to about a quarter metre: right for wall mapping and coarse avoidance, while a 0.1 m clearance call belongs at closer range, where the error shrinks with Z².
Rolling shutter and why flight wants a global shutter
A rolling-shutter sensor reads rows in sequence. Full-frame readout commonly runs 5-30 ms depending on resolution and clocking, and at 2 m/s cruise the scene moves 10-60 mm during one frame, so straight edges shear and measured bearings depend on flight speed — correlated error that degrades visual odometry directly. Global shutter exposes every row at once and removes the effect at the source, which for flight is worth more than resolution. Where the worked example gives 2 mm per pixel at 10 m, keeping exposure smear under one pixel at 2 m/s means exposures of about 1 ms or less, or a sensor that does not roll at all. Rolling-shutter compensation from IMU data exists in modern SLAM stacks, but it adds synchronization paths that can fail in flight.
- Sensor format
- 1/2.9"
- Lens mount
- M12
- Interface
- GigE
- Resolution
- Up to 3 MP
The MV-CB016-10GM-M-W is a 1.6 MP mono board camera on a 1/2.9" global-shutter sensor, with an M12 mount and a GigE port — the shape of a navigation camera.
Keeping the calibration valid on the airframe
Calibration is a mechanical measurement, and airframes move. Vibration works M12 threads and focus rings loose, and a lens tilted by a fraction of a degree shows up as asymmetric distortion residuals.
Temperature moves focus too: a module focused indoors can be measurably out of focus after twenty minutes in cold air, which blurs features and shifts fx at the same time — the mechanism behind diagnosing focus drift with temperature. Lock the lens before calibrating, with threadlocker on M12 or a fixed-focus mount where the build allows, and when a lens change forces a recalibration, check focal length against back focus on board cameras first.
Recalibrate after any hard landing, after every lens swap, and before the first flight at a new temperature extreme. Tag each intrinsics file with serial number, date and focus setting so you can tell mechanical drift from a software regression.
When the pinhole model is the wrong model
Beyond roughly 100° of field of view the polynomial stops converging: edge residuals stay high no matter how many k terms you add, and a fisheye or equidistant model with its own solver is the correct tool. Zoom lenses need one calibration per focal-length setting, which is why navigation cameras use primes. Neither model fixes motion blur or rolling-shutter smear; those are exposure problems, and a geometric calibration will happily absorb them into wrong distortion coefficients.
Pre-flight calibration checklist
- One calibration per serial number. Unit-to-unit placement tolerances exceed a navigation loop's error budget.
- True square size, measured once. fx absorbs target scale error and passes it to every triangulated position.
- Focus locked at cruise distance. Sharpness and fx both depend on it.
- 20-40 images covering all four corners, tilted 15-45°. Corner coverage pins the distortion model.
- RMS reprojection error at or below 0.5 px, no per-image outliers above 1-2 px. The pass criterion, not a nice-to-have.
- Global shutter, or verified rolling-shutter compensation. Bearings must not depend on flight speed.
- Logged recalibration triggers. Hard landing, lens change, first flight at a temperature extreme.
Choose camera and lens as one decision: the camera finder filters by shutter, sensor format and interface, board-level cameras are the modules built to be integrated, and the configurator steps from sensor to mount. For depth alongside navigation, start from 3D sensors, and the 3D vision topic page collects the depth-side guides. If you want a calibration plan reviewed before you commit hardware, contact us.
Questions
How many checkerboard images does a UAV camera calibration need?
Twenty to forty well-chosen images beat two hundred mediocre ones. Cover distances from roughly one third to twice the cruise working distance, tilt the target between 15° and 45°, and place it in all four frame corners and the centre. Past about forty sharp, well-spread images, adding more changes the parameters by less than their own uncertainty and only wastes bench time.
What reprojection error is good enough for visual SLAM?
Target an RMS below 0.5 pixels, and under 0.3 pixels if the pipeline feeds visual odometry directly. Feature detectors localize corners to a few tenths of a pixel, so below that level the model fits within measurement noise. An RMS above 1 pixel almost always means something is unmodeled — wrong distortion order, focus breathing, rolling-shutter smear or a warped target — not that you need more images.
Do I need to recalibrate after a crash or a lens change?
Yes to both. A hard landing can tilt the lens in its mount by a fraction of a degree, which shows up as asymmetric distortion residuals, and any lens swap changes focal length, distortion and back focus together. A full checkerboard session takes about ten minutes on the bench; keep the intrinsics tagged with serial number, date and focus setting so drift is visible.
Can I use the same pinhole calibration for a fisheye lens?
No. Beyond roughly 100° field of view the polynomial pinhole model stops converging: edge residuals stay high however many k terms you add. Fisheye lenses need an equidistant model with its own calibration routine, and the resulting parameters are not interchangeable with pinhole fx and fy values. Choose the model to match the lens before you capture any images.
Why calibrate every camera individually when they are the same model?
Sensor placement and lens machining tolerances differ from unit to unit: the optical axis lands a few pixels off centre and the lens sits at a slightly different angle on every sensor. Those differences produce bearing errors larger than a navigation loop's own budget, so the intrinsics belong to a serial number, not to a part number. Store them per unit, in the camera or in a file keyed to it.


