Cameras & sensorsGuide

Choosing a camera for real time marker tracking

Size a camera for real time marker tracking from your control loop: pixel scale, exposure and frame rate, with a 500 mm/s worked example and bandwidth checks.

LumaSpec Vision12 min gelezen Delen op LinkedIn

Op deze pagina 11 secties
  1. 01The decision, up front
  2. 02The three numbers that size the camera
    1. Pixel scale from position resolution
    2. Exposure from marker speed
    3. Frame rate from the controller tick
  3. 03Worked example: a 500 mm/s marker tracked at 200 fps with 0.1 mm resolution
  4. 04Why the webcam was the wrong instrument
  5. 05Freeze the marker with a strobed light pulse
  6. 06GigE or USB3: add up the stream
  7. 07Pick the lens from the field of view
  8. 08Cameras that fit this profile
  9. 09When the usual answer is wrong
  10. 10Checklist before you order
  11. 11Questions

A webcam reporting marker position into a real-time control loop fails in a specific way: frames arrive too slowly, blurred and late, and no tuning fixes an instrument never built for closed-loop feedback. This guide sizes the replacement from your loop rather than from a spec sheet. You will compute the pixel scale your position resolution demands, the exposure your marker speed allows, the frame rate your controller tick needs and the bandwidth the stream adds up to, then choose camera class, interface and lighting for your own case. A worked example runs a 500 mm/s marker at 200 fps end to end.

The decision, up front

Buy a global-shutter industrial camera with a hardware trigger, run it at or above the controller tick rate, and light the marker with a strobed pulse. For the common research case — one marker, a 100 mm field, 200 fps — the decision lands like this:

  • A 2-3 MP global-shutter camera on GigE, streaming only a region of interest around the marker, carries 200 fps with about 1.9x headroom.
  • Full 1280 x 960 frames at 200 fps need USB3. The same frames at 500 fps do not fit USB3 either: you are into ROI, binning or a 10GigE upgrade.
  • Exposure caps near 0.15 ms for a 500 mm/s marker at 0.078 mm per pixel; a 100 µs strobe pulse beats that without touching the exposure setting.

Browse area scan cameras filtered for global shutter and your interface, or start in the camera configurator and work forward from the sensor.

The three numbers that size the camera

Three calculations settle the choice. Mount, housing and brand follow from them, not before.

Pixel scale from position resolution

pixel scale (mm/px) = field of view (mm) ÷ sensor width (pixels)

If the loop must resolve 0.1 mm of marker motion, every pixel must span 0.1 mm or less. A 1280-pixel-wide sensor therefore limits the field of view to 1280 × 0.1 = 128 mm. A wider field dilutes the resolution; a smaller one spends margin you may want for travel.

Exposure from marker speed

max exposure (s) = blur budget (px) × pixel scale (mm/px) ÷ marker speed (mm/s)

Budget one pixel of blur unless the tracker centroids on a multi-pixel blob, in which case keep the blur a fraction of a pixel. This ceiling is what separates an industrial camera from a webcam: auto exposure will happily hold the frame open 20 ms while the marker crosses 10 mm. The maximum exposure time calculation to keep blur under control works the same budget for conveyor speeds.

Frame rate from the controller tick

Sample at least once per tick and process in parallel, so each tick reads the freshest position. Every frame is also up to one frame period old on arrival: at 200 fps that is 5 ms before exposure, readout, transfer and your centroid fit. Budget the whole chain as the image based control latency budget for the full feedback loop sets out, including how interpolated positions feed the servo loop between camera samples.

Worked example: a 500 mm/s marker tracked at 200 fps with 0.1 mm resolution

Inputs. Marker speed 500 mm/s and 0.1 mm resolution are the rig case this article sizes — substitute your own stage numbers. The 1280 x 960 sensor at 8-bit mono and the 200 fps target define the camera class. The lens check assumes a 1/1.8-inch sensor, about 7.2 mm wide, at a 300 mm working distance.

Rule 1, pixel scale. 1280 px × 0.1 mm/px = 128 mm is the widest field that still meets 0.1 mm. Choose a 100 mm field for margin: 100 mm ÷ 1280 px = 0.078 mm per pixel, 22% under the limit.

Rule 2, exposure. Max exposure = blur budget ÷ speed = 0.078 mm ÷ 500 mm/s = 0.000156 s. Set 0.15 ms. The smear is then 500 mm/s × 0.00015 s = 0.075 mm, just under one pixel. A tenth-of-a-pixel centroid target would need 0.0078 mm ÷ 500 mm/s ≈ 16 µs — impractical as a free-running exposure, which is why the strobe section exists.

Rule 3, inter-frame motion. At 200 fps a frame lands every 5 ms. The marker covers 500 mm/s × 0.005 s = 2.5 mm between frames, which is 2.5 ÷ 0.078 ≈ 32 pixels. The tracker must search ±32 pixels around its prediction; at 500 fps the window halves to ±16.

Bandwidth. Full frame: 1280 × 960 px × 1 byte = 1.23 MB per frame; × 200 fps = 246 MB/s, about 2.0 Gbit/s. GigE delivers roughly 118 MB/s usable, so full frames do not fit. A 640 x 480 ROI is 0.31 MB per frame; × 200 fps = 61 MB/s, about 0.5 Gbit/s — GigE carries it with 118 ÷ 61 ≈ 1.9x headroom.

Quantity Result Arithmetic
Field of view 100 mm under the 1280 × 0.1 = 128 mm limit
Pixel scale 0.078 mm/px 100 ÷ 1280
Exposure cap 0.15 ms 0.078 ÷ 500
Motion per frame 32 px 500 × 0.005 ÷ 0.078
Full-frame stream 246 MB/s 1.23 MB × 200
ROI 640 x 480 stream 61 MB/s 0.31 MB × 200

Decision. One marker at 200 fps: a GigE global-shutter camera, a 640 x 480 ROI tracking the marker, exposure 0.15 ms, 100 µs strobe. Full frames at 200 fps: USB3, which sustains about 400 MB/s — 400 ÷ 1.23 ≈ 325 fps of full 1280 x 960, so 200 fps fits and 500 fps (615 MB/s) does not. Beyond about 325 fps full-frame you are choosing 10GigE or CoaXPress, binning, or a smaller ROI.

Why the webcam was the wrong instrument

Four webcam behaviors break the loop, and three of them are permanent settings on an industrial camera.

  1. Auto exposure. Indoors a webcam holds the frame open 10-30 ms; at 500 mm/s that smears the marker 5-15 mm, or 64-192 pixels at 0.078 mm/px. The maximum auto exposure cap is the surgical fix; switching every auto mode off is the policy when brightness drifts frame to frame.
  2. Variable latency. Buffered transfer and auto modes add milliseconds of jitter the controller cannot predict. Position feedback with unknown delay destabilizes gains you tuned on the bench.
  3. Rolling shutter. Webcam sensors read out line by line, so a marker moving during readout smears even with a short exposure. Settle global vs rolling shutter for moving targets first: pick global.
  4. No hardware trigger. Without a trigger input you cannot pin the exposure instant to the controller tick, so the timing information is lost before the frame leaves the camera.

Freeze the marker with a strobed light pulse

The strobe moves the blur budget from the camera to the light: the image is sharp for the duration of the pulse, whatever the exposure setting reads. Apply the same arithmetic to pulse width. At 500 mm/s, a 100 µs pulse smears the marker 500 × 0.0001 = 0.05 mm, which is 0.05 ÷ 0.078 ≈ 0.6 pixel — sharper than the 0.15 ms exposure allows, at no cost in loop time.

Set the camera exposure comfortably longer than the pulse and let the pulse set the sharpness. Drive everything from one clock: the controller tick pulses the camera trigger, one exposure per tick, and the camera's strobe or exposure-active output fires the light inside the exposure window. Two details decide whether this works. Expose on the rising edge with a fixed exposure time, not in a mode where the pulse width gates the exposure — otherwise the tick width becomes the exposure time, the trigger pulse width vs exposure time trap. And phase the strobe inside the exposure window, not at frame start; the camera strobe output timing and timestamp behavior matters when you timestamp positions.

Keep the pulse energy constant so blob brightness does not wander between frames; closed-loop lighting control for repeatable vision images exists for exactly that. If the control board has no spare pulse output, the frame grabber pulse train trick for camera triggers generates one in software. Match the light color to the marker — a red marker wants red LEDs — and pick from the light controllers with a strobe feature via the light controller finder.

Any strobe-capable controller drives the light. The LS-CTL-0070 is a 4-channel digital control box rated 200 W with RS232 and a strobe feature for 24 V lights.

Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
Feature
Strobe
$549.00View partBuild a system with it

GigE or USB3: add up the stream

The stream rate decides the interface before any other feature does. Divide usable link rate by per-frame size:

Interface Usable rate 1280 x 960, 8-bit 640 x 480 ROI
GigE about 118 MB/s 96 fps 384 fps
USB3 about 400 MB/s 325 fps 1300 fps
10GigE about 1150 MB/s 935 fps link not the limit

The usable rates assume a healthy host; the last 10% belongs to the NIC, driver and packet size, and a link that quietly drops to 100 Mbit/s triggers a packet size error on GigE cameras. The table is link capacity, not sensor speed: on a hardware trigger the frame period is exposure plus readout, so the maximum frame rate on a hardware trigger is the real ceiling. Linux hosts also ship with a small USB buffer allocation that throttles USB3 streams; the usbfs memory and exposure fix is a one-line change.

Cable reach matters in a lab. GigE runs 100 m on one cable; USB3 tops out near 3-5 m passive. Two cameras? Two 640 x 480 ROIs at 200 fps sum to 122 MB/s against roughly 118 MB/s usable on one GigE port — crowded. Add a second NIC or put the second camera on USB3.

Pick the lens from the field of view

m = sensor width ÷ field of view f = WD × m ÷ (1 + m)

At the worked example numbers: sensor 7.2 mm wide, field 100 mm, so m = 7.2 ÷ 100 = 0.072. At a 300 mm working distance, f = 300 × 0.072 ÷ 1.072 ≈ 20 mm. Stock focal lengths bracket that. A 25 mm lens at 300 mm gives m = 25 ÷ 275 = 0.091, a 79 mm field at 0.062 mm/px — resolution margin. A 16 mm lens gives 7.2 × (300 − 16) ÷ 16 ≈ 128 mm at 0.100 mm/px — the exact limit, which suits a stage confined to that travel.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Pixels only stay sharp if the lens resolves them; the Nyquist budget method for matching lens resolution to pixel size sets that check out. Compute your own focal length in the lens focal length calculator, then browse lenses by mount and image circle in the lens finder.

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

The LS-FFL-0567 covers the 16 mm case: a 16 mm F2.8-22 C-mount lens rated for 20 MP with under 0.3% distortion, made for 1.1-inch sensors.

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"
Mount
C-mount
Resolution
16-25 MP
$679.00View partBuild a system with it

Cameras that fit this profile

Filter the camera finder on global shutter, your interface, and 2-3 MP for the ROI path or 12 MP for full frames, then confirm in the datasheet that the ROI holds the full frame rate. Two catalog cameras bracket the decision.

For the GigE ROI path, the MV-CU020-90GC pairs a 1/1.7-inch global-shutter sensor with GigE, C-mount and color in a 2.5 MP camera.

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
Up to 3 MP
$309.00View partBuild a system with it

For the USB3 full-frame path, the MV-CH120-11UC is a 12 MP global-shutter USB3 camera on a 1.1-inch sensor with C-mount, built as a high-speed version.

Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
Interface
USB3
Resolution
12 MP
$2,339.00 · quotedView and quoteBuild a system with it

When the usual answer is wrong

  • Under about 10 mm/s of marker speed with a loop at 30 Hz or slower, the webcam stays. Blur at a 10 ms auto exposure is 10 × 10 = 0.1 mm, and 33 ms of staleness may sit inside the tolerance. Spend nothing.
  • Markers at 2000 mm/s and up make the strobe mandatory and the exposure setting irrelevant. The pulse width is the real exposure, and the light's rise and fall times join the budget.
  • Several markers in one wide field scale the pixel count linearly: 200 mm of field at 0.078 mm/px needs 200 ÷ 0.078 ≈ 2560 pixels across — a 5 MP sensor or two cameras.
  • Measuring size or edge position rather than a blob center adds distance-drift error to the budget; telecentric lenses remove it.

Checklist before you order

  • Global shutter, confirmed in the camera specification — rolling shutters smear moving markers even with a clean trigger.
  • Hardware trigger input and a strobe or exposure-active output — one exposure per tick without extra boxes.
  • ROI sustained at the full frame rate — some sensors only region-read at reduced speed.
  • Minimum exposure at least ten times under the blur cap — headroom for strobe-synced modes.
  • Stream total checked against the interface table — including a second camera if the rig grows.
  • Lens image circle covering the sensor, with the focal length arithmetic done at the real working distance.
  • Every auto mode — exposure, gain, white balance — switched off; a marker that changes brightness between frames breaks thresholds and calibration alike.

Send us the loop numbers — speed, resolution, tick rate — through the contact page, and we will come back with camera, lens and strobe as one specification.

Vragen

Is 1280x960 really enough resolution for a tracking marker?

For a single marker, usually yes. Position resolution is field of view divided by sensor width: a 100 mm field over 1280 pixels spans 0.078 mm per pixel, and a centroid fit on a blob 5-10 pixels across lands finer than that. More pixels matter when several markers share one wide field, or when you also measure size.

Can I keep the webcam and just add more light?

More light does not fix the two real problems. Auto exposure holds the frame open 10-30 ms indoors, smearing a 500 mm/s marker by 5-15 mm, and the buffered stream adds latency the controller cannot predict. Below about 10 mm/s of marker speed with a 30 Hz loop, though, the webcam is genuinely fine.

What frame rate does the control loop actually need?

At least one frame per controller tick, with processing in parallel so each tick reads a fresh position. Budget the age of the data too: at 200 fps a frame is 5 ms old on arrival, plus exposure, readout, transfer and your centroid fit — often 6-10 ms total before the controller acts.

Do I need a color camera for a colored marker?

Not necessarily. A color sensor puts a Bayer mask over the pixels, so spatial resolution drops below the megapixel figure. A mono sensor watching a red LED-lit marker through a matched bandpass filter returns a brighter, cleaner blob and rejects room light. Color earns its place only when you tell markers apart by hue.

How short should the strobe pulse be?

Apply the blur budget to the pulse: pulse width × marker speed must stay inside the blur budget. At 500 mm/s and 0.078 mm per pixel, a 100 µs pulse moves the image 0.05 mm, about 0.6 pixel. Also check the light's rise time and the controller's minimum pulse width — a 10 µs setting on a light that turns on in 30 µs is really 30 µs.

Two cameras on one PC: does the bandwidth still work?

Two 640 x 480 ROIs at 200 fps draw about 122 MB/s combined, which crowds a single GigE port at roughly 118 MB/s usable. Give each camera its own NIC, or run the second camera on USB3. Full-frame pairs exceed one USB3 controller as well: 2 × 246 MB/s is past the roughly 400 MB/s a host controller sustains.