System designHow-to

Set a coordinate system to a circle center and track moving parts

Set a coordinate system to a circle-center fit and re-anchor every ROI on a moving conveyor: lens math, exposure limits, glare-free lighting, go-live checks.

LumaSpec Vision10 min read Share on LinkedIn

On this page 9 sections
  1. 01Why does a fixed ROI fail once the part moves on the conveyor?
  2. 02Which feature should anchor the coordinate system?
  3. 03How do you locate the circular edge and fit the center?
  4. 04How do you re-anchor the downstream ROIs to the fitted center?
  5. 05How do you size the camera and lens for the shift you must absorb?
  6. 06Which light keeps the seal-ring edge glare-free on a shiny part?
  7. 07How fast can the line run before blur and rolling shutter bite?
  8. 08How do you prove the fixture holds before it runs unattended?
  9. 09Questions

A circular part that wanders on a conveyor defeats any ROI you taught on a bench sample: the hole-count window lands on bare metal, the intensity check averages the wrong area, and good parts start failing. The fix is a fixtured coordinate system anchored to the part itself. You fit an edge-based circle to the black seal ring, write the fitted center into the fixture, and every downstream ROI follows the part. The steps below give the locating sequence, the pixel-size, focal-length and exposure arithmetic for a ±15 mm conveyor wander, the lighting that keeps the edge glare-free on a shiny part, and the shift tests that prove the fixture before the line runs unattended.

Why does a fixed ROI fail once the part moves on the conveyor?

A taught ROI is fixed in image coordinates, while the part lives in conveyor coordinates: at 0.025 mm per pixel, a 15 mm wander pushes the part 600 px sideways, so your hole-count window ends up reading bare metal instead of holes.

Every downstream step inherits the error: hole windows slide off the holes, the intensity ROI averages cap instead of seal, and rejects climb for good parts. Two ways out. Fixture the part mechanically, with stops or a nest that pins it to within a pixel or two, or fixture it in software by locating an anchor feature on the part and hanging every ROI off that anchor. The software route is cheaper when the wander is modest and the lighting is controlled, and it is what the steps below build. A milling fixture does the same job in metal, holding the workpiece in the machine's coordinate system so the programmed path meets the right surface; a vision fixture does it in pixels.

Which feature should anchor the coordinate system?

Anchor on the black seal ring: it is a molded-in 360° edge with strong dark-to-bright contrast, and a circle fit over 36 caliper points averages the edge noise down to roughly 1-2 µm of center repeatability, against about 0.3 px for any single point.

A circle is rotation-invariant, so the fit needs no angle, tolerates the part spinning a few degrees on the belt, and costs one edge operation instead of a full pattern match. The price: a circle fit returns x and y only, never an angle. If the hole pattern is asymmetrical around the ring, add one rotation feature — a notch, a keyway or the largest hole. The fit also needs contrast. A black seal on bright metal gives the calipers a clean transition; a seal and cap of similar grey push you back to a trained template, the case covered in the edge-based pattern matching guide.

How do you locate the circular edge and fit the center?

Search an annulus around the taught position, fire 36 radial calipers through the ring edge, interpolate every crossing to subpixel, then least-squares fit a circle, drop outliers and write the surviving center into the fixture.

For the worked part sized below, the seal ring is Ø52 mm across and the pixel size lands at 0.025 mm/px, so the taught radius is 26 / 0.025 = 1,040 px. The steps:

  1. Teach on a good part at the nominal position: record the center and the 1,040 px ring radius.
  2. Set the annular search region from 400 to 1,700 px: nominal radius plus the ±600 px wander and margin.
  3. Place 36 calipers evenly around the circle, each searching 24 px along the radius with fixed polarity, bright metal into dark ring.
  4. Interpolate every edge crossing to subpixel and least-squares fit a circle through the points.
  5. Drop any point with a residual over 2 px, refit, and accept only when at least 30 of 36 points survive and span at least 270° of arc.
  6. Write the fitted center as the fixture origin; every downstream ROI re-anchors to it in the same frame update.

How do you re-anchor the downstream ROIs to the fitted center?

Group every hole-count window, intensity ROI and later check as offsets from the taught center inside one fixture; at run time the vision code adds the fitted center to each offset, so a 600 px part shift carries all ROIs with it automatically.

Store each hole window at its taught offset and let the fixture apply the translation at capture time. Rotation comes from the second feature: a caliper on the notch at the 1,040 px ring radius turns a 0.3 px edge error into about 0.02° of angle error, so a 200 × 200 px window never slips off a Ø4 mm hole, which spans 160 px at this pixel size. Intensity checks ride the same fixture; grade them against a reference ROI on a fixed white patch in the corner of the field so lamp ageing shows up before seals fade. The reference method is set out in the light intensity ROI guide.

How do you size the camera and lens for the shift you must absorb?

Field of view equals part diameter plus twice the wander plus margin: a Ø60 mm cap with ±15 mm wander needs 100 mm, which at 0.025 mm per pixel takes 4,000 pixels and a 12 mm lens at 174 mm working distance.

FOV = part diameter + 2 × wander + margin pixels = FOV / pixel size m = sensor width / FOV f = WD × m / (1 + m)

Worked through for this station:

  • FOV = 60 + 2 × 15 + 10 = 100 mm.
  • Pixels at a 0.025 mm/px target: 100 / 0.025 = 4,000 px across — the 12 MP, 4000 × 3000 class.
  • Sensor width about 7.4 mm: m = 7.4 / 100 = 0.074. Holding the working distance near 150 mm gives f = 150 × 0.074 / 1.074 = 10.3 mm, so take the nearest standard focal length: 12 mm.
  • Solve the working distance back for the 12 mm lens: WD = 12 × 1.074 / 0.074 = 174 mm. Check: m = 12 / (174 − 12) = 0.074, and the field returns to 7.4 / 0.074 ≈ 100 mm.

One 12 MP USB3 body that covers this field:

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

Recompute the pixel budget for your own part with the calculator below, then let the camera finder filter area scan models down to that pixel count.

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

Which light keeps the seal-ring edge glare-free on a shiny part?

Use a diffuse dome: it returns light from every direction, so the polished cap renders evenly bright while the black seal stays dark, and the calipers find one clean edge instead of the glare band a ring light paints across a shiny surface.

A ring light acts as a small mirror: its LED ring bounces off the polished cap straight into the lens, half the calipers interpolate the reflection instead of the seal edge, and the fitted center biases toward the lit side. A dome removes the mirror. Size it by one rule: emitting area at least the field of view. Set the throat 30-50 mm above the part, and if the image rim darkens, pull back 10 mm. The dome lights category runs from small emitters to fields well past 100 mm, and the dome lights guide covers curved and wrinkled parts too.

The LS-DOM-0085 is a Ø166 mm dome light with a Ø116 mm emitting area. A Ø116 mm emitting area clears the 100 mm field with 8 mm of margin all round. For a larger cap, the LS-DOM-0062 is a 3.0 dome light with a 194 mm outer diameter.

Dome lightsØ166 mm dome light, Ø116 mm emitting area (LS-DOM-0085)LS-DOM-0085
Size
100-200 mm
Voltage
24 V
from $409.00View part
Dome lights3.0 dome light, outer diameter 194 mm (LS-DOM-0062)LS-DOM-0062
Size
100-200 mm
Voltage
24 V
$819.00View part
Bar lightsBar light, 372 x 28 mm, White (LS-BAR-1276)LS-BAR-1276
Size
200-400 mm
Type
Diffused
$439.00View part

For a station with a low roofline, a wide diffused bar light laid across each side of the conveyor gives most of the same softness: the LS-BAR-1276 is a 372 × 28 mm white diffused bar. If faint glare stripes survive, add cross-polarization — a polarizer on the lens and one on the light costs one to two stops of brightness and removes specular glare outright, as shown in the shiny metal pins guide.

How fast can the line run before blur and rolling shutter bite?

Cap the exposure at half a pixel of travel: at 0.025 mm per pixel that is 0.0125 mm, so a belt at 150 mm/s leaves you 83 µs, and continuous motion also demands a global shutter unless each part stops under the camera.

t_max = 0.5 × pixel size / belt speed

Arithmetic: 0.5 × 0.025 mm = 0.0125 mm of allowed blur, and 0.0125 / 150 = 0.000083 s, so set 80 µs. At that exposure, 50 Hz plant fluorescents pulsing at 100 Hz band the image, so hood the station or run dark — the flicker guide shows the test. Shutter is the second constraint: at 30 fps the frame period is 1/30 = 33 ms, a rolling shutter spends close to that reading out, and a part at 150 mm/s skews by roughly 150 × 0.033 = 5 mm inside one frame — enough to bend the ring into an ellipse the fit will notice.

  • Stop-and-shoot: the conveyor indexes, the part halts, trigger, release. Shutter type stops mattering, the exposure can stretch to 2-5 ms for better signal, and the cycle settles at one part per index.
  • Continuous belt: keep the 80 µs exposure and shortlist global shutter models in the area scan cameras finder. If the belt cannot pause, the conveyor tracking guide shows how vision hands the part position downstream without a hardware sync switch.

How do you prove the fixture holds before it runs unattended?

Take a good part and move it deliberately across the whole wander — 15 mm left, right, up and down, plus 5° of rotation — and require the fitted center to track within 120 px, at least 30 calipers to survive and the hole count to stay correct at every pose.

Bench tests, in this order:

  • Repeatability: run 20 good parts at the nominal position; fitted centers must agree within 1 px, which is 0.025 mm here. A wider spread points at glare or lamp ripple, not at the fit.
  • Shift: slide one part ±15 mm in x and y. At every pose the hole count stays correct and the center error stays under 120 px (3 mm at this pixel size).
  • Rotation: turn the part ±5° and confirm the hole windows follow the notch angle within 0.1°.
  • Fail path: feed a part with no seal ring. The fixture must reject — fewer than 30 caliper points or less than 270° of arc — and must never fall back to the taught center, which would pass a missing part.
  • Ambient: repeat the shift test with plant lights on and off; banding at an 80 µs exposure shows up immediately.

Three mistakes account for most failed fixtures: a glossy belt that injects edges into the annulus (matte it), a ring light whose glare biases the center (move to the dome), and a fit-fail fallback to the taught position (reject instead).

Once the tests pass, the fixture holds for the line: pick the dome or bar in the light finder, match the driver with the configurator, and if you want the annulus and exposure numbers checked against your own part, contact us. More set-up walkthroughs sit on the systems topic page.

Questions

Do I still need pattern matching if I fit a circle to the seal ring?

Not for a part with a full, clean ring: the fit returns position in one edge operation and ignores rotation by construction. Pattern matching earns its keep when the ring is interrupted, the background carries other circular edges, or you need part orientation from the same locate step — then a template trained on the notch is the stronger anchor.

What happens if the part wanders so far that the image clips part of the ring?

The fit stays valid down to about half the circle visible; below that the center drifts along the clipped direction. Prefer a field that keeps the whole ring in view at worst-case wander. If clipping is unavoidable, keep the arc-coverage check and reject any part whose surviving calipers span less than 270°.

Why does the fitted center jump two or three pixels between identical parts?

Glare is the usual cause: calipers on the lit side interpolate the reflection instead of the seal edge, and the circle tilts toward the missing points. Map the residuals by angle — failures clustered in one quadrant mean lighting, not software. A dome or a polarizer pair usually clears it.

Can I run this locate on a color camera?

Yes, but convert to grayscale before the edge search: the fit needs only the dark-to-bright transition, and mono conversion avoids color-dependent edge positions. A mono sensor also generally gives a better signal-to-noise ratio at the same exposure, which matters most at an 80 µs continuous-motion exposure.