Lenses & opticsExplainer

Checkerboard calibration targets: image quality requirements

The image requirements for checkerboard calibration: pixels per square, aperture and blur limits, even light, and a sizing example with the arithmetic.

LumaSpec Vision11 min read Share on LinkedIn

On this page 9 sections
  1. 01How a checkerboard detector reads your image
  2. 02Pixels per square: the number that decides detection
  3. 03Sharp edges: focus, aperture and motion
  4. 04Even light and a matte board
  5. 05Framing, tilt and full grids
  6. 06Worked example: a 9 x 6 board, 15 mm squares and a 5 MP camera at 400 mm
  7. 07Common failures and the fix for each
  8. 08The decisions, and the parts behind them
  9. 09Questions

A checkerboard detector is a machine for finding one thing: crisp boundaries between dark and light squares. Feed it a blurry, glare-washed or noisy frame and it finds nothing, and the error will not tell you whether the board, the light or the focus is at fault. This guide turns the way these detectors work into capture-side numbers: pixels per square, aperture, exposure, lighting and framing. A worked example then runs the arithmetic from board size to focal length, so you can set the shot before you press the trigger and know the corners will come back.

How a checkerboard detector reads your image

Every checkerboard detector in common use runs the same three stages. It thresholds the frame, usually with a local adaptive threshold, into a black-and-white map. It finds the dark regions shaped like squares of similar size and checks that they form a consistent quadrilateral grid: neighbours share corners, rows and columns alternate, spacing is regular. It then takes each rough corner and refines it to subpixel accuracy by fitting the two intensity edges that meet there.

Assisted tools run the same logic. The automatic checkerboard corner detection tool published by NIST starts from four corners you click by hand and leaves the grid walk and the refinement to the software, so accuracy still rides on the image the clicks seed (NIST checkerboard corner detection tool).

Each stage sets a requirement you can control. The threshold stage needs real black-white contrast, which is lighting and exposure. The grid stage needs every square complete and inside the frame, which is framing and glare control. The refinement stage needs edges that span a few clean pixels, which is focus, aperture and noise. The sections below put numbers on each.

Pixels per square: the number that decides detection

The detector consumes squares as pixel regions, so the printed size of the squares matters less than how many pixels each side spans. The working rule: aim for at least 20 pixels per square side, treat 8 pixels as the floor below which squares tear or merge during thresholding, and expect little further gain past about 25, where blur and lighting set the accuracy instead. Tilt compresses one axis by the cosine of the tilt angle, so keep the floor in mind for the compressed axis too.

pixels per square = image width (px) × (board width / FOV width) / squares across the board

Two things follow. Square size in millimetres cancels out: a 10 mm square at 20 px/mm and a 20 mm square at 10 px/mm both give 200 pixels per side. The number you control at the bench is the board's share of the frame, so zoom or step closer until the squares are big enough. How many squares to print is the companion question — checkerboard calibration target size: how many squares and how big works it with the same arithmetic.

Sharp edges: focus, aperture and motion

Corner refinement fits the intensity transition at each edge, so the transition must stay narrow. Diffraction sets the hard floor:

blur disk = 2.44 × wavelength × f-number at 550 nm: 3.8 µm at F2.8, 7.5 µm at F5.6, 10.7 µm at F8, 21.5 µm at F16

On 3.4-3.45 µm pixels those disks span 1.1, 2.2, 3.1 and 6.2 pixels. Keep the blur disk under about 2 pixels: on this pixel pitch that means F5.6 or brighter. A flat, rigid board needs almost no depth of field, so there is nothing to trade against; stop down only when the board cannot sit at one distance. The diffraction arithmetic continues in airy disk size and the diffraction limit: match pixel to feature, and the depth side in aperture f-number and depth of field in machine vision cameras.

Depth of field around the focus plane Light from the lens converges on the focus plane. In front of and behind it, each point spreads into a blur circle; the zone where that blur stays below about a pixel or two is the depth of field. A smaller aperture gives a narrower cone and a deeper zone.depth of fieldfocus planeapertureoutside it, pointsblur into circleswide aperture: steep cone, shallow zonesmall aperture (high F#): deeper zone
Depth of field around the focus plane. Light from the lens converges on the focus plane. In front of and behind it, each point spreads into a blur circle; the zone where that blur stays below about a pixel or two is the depth of field. A smaller aperture gives a narrower cone and a deeper zone.

Motion blurs corners the same way. Keep exposure time × board speed below one pixel's footprint on the board. One pixel spans 0.086 mm on the board at the worked example's scale below, so a board moving 100 mm/s forces an exposure under 0.9 ms, while a static rig has no such limit. Keep gain near zero and take the extra light instead: noise widens every transition and scatters refined corners between repeated shots of the same pose, which surfaces later as calibration scatter you cannot trace.

Even light and a matte board

The threshold stage needs black squares that stay black and white squares that stay white across the whole frame. Light the board diffusely from the front — an LED panel, or two bar lights at 30-45° — so no square carries a shadow or a highlight. Placement rules for the lights are in lighting geometry for image contrast: camera, light and part positions.

Set exposure from the histogram: white squares near 200-230 of 255, black squares near 30-60, transitions in the middle of the range, nothing clipped at either end. A clipped white reads as a bigger blob to the threshold stage; a black square buried in noise tears into fragments. Both break the grid walk before the refinement stage ever sees a corner.

Gloss fails even under good light. The lamp reflects as a saturating highlight that splits squares, and the detector reports a partial grid. Print on matte paper or spray a laminated board matte; if the board must stay shiny, spread the reflection with a diffuse dome. For frames that already came back empty, the checks in checkerboard corners not detected: fix gaps in your target and checkerboard calibration not detecting corners: what to check cover the usual gaps.

Save lossless files — PNG or the camera's raw format. Heavy JPEG compression rings the edges and shifts refined corners by fractions of a pixel; across a calibration set that becomes a systematic error.

Framing, tilt and full grids

Keep the whole grid inside the frame with margin. The grid walk needs each square's neighbours present, so one border square clipped by the frame edge can end detection for the whole board even though every visible corner is perfect. Leave at least one square width of margin on all sides; at the 20-pixel target that margin is nearly free.

Tilt is wanted, not avoided — a calibration set needs the board at many angles. The per-frame limit is arithmetic: foreshortening scales one axis by cos(θ), so a square that spans 174 pixels face-on spans 87 at 60°. Detection survives; corner precision along the compressed axis drops with it. For metrology-grade results keep most poses within about 45° of face-on and let a few go steeper to condition the solve.

Two checks before you shoot. The grid needs odd-by-even inner corners, which why a calibration checkerboard needs odd by even squares explains. At long standoffs the pixel budget, not the detector, becomes the constraint: checkerboard calibration fails at distance: depth camera target size works that case.

Worked example: a 9 x 6 board, 15 mm squares and a 5 MP camera at 400 mm

Inputs, each one a decision you make at the bench:

  • Board: 9 x 6 inner corners, which is 10 x 7 squares at 15 mm, so 150 x 105 mm — a common printed target.
  • Camera: 2448 x 2048 pixels at 3.45 µm pitch, the standard 5 MP 2/3" class; sensor width = 2448 × 3.45 µm = 8.45 mm.
  • Working distance: 400 mm, set by the clearance around the rig.
  • Fill: the board spans about 70% of the frame width.
FOV = board width / fill fraction f = working distance × sensor width / FOV pixels per square = (image width / FOV) × square size

The arithmetic:

  1. FOV = 150 mm / 0.70 = 214 mm.
  2. f = 400 mm × 8.45 mm / 214 mm = 15.8 mm, so the nearest standard focal length is 16 mm.
  3. FOV at 16 mm = 8.45 mm × 400 mm / 16 mm = 211 mm.
  4. Scale = 2448 px / 211 mm = 11.6 px/mm.
  5. Pixels per square = 11.6 px/mm × 15 mm = 174 px. Cross-check: the board fills 150 / 211 = 71% of the frame, 0.71 × 2448 = 1738 px, over 10 squares = 174 px.

Decision: 174 pixels per square is nine times the 20-pixel target, so pixel count is nowhere near the limit in this set-up. The board could shrink to about 8% of the frame width — 0.08 × 2448 / 10 ≈ 20 px per side — before touching the target, and to about 3% before falling under the 8-pixel floor. The limits that bind are the ones above: F5.6 or brighter, even light, gain low, board rigid. Depth of field is not one of them: at F5.6 with magnification m = 8.45 / 211 = 0.04, DoF ≈ 2 × 5.6 × 0.00345 mm / 0.04² ≈ 24 mm total — the depth of field calculator does this conversion — far more than a flat board needs.

Run your own board, distance and sensor through the focal length calculator:

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

Common failures and the fix for each

What you see What it usually is The fix
Detector finds nothing Squares under the pixel floor, or blur from motion or defocus Zoom or step closer to 20 px per side; F5.6 or brighter; hold the rig still
Only part of the grid returns Glare tearing squares, or a border square clipped by the frame edge Matte board, diffuse light, one square of margin all round
Corners move between identical shots Gain noise, mains flicker, a loose mount Gain at zero, longer exposure, rigid stand
Detection passes but calibration error stays high Wrong square size entered, board not flat, poses bunched Caliper the print, mount the board on a plate, spread the poses

On preprocessing: resist it. Sharpening, contrast stretching and denoising each move edge positions before the detector runs, so you end up calibrating the filter chain along with the camera. Fix exposure, aperture and light at the source instead.

The decisions, and the parts behind them

  • Pixels: 8 per square side is the floor, 20 the target; frame the board over at least a tenth of the frame width.
  • Aperture: blur disk under 2 pixels, which is F5.6 or brighter on 3.4 µm pixels; stop down only for real depth ranges.
  • Exposure: board travel during exposure under one pixel footprint; static rigs expose freely with gain at zero.
  • Light: diffuse from the front, matte board, whites 200-230, blacks 30-60, nothing clipped.
  • Geometry: full grid in frame with a square of margin; tilt and spread the poses for the solve.

A 16 mm focal length lands almost exactly on the worked example. The LS-FFL-0567 is a 16 mm, 1.1", 20 MP C-mount lens with F2.8-22 and <0.3% distortion. The 16-22 mm image circle leaves margin around an 11 mm diagonal sensor. Tighter fields on a 2/3" sensor come from the 35 mm LS-FFL-0679, a 6 MP-class C-mount lens. Where the camera rides a moving axis, the anti-vibration LS-FFL-0475 holds its 36.61 mm focal length under shake.

Machine vision lenses16 mm, 1.1", 20 MP, C-mount machine vision lens, F2.8-22, <0.3% distortion (LS-FFL-0567)LS-FFL-0567
Type
Machine vision fixed
Sensor format
1.1"
$679.00View part
Machine vision lenses35 mm, 2/3", 6 MP, C-mount machine vision lens (LS-FFL-0679)LS-FFL-0679
Type
Machine vision fixed
Sensor format
2/3"
$219.00View part
Machine vision lenses36.61 mm, 2/3", C-mount anti-vibration machine vision lens (LS-FFL-0475)LS-FFL-0475
Type
Anti-vibration
Sensor format
2/3"
$299.00View part

None of this survives a wobbling mount, so hold the geometry with a stand: the LS-MNT-0040 slide-table stand gives a 700 mm column and a 400 x 450 mm base.

Camera standsMachine vision camera stand, professional slide-table type, height 700 mm, 400 x 450 mm base (LS-MNT-0040)LS-MNT-0040
Type
Camera stands
$629.00View partBuild a system with it

Pick the lens from the computed focal length and sensor, not the other way round. The machine vision lenses page filters by focal length, sensor format and distortion class, the lens finder narrows by mount and resolution, and the lens configurator walks the chain from board to part number. The light finder filters diffuse panels for the even front light, and camera stands hold the geometry. The lenses topic page collects the rest of the optics and calibration guides.

Questions

Does the printed size of the squares matter for detection?

Not for detection: the detector counts pixels, so a 5 mm and a 50 mm square photograph identically at the same pixels per side. The printed size matters afterwards as your scale factor. Enter the true edge length of one square, measured with a caliper on the printed board rather than the value you sent to the printer, because print scaling quietly changes that length.

Can a phone camera produce usable calibration images?

Yes, if it meets the same numbers: about 20 pixels per square side, sharp edges, matte board, even light and the full grid in frame. Lock focus and exposure so all frames behave alike, avoid digital zoom, and save lossless files rather than heavily compressed JPEGs, whose edge ringing shifts corners by fractions of a pixel.

Do all calibration images need identical lighting?

No. Every frame needs unclipped, even light on the board, but the set benefits from variety: shoot some frames with the board tilted left, right, up and down so the lens model sees every corner of the field. What must stay constant is focus and aperture, which fix the blur you are calibrating with.

How many images does a calibration need once detection works?

Detection quality and calibration quality are separate budgets. With every frame meeting the image requirements here, 10 to 20 frames usually cover a standard lens model, provided the board is tilted and shifted across the whole frame, corners included. Coverage of the sensor area, not the frame count, is what conditions the solve.

My board sits far away: how big must the squares be?

Smaller than you expect. A 2448-pixel camera over a 900 mm field of view resolves 2.7 px/mm, so a 20 mm square already spans 54 pixels and clears the 20-pixel target comfortably. What degrades at distance is accuracy per pixel, since each pixel then covers 0.37 mm of board; size the squares and the camera from the accuracy you need.

Should I sharpen or denoise images before corner detection?

Rarely. Sharpening overshoots edges symmetrically and denoising shifts them, so the detector calibrates your filter chain along with the camera. Fix exposure, aperture, gain and lighting at the source, keep gain near zero, and hand the detector unprocessed lossless frames. The only worthwhile preprocessing is exposure correction that pulls clipped whites back below saturation.