ApplicationsApplication note

Snap ring gap measurement with machine vision

How to verify the minimum gap between a snap ring's two ends with a camera: resolution math, lighting for round steel parts, and a pass/fail edge workflow.

LumaSpec Vision10 min read Share on LinkedIn

On this page 9 sections
  1. 01The measurement and the numbers that drive it
  2. 02Choosing the camera
  3. 03Choosing the lens
  4. 04Lighting and background
  5. 05The measurement workflow
  6. 06Validating before you trust it
  7. 07When the usual answer is wrong
  8. 08Ordering checklist
  9. 09Questions

A snap ring that is installed but has too small a gap between its two ends may not seat fully in its groove, and a washer it is meant to retain can walk out. Inspecting that gap by eye is unreliable at line rates, but it is a well-suited machine vision task: the feature is a pair of edges a known distance apart on an otherwise round part. This application guide works through the numbers that drive the hardware choice — pixels across the gap, field of view, lens focal length — the lighting and background that make the gap visible on steel, and a pass/fail workflow you can validate with master rings. For a broader treatment of pixel budgets, see choosing camera resolution for dimensional inspection.

The measurement and the numbers that drive it

Define the inspection precisely before picking hardware:

  • The minimum allowed gap, say 1.0 mm, and the tolerance band around it (for example pass at 1.0 mm and above, reject below).
  • The ring's outer diameter, which sets the minimum field of view plus margin for part placement.
  • How many rings are inspected per part and per hour, which sets whether one camera sees them all or each ring gets its own station.

The rule of thumb for an edge-to-edge distance is that the smallest feature you must reliably judge should span at least 4-5 pixels. For a 1.0 mm minimum gap that means a pixel size on the part of 0.2 mm or smaller. Edge detectors locate an edge to roughly a quarter pixel, so with 5 pixels across the gap your measurement noise is on the order of a tenth of a pixel — a few hundredths of a millimetre — leaving plenty of margin for a 1.0 mm threshold.

pixel_size = field_of_view / sensor_pixels pixels_across_gap = min_gap / pixel_size gap_pixels >= 5 (design target)

For a ring 25 mm in outside diameter, allow a field of view of about 40 mm to tolerate placement variation. With a 12 MP sensor of 4000 x 3000 pixels, the pixel size is 40 mm / 4000 = 0.01 mm, so a 1.0 mm gap spans 100 pixels. That is far more resolution than the rule requires — which is good news, because it means a modest sensor suffices and you can trade resolution for speed or a wider field of view covering several rings at once. The camera resolution calculator runs this arithmetic for your own numbers.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Choosing the camera

Because the part is static or briefly presented, a standard area scan camera with global or rolling shutter works; you only need to freeze motion if the ring passes the camera while moving, in which case follow the blur math in sorting conveyor camera selection. Monochrome is the right default: you are measuring edges on metal, and a mono sensor uses every pixel for intensity instead of a Bayer pattern, which softens exactly the edges you want to find.

Two examples from our camera range show the spread. The LS-CMR-0166 is a 12 MP USB3 area scan camera with an IMX226 1/1.7" sensor, 30 fps and 4000 × 3000 resolution — generous pixels for one ring station. If you want one camera covering several rings across a product, the MV-CS200-10UM is a 20 MP area scan camera with a 1" IMX183 sensor on USB3.0 in mono.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

Choosing the lens

With the field of view and sensor fixed, the lens follows from the working distance. For the 12 MP camera's 1/1.7" sensor (about 6.3 x 4.7 mm) and a 40 mm horizontal field of view, the magnification is 6.3/40 ≈ 0.16x. At a 300 mm working distance, the thin-lens estimate gives f ≈ 300 × 0.16 / 1.16 ≈ 41 mm, so a 35 mm lens at a slightly longer distance, or a 50 mm lens closer in, lands in range. The machine vision lens focal length guide covers this trade-off.

The LS-FFL-0679 is a 35 mm, 2/3", 6 MP C-mount machine vision lens; for the 1/1.7" sensor you would instead pick a lens with a larger image circle such as the LS-FFL-0567, a 16 mm, 1.1", 20 MP C-mount lens with under 0.3% distortion — useful, because distortion directly biases a dimensional reading. Distortion matters more than sharpness here: a 0.3% distortion on a 40 mm field of view is up to 0.12 mm of displacement, which calibration must remove. The workflow in camera calibration for length measurement from image markers gives you pixels-per-millimetre from a known reference rather than from the lens datasheet.

Specification LS-FFL-0679 LS-FFL-0567
Format 2/3" 1.1"
Resolution 6.0 Megapixel (2.4 μm pixel size) 20 Megapixel
Focal length 35 mm 16 mm
Aperture F2.8 Manual iris F2.8-22
M.O.D. 0.2 m 0.1 m
Price $219.00 $679.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.

Lighting and background

A snap ring is round, hardened steel and often oil-filmed — the classic glare problem. What saves you is geometry: light arriving at a low angle relative to the ring's curved surfaces reflects away from the camera, while the gap and the bore or shaft behind it stay dark. That contrast is what makes the gap measurable.

Practical set-ups that work on round metal parts:

Technique Why it fits a snap ring Watch out for
Low-angle bar lights, one each side Grazing light darkens the gap, brightens the ring circumference Aim symmetrically or the two edges read differently
Dark-field ring light Surfaces angled to the camera go dark, edges scatter light Needs the right ring-to-part distance
Backlight through the bore Gap silhouettes cleanly if the bore is open Impossible when a shaft fills the centre
Diffuse dome Removes specular hot spots on polished rings Large dome needed; overkill for a simple gap

Our bar lights cover the first option in many lengths; for highly polished rings the dome light guide and the techniques in lighting shiny metal pins without glare go deeper. Colour choice is secondary on steel — white is standard, and red often gives the cleanest single-channel images, as discussed in which LED colour gives the best contrast in machine vision. The LS-BAR-1047 is a 290 x 30 mm LED bar light, a workable size for a single ring station at a few hundred millimetres working distance.

Background matters as much as the light. If the ring sits over a bright housing, the gap may be lighter than the ring itself, which is fine — but it must be consistent. Mask the analysis to an annulus around the ring so the rest of the product never enters the measurement.

Bar lights290 x 30 mm LED bar light (LS-BAR-1047)LS-BAR-1047
Size
200-400 mm
Type
Standard
Voltage
24 V
$449.00View partBuild a system with it

The measurement workflow

  1. Capture a static image with the light strobed or the part stopped; freeze motion to under a quarter pixel of blur.
  2. Locate the ring: fit a circle to the ring's outer or inner edge with a robust fit, so the gap search is anchored even if the part shifts.
  3. Along that fitted circle, sample intensity over a short angular span in 0.5-1° steps all the way around, building a 1D profile of ring versus gap.
  4. Find the two gap edges as the transitions in that profile, using a subpixel edge operator.
  5. Measure the gap as the angular distance between edges multiplied by the local radius, in calibrated millimetres per pixel.
  6. Compare against the minimum allowed gap with a margin set from measured repeatability, and log the value, not just the verdict.

The circular sampling approach is naturally immune to part rotation, and the circle-detection groundwork is covered in live feed circle detection with a circle Hough transform.

Validating before you trust it

Gather at least one known-good ring and, if you can make one, a ring with the gap set just below the minimum — a cut-and-filed scrap ring works. Capture 50-100 frames of each, then:

  • Compute the standard deviation of the gap reading; it should be well under a tenth of your tolerance.
  • Set the pass/fail threshold so the good ring's lowest reading and the bad ring's highest reading are separated by at least three standard deviations.
  • Re-run the two masters whenever anything changes: lens focus, light intensity, camera replacement. The per-frame checks in per-frame exposure and gain: verifying camera metadata catch exposure drift that silently moves edge positions.
  • Re-verify calibration pixels-per-millimetre with the master after any mechanical change to camera or lens.

When the usual answer is wrong

  • The ring is only visible at a steep angle. If the camera looks almost along the bore axis at a shallow angle to the ring face, the gap foreshortens and reads small. Correct for the cosine of the viewing angle, or better, remount the camera closer to perpendicular.
  • Several rings, one part, different planes. One camera can still work, but each ring needs its own calibration zone and depth of field; check coverage with the depth of field calculator, and see the trade-offs in one camera for multiple bins: resolution and coordination trade-offs for the same class of problem.
  • The gap is specular-bridged. Oil or a burr spanning the gap can join the two edges in the image. A brief solvent wipe on a sample tells you whether you need a second, higher-angle light to break the bridge.
  • The ring rotates during capture. The circular-sampling method is rotation-invariant, but only if the exposure is short enough that smear does not widen the apparent gap.

For a related industrial measurement problem on a different material, the techniques in measuring clear extruded polymer width with vision sensors show how the same edge-to-edge principle transfers to translucent parts.

Ordering checklist

  • Camera: mono area scan, pixels sized so the minimum gap spans at least 5 pixels; browse area scan cameras or the camera finder.
  • Lens: image circle matching the sensor, distortion below about 0.3%, focal length from the lens focal length calculator; see machine vision lenses.
  • Light: a pair of bar lights or a low-angle ring light, plus a controller that strobes them; start at the lighting configurator step.
  • Fixturing that presents the ring within the calibrated zone, and two master rings for validation.
  • A defined pass/fail threshold with documented margin, and a log of every measured gap.

To put the whole kit together in one pass, use the system configurator, or ask our team through the contact page to review your ring drawings and tolerance stack before you order.

Questions

How many pixels do I need across a snap ring gap?

Plan for at least 4 to 5 pixels across the smallest gap you must accept, not the nominal gap. If the minimum allowed gap is 1.0 mm, your pixel size on the part should be about 0.2 mm or smaller, and smaller is better because edge detection locates edges to roughly a quarter of a pixel. Fewer pixels makes the gap width noisy, so borderline rings bounce between pass and fail.

What lighting works best for a shiny round snap ring?

A ring or bar light arriving at a shallow angle works well: the round steel surfaces redirect most glare away from the camera while the gap and the bore behind it stay dark. Avoid a plain coaxial or direct on-axis light on curved polished steel, which saturates the surfaces around the gap. Test with the real part, washer and housing colour, since the background behind the gap matters as much as the ring itself.

Do I need a telecentric lens for this measurement?

Not necessarily. A snap ring lies nearly flat and the gap measurement is in-plane, so a standard fixed focal length lens with low distortion is usually enough once you calibrate pixels per millimetre with a master part. Telecentric helps when the ring position in depth varies or the tolerance is a small fraction of a percent of the field of view. For gap tolerances of 0.1-0.2 mm on a 50 mm field of view, a conventional lens is fine.

How do I validate the pass/fail threshold?

Measure ring masters: at least one known-good ring and, ideally, one ring whose gap sits just under the minimum. Capture many frames of each, record the measured gap distribution, and set the threshold with margin so the good ring's lowest readings and the reject ring's highest readings never overlap. Then check repeatability over days, including any change in part presentation and ambient light, before releasing the inspection.