A bolt gives you three numbers worth knowing: pitch, major diameter and flank angle. A camera measures all three from one image — the thread as a black silhouette against a collimated backlight, shot through a telecentric lens. This guide is for students and line engineers who already have gradient edges from a Sobel or similar filter and need those edges to become repeatable millimetres. It gives the magnification decision with the pixel math behind it, a one-time scale calibration, a five-step algorithm that turns crest rows into a pitch value, and a complete worked example on an M10×1.5 bolt with every line of arithmetic shown, so you can drop the numbers straight into a lab report or a gauge study.
The decision, in three numbers
An ISO metric M10 coarse thread has a pitch of 1.5 mm, a 60° included flank angle and a nominal major diameter of 10 mm. Pitch sets how load spreads along the engaged turns, so a pitch error is a joint-strength question rather than a cosmetic one — the bolt tensile strength versus thread pitch calculations show how directly the two connect.
The decision is one station, one image: silhouette the bolt against a collimated backlight behind a telecentric lens, fit the axis, find the crest peaks, fit the flanks. On a 5 MP sensor with 3.45 µm pixels, 1x magnification puts 435 pixels between crests of a 1.5 mm thread and 0.5x still keeps 217 — both far above the 100 or so pixels per pitch this method needs. Take 0.5x when one camera must see the full 10 mm diameter; take 1x when the diameter is gauged elsewhere or the pitch is finer than 1 mm.
Judge every result against the thread class limits, not the nominal: a 6g external M10×1.5 thread allows 9.732 to 9.968 mm on the major diameter, so a good bolt never reads 10.000 mm.
Why telecentric glass and a collimated backlight
An ordinary lens changes magnification when the part moves in depth. For a 50 mm lens focused at 110 mm, magnification is m = f / (WD − f) = 50 / 60 = 0.83x, and moving the bolt 1 mm closer changes it by Δz / (WD − f) = 1/60 = 1.7% — a 10 mm diameter then reads 0.17 mm larger. No fixture seats a bolt that tightly, so this term would swamp the measurement. A telecentric lens holds magnification constant across its depth range and deletes it; the trade-offs are set out in entocentric vs telecentric lenses: when to use each.
The light decides your edge sharpness. A telecentric lens accepts only a narrow cone of rays, so a collimated backlight — rays parallel to the lens axis — passes cleanly and gives a 1 to 2 pixel edge transition. A diffuse panel sends rays at every angle; the lens rejects most, and the accepted fringe smears the edge over 5 to 20 pixels, which biases every width you read. The choice is worked through in collimated backlight or diffuse backlight for edge gauging, and placement and sizing in collimated backlight setup: working distance and light size.
Backlighting also makes the surface finish irrelevant. Rolled or polished steel under front light returns specular bands that hide the crests, while a silhouette reads a chrome bolt exactly like a black-oxide one — the same trick underlies backlight for width measurement on shiny turned steel. Collimated panels are sold by lit area and voltage class; a 24 V unit in the 100–200 mm class fits an M10 station with room for fixturing.
- Size
- 100-200 mm
- Type
- Collimated
- Voltage
- 24 V
Calibrate pixels to millimetres once
One scale number turns every pixel result into millimetres:
With a 3.45 µm sensor at 1x, p_obj = 3.45 µm / 1 = 0.00345 mm per pixel; the same sensor at 0.5x gives 0.0069 mm per pixel. The division for any magnification is laid out in calculate object space pixel size from magnification.
Scale error dominates everything else, so pin it down once per lens with a stage micrometer or two gauge blocks. A 0.1% scale mistake is 10 µm on a 10 mm reading — twenty times the ±0.5 µm random noise of a good crest fit. Telecentric glass keeps residual distortion to a fraction of a percent; calibrate what is left with the method in lens distortion correction for accurate pixel-to-mm measurements, then lock the focus ring so the scale cannot drift.
Pick the magnification from the numbers
Work from the smallest feature, not the bolt. The table assumes a 2448 × 2048, 3.45 µm sensor:
| Check | 1x | 0.5x |
|---|---|---|
| Object pixel size | 3.45 µm | 6.9 µm |
| Pixels per pitch, 1.5 mm | 435 | 217 |
| Pixels per pitch, M10×1 fine | 290 | 145 |
| Field of view | 8.45 × 7.07 mm | 16.89 × 14.13 mm |
| M10 major diameter fits | No — 10 mm exceeds 8.45 mm | Yes, ~2 mm margin each side |
| Pixels across a 10 mm diameter | — | 1449 |
The rule: keep at least 100 pixels per pitch, twice that when the pitch tolerance is tighter than ±0.01 mm. A wider field costs magnification, so if the head or overall length must also be in frame, drop another tier — telecentric lens selection: match magnification and image circle matches the lens to the sensor, and choosing camera resolution for dimensional inspection sizes the camera itself. For a 16.89 mm field at 7 µm resolution, the arithmetic lands near 2448 pixels: 16.89 mm / 0.007 mm = 2413.
Both picks here are C-mount, so one camera body keeps its calibration between them.
| Specification | LS-TCL-2118 | LS-TCL-2194 |
|---|---|---|
| Sensor format | 2/3" | 1" |
| Max sensor size (dia. mm) | 11.0 | 16.0 |
| Magnification (x) | 1 | 0.5 |
| Working distance (mm) | 108±2 | 110 |
| Image-side F/# | 7 | 8 |
| Object-side telecentricity (deg max) | 0.05 | 0.08 |
| Image-side distortion (% max) | 0.04 | 0.03 |
| Numerical aperture NA | 0.0712 | 0.03123 |
| Object-side resolution (um) | 4.7 | 10.7 |
| Image-side MTF30 (lp/mm) | 114 | 116 |
| Front filter thread | M30x0.5 | M44x0.5 |
| Total length TTL (mm) | 105.1 | 274 |
| Price | $1,239.00 | $1,539.00 |
All 2 share: Mount C-mount. Values as printed in each product's data sheet; open a part for its drawing and full specifications.
The five-step algorithm
- Binarize. Threshold the silhouette at the 50% level of the backlight signal; Otsu works in a clean cell. Fixed exposure, strobed light, no auto-gain.
- Fit the axis. For each image row, record the left and right edge; the midpoint series gives the axis by least squares (PCA of the part mask is equivalent). Rotate the image by that angle so the bolt axis runs along a single column.
- Extract the profile. Scan down the rotated image and record the outer edge x(y) on each side. The right boundary between crests is the flank itself, so this one series carries pitch, both diameters and the angle.
- Find the crests. Smooth lightly (a 5-pixel moving average), then run a peak finder with a minimum separation of half a pitch in pixels and a prominence above the noise. Refine each crest to subpixel with a quadratic fit over ±5 rows; expect ±0.1 pixel repeatability.
- Measure. Pitch is the mean crest interval times p_obj. Major diameter is the widest crest-to-crest span; minor diameter is the notch-bottom span. Each flank segment between crest and root gets a least-squares line x = a·y + b, and θ = atan(1/|a|) per flank; average the two sides.
The pitch step in code, with the test that proves it:
import numpy as np
from scipy.signal import find_peaks
# profile_px: right-edge x per image row after rotation, float, length 2048
# example inputs at 1x: scale and half a pitch in pixels
mm_per_px = 0.00345 # float, object-space scale at 1x
half_pitch_px = 217 # int, 0.5 x 435 px per 1.5 mm pitch
peaks, _ = find_peaks(profile_px, distance=half_pitch_px, prominence=20.0)
interval_px = float(np.diff(peaks).mean()) # 434.8 px in the worked example
pitch_mm = interval_px * mm_per_px # -> 1.500 mm
assert abs(pitch_mm - 1.500) < 0.005 # passes: measured 1.5001 mm
The distance argument counts samples, so it scales with magnification: 217 px at 1x, 108 px at 0.5x.
Worked example: M10×1.5 at 1x
Example inputs: a 2448 × 2048, 3.45 µm pixel sensor at 1x, so p_obj = 0.00345 mm/px and the field is 8.45 × 7.07 mm. That field holds the thread shank but not the 10 mm diameter, which is why the diameter line below runs at 0.5x. The lens for this station:
- Sensor format
- 2/3"
- Mount
- C-mount
- Image circle
- 8-11 mm
- Type
- Object-side telecentric
Five crests land at rows 212.3, 647.1, 1082.0, 1516.9 and 1951.6. The four intervals read 434.8, 434.9, 434.9 and 434.7 px, and the total span is 1951.6 − 212.3 = 1739.3 px, so pitch = (1739.3 / 4) × 0.00345 mm/px = 434.8 × 0.00345 = 1.5001 mm — within 0.2 µm of the 1.5 mm nominal.
Diameter: at 0.5x the same sensor reads 0.0069 mm/px, and the widest crest-to-crest span measures 1439 px. Major diameter = 1439 × 0.0069 = 9.93 mm, inside the 9.732–9.968 mm window of a 6g M10×1.5 external thread.
Flank angle: the least-squares fit over the right-hand flank returns a = dx/dy = 1.732, so θ = atan(1/1.732) = 30.00° and the included angle is 60.0°, exactly the ISO metric value. Statistical noise with ±0.1 px edge positions sits orders of magnitude below this; the real limits are edge symmetry and crest condition, so set the working accuracy at about ±0.1° after the gauge check below.
Pitch diameter is not directly visible in a silhouette, but the basic ISO relation d2 = d − 0.6495·P gives 10 − 0.6495 × 1.5 = 9.03 mm for a standard-depth thread — a sanity figure, not a pass/fail gauge, because tolerance classes move d2 independently of d.
Checks before you trust a number
- Gauge artefact. Run the whole pipeline on a certified thread plug or a known-good bolt at every shift start. Pitch must return 1.500 mm and the angle 60.0° within your stated tolerances.
- Residual tilt. Refit the axis after rotation. A leftover tilt α inflates the width by 1/cos(α): 0.5° adds 0.4 µm on a 10 mm diameter, 2° adds 6 µm — hold the residual under half a degree.
- Depth of field. The measuring plane is the crest cylinder; the flanks fall behind it. A geometric estimate with blur allowed to 2 object pixels gives ±2·F#·p_obj each side of focus — ±55 µm at F8 for this 1x gauge. Both ends of that trade are covered in aperture, f-number and depth of field in machine vision cameras and in telecentric depth of field: validate measurement accuracy.
- Threshold stability. The 50% threshold must sit on the same edge position forever: fixed exposure, fixed strobe energy, and a backlight driver with feedback rather than drifting open-loop current.
- Crest condition. Rolled threads carry rounded crests and cut threads carry burrs; both bias the major diameter low. Compare against the class limits and a master part, not against nominal.
When the silhouette method is the wrong tool
- Internal threads. A nut or tapped hole hides its crests from any side view. Inside a bore, switch to the dedicated optics in 360° inspection lenses for inside-bore defect checks.
- A whole bolt in one frame. The LS-TCL-1422 takes a bolt plus head into a single frame at 0.166x magnification with a 258 mm working distance. At 0.166x a 3.45 µm pixel becomes 20.8 µm on the part, so the frame spans about 51 mm — a bolt up to 40 mm long fits with headroom, and a 1.5 mm pitch covers just 72 pixels: fine for sorting pitch and diameter to about ±0.05 mm, too coarse to gauge the flank angle.
- Ambient light. An unshrouded cell next to a window floods the silhouette. A red or infrared backlight behind a matching bandpass filter rejects it; the pairing is built out in bandpass filter with red LED light to block ambient light, and an 850 nm infrared backlight reads through thin oil films that would glare in visible light.
- Vibration. A conveyor or robot-mounted station needs a strobed backlight with a trigger input — freeze the bolt, then expose.
- Surface damage. A silhouette cannot see a nick on a crest face or thread chatter. When the defect lives on the surface rather than the outline, front lighting takes over; telecentric illumination: measuring round shiny parts accurately shows the front-lit gauge for shiny cylinders.
- Other thread forms. The same five steps run unchanged on unified or Acme screws; only the constants move — 60° becomes 29° included on Acme, and the flank fit returns 14.5° per side. The Acme thread flank angle inspection methods walkthrough covers the drive-screw case.
Before you order
- Telecentric lens, 0.5x–1x, image circle at or above your sensor. The 2/3" class used here keeps size and cost down; browse the machine vision lenses or go straight to the lens finder.
- Collimated backlight sized to the bolt. A 120 × 120 mm lit area takes any M10 up to roughly 100 mm long; compare panels in the light finder.
- Camera with small pixels and global shutter. 3.45 µm-class pixels at 5 MP give the fields in the table; global shutter, because a moving bolt must not skew.
- Mechanics that seat the bolt the same way every time. A V-block plus an axial stop keeps the crest cylinder inside the telecentric depth range and the axis repeatable to a fraction of a degree.
- Scale artefact. A stage micrometer with 0.01 mm divisions, or two gauge blocks a known distance apart, for the one-time calibration.
- Locked optics. Focus and iris fixed and marked after calibration; no auto-exposure on the camera.
- Shroud and filter when ambient exists. Any enclosing shroud plus a bandpass filter keeps the 50% threshold where you calibrated it.
- The gauge check in software. Ship the pipeline with the assert against a known bolt — if the artefact moves, the station tells you before the parts do.
For a full station, start at the lens configurator and the light configurator; free expert support comes with every order, and the team will check your magnification and lighting choices against your drawing before anything ships. More applied measurement walkthroughs sit on the applications topic page, or contact us with a drawing and the tolerance you must hold.
Questions
How many pixels do I need per thread pitch?
Aim for at least 100 pixels between crests, and 200 or more when the pitch tolerance is tighter than ±0.01 mm. At 1x with 3.45 µm pixels an M10×1.5 thread spans 435 pixels per pitch; even 0.5x keeps 217. Below about 50 pixels per pitch, a ±0.1 to 0.2 pixel peak-position error becomes several microns of pitch error and the flank segments get too short for a stable angle fit.
Can I use a normal C-mount lens instead of a telecentric?
For pitch alone, often yes: pitch is a spacing ratio, so small scale drift cancels between adjacent crests. Diameter inherits the full scale error — for a 50 mm lens focused at 110 mm, a 1 mm depth shift changes magnification by 1.7%, moving a 10 mm reading by 0.17 mm. A telecentric lens holds scale across its depth range and removes that term entirely.
What backlight colour works best on steel bolts?
Blue or green light gives the crispest edge because diffraction spread at the silhouette scales with wavelength. Red suits cells with ambient light, since a matching bandpass filter restores contrast, and an 850 nm infrared backlight reads through thin oil films that would glare in visible light. Whichever colour you pick, keep it collimated and strobed, and mask the panel so stray light cannot bounce off the fixture.
Does the method work on rolled threads and fine pitches like M10×1?
Yes, with one caution per case. Rolled threads have rounded crests, so pitch and flank angle stay accurate while the major diameter reads a few microns low — gauge it against a rolled-thread master rather than a cut-thread class limit. An M10×1 fine pitch at 0.5x still spans 145 pixels per pitch, enough for pitch and diameter; move to 1x before you trust the flank angle.
How repeatable is a camera thread gauge next to a plug gauge?
With a seated part, strobed backlight and the shift-start gauge check, crest-to-crest pitch repeats to roughly ±0.002 mm and major diameter to about ±0.005 mm, with flank angle inside ±0.1°. Absolute accuracy tracks your calibration artefact, so a stage-micrometer scale check is what turns that repeatability into a quoted accuracy of about ±0.01 mm on the 10 mm diameter.

