DEV Community

Xinlong IoT
Xinlong IoT

Posted on Originally published at xinlongiot.com

Global Shutter vs. Rolling Shutter: Exposure and Barcode Motion

A barcode that reads perfectly on the bench starts failing the moment it moves through the machine. The captured image shows slanted edges, stretched modules or smeared bars — and the first instinct is to blame the decoder.

Usually it is not the decoder. It is the exposure window.

Global vs rolling shutter is one of the most misunderstood choices in embedded barcode scanning, because the shutter type tells you only how rows are exposed — not whether the code will read at your line speed. This guide separates the two failure modes, gives the arithmetic for motion during exposure, and ends with a test plan you can run on real samples.

1. Exposure and readout are separate operations

During exposure, each pixel collects light for a period of time. During readout, the captured signal is transferred out of the sensor. A camera can expose all pixels together and still read the data out row by row.

Keep three timings apart:

  • Exposure time — how long a pixel integrates light for one image.
  • Row timing and readout — when different rows capture the scene, and how the data leaves the sensor.
  • Frame period — the interval between frames; frame rate is its reciprocal.

A nominal 60 fps means a frame period of about 16.7 ms. It does not mean exposure lasts 16.7 ms. Exposure and readout may overlap depending on the sensor and mode. Confirm the supported timing for the actual module.

2. How the two shutters expose an image

Global shutter — a shared exposure window. Pixels across the image start and end exposure at approximately the same time; the signal is then held while rows are read out. Every row therefore represents a common time window, even though the data leaves sequentially. This reduces geometric distortion caused by rows capturing a moving object at different moments — but it does not freeze motion: the object can still move during that shared window.

Rolling shutter — windows shift row by row. Rows start and finish exposure at successive times. Each row may have the same exposure duration while its window is offset from the previous row's. A moving object sits in a different position when each row captures it.

In Figure 1, all four illustrated rows expose for 200 μs. The rolling-shutter rows start at 0, 50, 100 and 150 μs, so they end at 200, 250, 300 and 350 μs. The global-shutter rows all expose from 0 to 200 μs. These four rows explain the timing relationship — they are not sensor specs or frame-rate measurements.

Global shutter shared exposure window versus rolling shutter row-by-row offsets

Question Global shutter Rolling shutter
When do rows expose? Approximately the same window across the image Successive windows across the image
Can motion change geometry between rows? Row-timing distortion is reduced Yes; depends on motion direction, row timing, scene geometry
Can exposure cause motion blur? Yes Yes
What still needs testing? Exposure, lighting, focus, code image size, decoding The same, plus row timing on the moving target

3. Distortion and motion blur have different causes

Rolling shutter distortion appears when rows capture a moving scene at different times — a horizontally moving square can look slanted; other motion/scan-direction combinations stretch or compress the target. Shortening each row's exposure reduces blur but leaves the distortion caused by the offsets between rows.

Motion blur happens when the target moves during a pixel's exposure. A narrow bar or a QR edge spreads across the image and edge contrast drops. Both shutter types produce this blur, and a rolling-shutter image may contain distortion and blur together.

Rolling shutter skew versus exposure-related motion blur on the same synthetic target

When a read fails, look at the captured image if the module exposes one. Slanted or compressed geometry points to a timing effect; smeared edges point to exposure-related blur. Defocus, reflections and low resolution soften edges too, so a blurry image alone does not identify the cause.

4. Estimate how far the code moves during exposure

For approximately constant motion parallel to the target plane:

d ≈ v∥ × t_exp

where d is target-plane displacement, v∥ the target speed relative to the camera parallel to the target plane, and t_exp the exposure time. Use compatible units: 1 m/s = 1 mm/ms, so at that speed a 0.1 ms exposure corresponds to 0.1 mm of travel, 0.5 ms to 0.5 mm, 1 ms to 1 mm.

Target travel at 1 m/s for 0.1, 0.5 and 1 ms exposures

Those numbers are physical displacement at the target plane. To get image blur you need the imaging scale: blur in pixels ≈ displacement in mm × pixels per mm for a locally front-facing target (perspective, rotation or motion toward the camera need a fuller model).

If the target moves 0.1 mm and the local scale is 20 px/mm, the estimated image movement is 2 px. That is arithmetic, not a readable/unreadable threshold — the effect depends on module size in pixels, motion direction, contrast and decoding conditions. Compare the estimate against the smallest bars or modules along the direction of motion, then test the real sample.

5. Choose exposure together with illumination

A shorter exposure reduces motion during capture but collects less light. More gain brightens the image and makes noise more visible. Added illumination helps, though reflections from a glossy label, protective window or curved surface can eat the contrast you just bought.

Fix working distance, focus, code image size and lighting geometry before comparing shutter types, and record the exposure behaviour — automatic exposure may pick a different duration when label colour or ambient light changes. Where supported, test a controlled exposure or an exposure limit across the operating range.

Short light pulses can limit the effective capture interval in a properly synchronised system. On a rolling-shutter sensor the pulse timing must account for which rows are exposing: a short flash at the wrong moment illuminates only part of the image. Confirm sensor mode, trigger timing and lighting compatibility first.

For a conveyor, test the actual line speed, code orientation and capture position. For a kiosk, test a stationary code and the hand motion people actually use. A global-shutter engine can help preserve moving geometry, but the shutter label alone does not establish reading performance in either application.

6. Validate with the real motion and real codes

A useful evaluation states the operating conditions and a measurable acceptance rule. Test more than one good label, and include the window or enclosure the finished device will use.

Test item Record and verify
Code samples Symbology, payload, overall and module size, quiet zone, print/screen quality, surface
Installation Working distance, field of view, focus, angle, protective window, code position in frame
Motion Speed range, direction relative to image rows, orientation, acceleration, dwell in the read area
Acquisition Exposure or auto-exposure behaviour, gain, illumination, trigger mode, capture timing
Results Successful reads over a stated number of presentations, correct payload, latency, timeouts, duplicates
Variation Ambient light, label variation, mounting tolerance, final enclosure

Define a successful presentation before the test: the correct payload must reach the host inside the allowed time and trigger window. Keep failed images where available, and repeat after changing exposure or illumination so the comparison has a documented basis.

7. FAQ

Does a global shutter eliminate barcode motion blur? No. It aligns exposure windows across the image; motion during that window still blurs the code. Exposure time, illumination and image scale remain part of the evaluation.

Can a rolling-shutter scanner read moving QR codes? It can under suitable conditions. The result depends on speed and direction, row timing, exposure, code image size and the decoder. Validate the required range with real samples instead of treating shutter type as a pass/fail rule.

What exposure time should I use? Estimate travel with d ≈ v∥ × t_exp, convert to pixels with the local scale, compare with code detail, then test shorter exposures with enough light. There is no universal setting that guarantees decoding.


Full version, including the timing tables and the complete evaluation record sheet: Global Shutter vs. Rolling Shutter: Exposure and Barcode Motion

Top comments (0)