Camera Pixel Scale & Depth Calibration Calculator

Check whether one reference-plane calibration stays within your measured size budget as a part moves in depth. Record the image span of the same known gauge at three positions for each camera setup. Compare the resulting apparent size, signed error and local pixel scale in the same field region.

Measured machine vision

Audit camera pixel scale across depth

Edit gauge spans, depth offsets and limits
Setup A
Setup B

Only Setup B meets both sampled limits.

25 mm part span · ±0.1 mm error cap · 49.8 px/mm minimum

Setup A

Misses a sampled limit

0.2 mm

Worst absolute bias · Near plane

Lowest local scale
49.65 px/mm
Reference calibration
50 px/mm

Setup B

Meets both limits

0.1 mm

Worst absolute bias · Near plane

Lowest local scale
49.8 px/mm
Reference calibration
50 px/mm

Inspect the measured depth planes

Signed size error (mm)

Cap ±0.1 mm

Depth offset from reference

  • Setup A
  • Setup B
  • Within error cap

Far · +25 mm from reference

Setup A · -0.175 mm error

24.825 mm inferred · 49.65 px/mm

Outside error cap · Below pixel scale

Setup B · -0.1 mm error

24.9 mm inferred · 49.8 px/mm

Within error cap · Meets pixel scale

Review exact calibration and depth ledger
Exact depth, scale and inferred size
SetupPlaneDepth (mm)Gauge (px)Local scale (px/mm)Inferred span (mm)Error (mm)Meets limits
ANear-151008252/5126/51/5No
AReference0100050250Yes
AFar25993993/20993/40-7/40No
BNear-151004251/5251/101/10Yes
BReference0100050250Yes
BFar25996249/5249/10-1/10Yes

How to use this calculator

  1. Enter the known gauge length and part span. Set the error cap and minimum measured pixel scale.
  2. Record signed near and far offsets from the same reference plane.
  3. Enter the gauge’s measured pixel span at each plane for both setups. Use the same feature, measurement axis and local field region.
  4. Inspect the error plot and the selected plane’s inferred reading. Compare the worst absolute error and lowest pixel scale.
  5. Open the exact ledger or download all measurements and derived quantities.

The Formula

The mathematical logic powering this calculation is:

Measure a known gauge of length G along the same image direction and local field region at each depth. If it spans P pixels in a plane, local scale is P ÷ G pixels per millimeter. The fixed calibration for that setup is the scale measured at the reference plane. Nominal part span L projects to L × local scale pixels. Applying the fixed reference calibration gives inferred size L × local scale ÷ reference scale. Signed size error is inferred size minus L. Positive values mean the part appears too large.
The exact absolute error must be at or below the cap and the local scale at or above the minimum at every entered plane. Equality counts. Tied extremes show the earliest plane in near-to-far order. Both setups use the same gauge, proposed part span and depth offsets. The chart shows discrete sampled planes and a symmetric error cap. It makes no interpolation or prediction outside those samples.
Use a consistent optical setup, field location, axis, imaging scale and measurement basis for each lens comparison. The local model assumes the part uses the gauge’s scale over its evaluated span. The pixel density is a sampling quantity. Optical resolution, focus, edge localization, distortion across the image, physical gauge uncertainty and full-field errors require separate evidence.
Gauge and part length accept 0.001–100,000 mm. Near offset is −100,000 to −0.001 mm, far offset is 0.001–100,000 mm and reference offset is zero. Measured pixel spans accept 0.001–1,000,000 px. The error cap accepts 0–100,000 mm and the scale minimum 0–1,000,000 px/mm. Inputs accept three decimal places. Exact rational values govern comparisons and exports.

Worked Example

If you input:

  • Gauge and part: 20 mm gauge and 25 mm part span.
  • Planes: −15 mm, 0 mm and 25 mm from reference.
  • Setup A: 1,008, 1,000 and 993 px.
  • Setup B: 1,004, 1,000 and 996 px.
  • Limits: 0.1 mm absolute error and at least 49.8 px/mm.

Result:

Setup B meets both limits exactly, with ±0.1 mm off-reference error and its lowest local scale of 49.8 px/mm. Setup A reaches 0.2 mm absolute error and 49.65 px/mm. Reducing the cap to 0.099 mm leaves neither setup within both limits.

Frequently Asked Questions

How can the reference-plane error be zero when the instrument has uncertainty?

The reference reading defines the scale, so identifying its own recorded span gives an algebraic zero. Gauge and measurement uncertainty are separate.

Is local pixels per millimeter an optical resolution measurement?

It describes sampling density from the measured gauge. Blur, contrast and edge detection affect how well adjacent features can be resolved.

Why does positive error indicate an oversized reading?

The measured span has more pixels per millimeter than the fixed reference assumes. Dividing those pixels by the smaller reference scale overestimates size.

Can I use the plot for unmeasured depths or off-axis features?

The tool evaluates only the recorded planes and the gauge’s local field region. Use separate observations for other depths or positions.

Similar Calculators