Code readingGuide

Reading QR codes on reflective and curved surfaces

How to read a QR code on a reflective surface: dome and dark-field ring lights, polarizers, the 3-pixels-per-module rule, and a worked example on curved metal.

LumaSpec Vision13 min read Share on LinkedIn

On this page 10 sections
  1. 01The decision: light first, then pixels
  2. 02Why gloss and curvature break a decode
  3. 03The resolution rule: three pixels per module, four on metal
  4. 04Worked example: laser-marked QR on a 25 mm cylinder
  5. 05Choosing the light: dome, dark field or polarizer
  6. 06Choosing the reader
  7. 07When the usual answer is wrong
  8. 08Checks before you order
  9. 09Day-one commissioning checklist
  10. 10Questions

A QR code on a polished or curved part fails for two reasons, and neither is the decoder. The surface acts like a mirror and throws one bright band across the finder patterns, or the curve compresses the outer modules and pulls them out of focus. Fix the geometry first, then buy pixels. This guide gives the lighting decision for glossy and curved marks — dome, dark-field ring or cross-polarized diffuse — the pixels-per-module rule, a worked example on a curved aluminum cylinder with the arithmetic shown, and the checks to run before ordering hardware.

The decision: light first, then pixels

Match the light to the mark, then size the camera:

  • Printed ink on a glossy curved surface — bottle labels, shrink wrap, painted housings: a dome light with an inside diameter at least twice the code width.
  • Laser-etched or dot-peened marks on bare metal: dark-field geometry, a diffused flat ring firing across the part at 0–15°.
  • Flat mirror surfaces — foil laminate, polished plate: cross-polarized diffuse light, polarizer film on the light and an analyzer turned 90° on the lens.
  • The reader: at least 3 pixels per module for printed codes, 4 to 5 on etched or peened metal, and a global shutter the moment the part moves.

Across the stations we debug, the light is the culprit far more often than the decoder or the sensor. A mediocre 5 MP reader under the right light out-reads a 20 MP reader fighting its own reflection. The rest of this guide puts numbers on each line above.

Why gloss and curvature break a decode

A specular surface follows the law of reflection: the angle leaving equals the angle arriving. A ring light at 45° over a glossy label photographs itself as a bright annulus printed straight across the symbol. The quiet zone saturates, the binarization collapses, and the decode never starts. Decoding begins by locating the three corner finder patterns, so one glare-covered corner ends the read before error correction is even tried — the mechanics of that first step are covered in QR code finder pattern detection.

Curvature adds two independent penalties, both driven by the wrap angle θ between the code's center and its edge:

edge module width = module width × cos θ depth drop at the edge = r × (1 − cos θ)
Wrap half-angle Module width kept Depth drop on a 25 mm cylinder
±15° 0.97 0.4 mm
±30° 0.87 1.7 mm
±45° 0.71 3.7 mm

Design the wrap within ±30°: modules keep at least 87% of their width and the depth penalty stays under 15% of the radius. Past ±45° the edge modules lose close to a third of their width, and no light fixes that. Rotate the part between shots, or add a second camera looking at the flank.

The resolution rule: three pixels per module, four on metal

Commit to these numbers: 3 pixels per module is the floor for a printed code, and etched or peened marks need 4 to 5 because the module edges are ragged and the contrast is low. Symbol sizes: the smallest MicroQR is 11 × 11 modules, a Version 1 QR is 21 × 21, each version adds four modules per side up to 177 × 177, and modules as small as 0.25 mm are common on small marked parts. Keep the quiet zone clear — 4 modules for QR, 2 for MicroQR.

pixels per module = module width × pixels across the sensor ÷ field of view

Turn it around when you buy: pixels needed = field of view × pixels per module ÷ module width, with 4 in the numerator for metal. A 60 mm field of view over a 0.5 mm etched module asks for 60 × 4 ÷ 0.5 = 480 pixels, which any modern reader clears. A 400 mm field over 0.25 mm printed modules asks for 400 × 3 ÷ 0.25 = 4800 pixels, which separates the camera classes quickly.

Run your own numbers through the calculator below; its button opens the shop finder filtered to cameras with enough pixels.

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

Worked example: laser-marked QR on a 25 mm cylinder

A Version 3 QR code, 29 × 29 modules at 0.5 mm each — a 14.5 × 14.5 mm symbol — laser-etched around a 25 mm diameter anodized aluminum cylinder, radius 12.5 mm. The station gets a 60 mm field of view so the whole part plus placement scatter fits. A fitting reader is the LS-CRD-0028: 2560 × 2048 pixels (5 MP), 30 fps, 60 codes/s, an 8 mm focal length, a global shutter and a 1/1.7-inch sensor.

  1. Wrap angle. Half the symbol spans 7.25 mm of circumference: 7.25 ÷ 12.5 = 0.58 rad ≈ 33°.
  2. Foreshortening. cos 33° = 0.84, so an edge module images at 0.5 × 0.84 = 0.42 mm.
  3. Depth. The code edges sit 12.5 × (1 − 0.84) = 2.0 mm behind the crown. Focus at mid-depth and demand ±3 mm to cover tilt and vibration.
  4. Pixel size on the part. 60 mm ÷ 2560 px = 0.023 mm per pixel, so 0.5 ÷ 0.023 ≈ 21 pixels per module at the crown and 0.42 ÷ 0.023 ≈ 18 at the edges — the 4-to-5 target for etched metal is met with room.
  5. Working distance. A 1/1.7-inch sensor is about 7.4 mm wide, so m = 7.4 ÷ 60 = 0.12 and WD = 8 × 1.12 ÷ 0.12 ≈ 73 mm (a first-order lens estimate; set the focus mid-curve).
  6. Depth of field. Sensor pixels run ≈ 7.4 ÷ 2560 ≈ 2.9 µm; allow a 2-pixel blur, c = 5.8 µm. DOF ≈ 2 × 8 × 0.0058 × 1.12 ÷ 0.12² = 7.2 mm, or ±3.6 mm at f/8 — enough.
m = sensor width ÷ field of view WD = f × (1 + m) ÷ m DOF ≈ 2 × N × c × (1 + m) ÷ m²

The margin is wide: holding 3 pixels on the foreshortened edge module allows a field of view of 2560 × 0.14 ≈ 360 mm, so the same reader could cover several parts per frame at a shorter lens setting.

For the etch on this cylinder, mount a flat diffused ring around the lens — dark-field geometry. The anodized surface reflects the low-angle rays away, while the etched cells scatter light up into the lens: a bright code on a dark field. Had the same code been printed ink on the anodized curve, the choice would flip to a dome.

Two ring lights that cover both cases, from the ring lights category:

Ring lightsRing light, 120 mm dia., 0°, White (LS-RNG-0426)LS-RNG-0426
Size
100-200 mm
Type
Diffused
$369.00View part
Ring lights100 mm dia. ring light with diffuser, 30° (LS-RNG-0143)LS-RNG-0143
Size
100-200 mm
Type
Diffused
$169.00View part

The LS-RNG-0426 is a 120 mm diffused white ring that fires flat at 0° — dark-field geometry for etched metal, 24 V. The LS-RNG-0143 is a 100 mm ring with a diffuser at 30° — the even bright wash for printed codes on mildly curved gloss, 24 V.

Choosing the light: dome, dark field or polarizer

Mark Surface Geometry Why it works
Printed ink Glossy curved label, bottle Dome, ID ≥ 2× code width light arrives from every azimuth, no single hot spot
Printed ink Flat mirror — foil, polished plate Cross-polarized dome or coaxial the analyzer blocks the mirrored component; ink still scatters
Laser etch, dot peen Bare metal, any curvature Dark-field flat ring, 0–15° the flat surface reflects away, the mark scatters bright
Ink under overwrap or glass Curved container Diffused ring at 30° plus polarizer kills the film's specular band, keeps the ink's contrast

Dome. A dome surrounds the part with diffuse light from every direction, so a mirror has nothing single to reflect — the default for curved gloss. Size it at twice the code width, three times for deeply curved parts or where the part rotates under the camera. Sizing and failure modes are covered in dome lights for shiny, curved and wrinkled parts.

How a dome light works LEDs at the rim light the white inner surface of the dome, which lights the part evenly from almost every direction. The camera looks through a hole at the top; on flat mirror-like areas the hole reflects as a dark spot.Cameradiffuse inner surfacelights the part from every sideLED ringcamera holecurved or wrinkled part; dark spot where the hole reflects
How a dome light works. LEDs at the rim light the white inner surface of the dome, which lights the part evenly from almost every direction. The camera looks through a hole at the top; on flat mirror-like areas the hole reflects as a dark spot.

Dark field. A flat ring at 0–15° grazes the surface; a smooth surface bounces the light away and goes dark, while etched, peened or embossed marks scatter it into the lens. This is the geometry for marks cut into metal, and it survives curvature because every point of the curve still receives grazing light. The trade-offs between bright and dark field are laid out in machine vision lighting angles.

Bright-field and dark-field lighting geometry High-angle light reflects off the flat surface straight into the lens, so the surface looks bright. Low-angle light reflects away from the lens, so the surface looks dark and only edges or scratches scatter light upward.flat part with a scratchCamerabright field(high angle)dark field (low angle)flat areas reflect away;only the scratch sends light up
Bright-field and dark-field lighting geometry. High-angle light reflects off the flat surface straight into the lens, so the surface looks bright. Low-angle light reflects away from the lens, so the surface looks dark and only edges or scratches scatter light upward.

Cross-polarization. Film on the light polarizes the illumination; an analyzer at 90° on the lens blocks whatever the surface mirrors back. Each film passes about 40% of unpolarized light, so the pair costs roughly two and a half stops. Ink scatters and depolarizes, so the printed code survives; setup details are in cross polarization machine vision. Codes seen through overwrap, glass or a clear lid add a second specular layer — the test sequence in lighting for codes inside glass handles that case.

Choosing the reader

Resolution comes from the rule above; the remaining choices are shutter, interface and where the decoding runs.

Motion sets the shutter. Keep blur under half a module: exposure ≤ 0.5 × module width ÷ belt speed. A 0.5 mm module at 0.5 m/s caps exposure at 0.5 ms; at 1 m/s, 0.25 ms. A strobed ring at 20–50 µs with the exposure synced freezes motion at any belt speed, but only a global shutter renders the modules square — rolling shutters shear a moving code into parallelograms. The inkjet-on-packaging case is worked through in lighting for 2D inkjet codes on moving packaging.

Static stations can roll. On a stopped part the shutter type stops mattering. The MV-ID5120RM-08M-RBN puts 12 MP behind an M12 lens over GigE with a rolling shutter — a fit for indexed stations, not for moving belts.

Decoding on the device. Smart cameras remove the vision PC from the cabinet:

Smart cameras & vision sensors1.6 MP smart camera, 60 fps, 16 mm lens, white light (polarized, transparent light) (LS-SMC-0063)LS-SMC-0063
Interface
GigE
Resolution
Up to 3 MP
$1,110.00View part

The LS-SMC-0063 carries its own polarized white light, a 16 mm lens and a 1.6 MP sensor at 60 fps over GigE — illumination, polarization and decode in one housing, sized for a single code per frame.

Fixed readers. For classic fixed code readers, the table sets the example's 5 MP unit against a 20 MP logistics reader:

Specification LS-CRD-0028 MV-ID6200PM-00C-NNG
Symbologies 1D: Code 39, Code 93, Code 128, CodaBar, EAN8, EAN13, UPCA, UPCE, ITF14, Matrix 2 of 5, Matrix 25, MSI, China Post, Code 11, Industrial 25; 2D: QR Code, Data Matrix; Stack codes: PDF417 1D code: Code 39, Code 128, Code 93, ITF25, CodaBar, EAN8, EAN13, UPCA, UPCE, ITF14, etc.; Matrix 2D code: QR Code, Data Matrix, etc.; Stacked 2D code: PDF417
Max. frame rate 30 fps 20 fps
Sensor size 1/1.7" 1"
Sensor type CMOS CMOS, global shutter
Resolution 2560× 2048 px 5120 × 3968
Pixel size 3.2 μm x 3.2 μm 2.5 μm×2.5 μm
Exposure time 35 μs ~ 1 s 16 μs ~ 0.5 sec
Data interface Fast Ethernet (100 Mbit/s) Gigabit Ethernet (1000 Mbit/s)
Digital I/O 3 non-isolated inputs, 3 non-isolated outputs, 1 RS-232 12-pin M12 connector provides power and I/O, including opto-isolated input (LineIn 0/1/2) × 3, opto-isolated output (LineOut 3/4/5) × 3, and RS-232 × 1.
Power supply 24 V 12 ~ 24 VDC
Ingress protection IP67 IP67 ( under proper installation of waterproof lens cap)
Weight 280 g Approx. 750 g (1.7 lb.)
Price $920.00 $5,699.00 · quoted

Values as printed in each product's data sheet; open a part for its drawing and full specifications.

One curved part often carries two codes — a serial on the barrel and a lot code on the end face. When only one of several codes reads, isolate the image and the search before touching the light, as in multiple QR codes not reading. The full reader range is in the camera finder, and every light geometry above is in the lighting finder.

When the usual answer is wrong

Coaxial light on a cylinder. A beamsplitter sends light along the lens axis; on a curved mirror only one tangent band returns — a bright stripe across an unreadable code. Coaxial is a flat-surface tool.

A dome on a tall part. Past about half the dome's height the walls shadow the mark, and parts bigger than about 300 mm need domes too large to mount on the station. Two flat low-angle rings from opposite sides deliver the same glare-free wash.

Cross-polarization on dot peen. If the mark's only contrast is specular — polished divots on polished metal — the analyzer removes the code along with the glare. Dark field builds contrast instead of removing light; use it.

5 MP stretched over a wide belt. At 0.25 mm modules across a 400 mm field, 3 pixels per module needs 0.083 mm per pixel and 4800 pixels across; the 5 MP width of 2560 fails. The MV-ID6200PM-00C-NNG is the step up: 20 MP on a 1-inch sensor with a C-mount and a global shutter. A 1-inch sensor is about 13 mm wide, and 20 MP across 3:2 is roughly 5500 pixels — 5500 × 0.083 ≈ 460 mm of belt at 3 pixels per 0.25 mm module.

Heroics on a ±45° wrap. Beyond ±45° the foreshortening is physics, not lighting. A second camera at the flank angle, or a turn of the part between shots, costs less than the light that still fails.

Checks before you order

  1. Photograph the real part at the planned distance with a diffuse flashlight held where the ring will sit. If the code reads on the phone screen, the geometry works; if you see the flashlight's reflection, so will the camera.
  2. Compute pixels per module over the full field of view, with the part at its worst off-center position — not over the code alone.
  3. Check the wrap: within ±30° one camera suffices; beyond that, plan the second one now.
  4. Budget depth: r × (1 − cos θ), plus tilt and vibration. At m ≈ 0.12, f/8 gives about ±3.6 mm.
  5. Confirm 4 clear quiet-zone modules around the symbol — embossing ribs and print texture count as clutter.
  6. Moving part: global shutter, strobe, and exposure ≤ 0.5 × module ÷ speed.
  7. Walk the numbers through the system configurator, starting at the light step, before anything is cut or drilled.

Day-one commissioning checklist

  • Lock exposure and gain manually once the light is set; an auto loop hunting across strobed images causes intermittent fails, the failure mode traced in auto exposure ROI instability.
  • Center the ring on the lens axis within a couple of millimetres; a skewed ring puts the dark-field band on one side of the curve.
  • Measure a module on a captured frame and confirm the pixels per module you designed.
  • Log every failed image with its decode attempt, and grade rejects instead of counting them — barcode read confidence sets the thresholds.
  • Keep ten known-good and ten known-bad parts at the station for shift-start checks.

Questions

Why does a QR code read at the center of a curve but fail at its edges?

Two effects stack at the edge of the wrap: modules compress by the cosine of the wrap angle, and the surface drops away from the plane of focus. At ±33° on a 25 mm cylinder an edge module keeps 84% of its width and sits 2 mm behind the crown; in a tight design that is below 3 pixels per module and outside depth of field. Aim 4 pixels per module at the center, stop down to f/8, and keep the wrap within ±30° — or turn the part between shots.

How much light does cross-polarization cost?

Roughly two and a half stops. Each film passes about 40% of unpolarized light, so a crossed pair on the light and the lens transmits about 16% of the diffuse return — six times the light or exposure. On a strobed ring that is usually free: lengthen the pulse or drive the controller harder. The mirrored glare you added the films to remove is blocked almost completely, so contrast on the ink improves even as total light falls.

What size dome light should I order?

Order a dome whose inside diameter is at least twice the code's largest dimension — three times for deeply curved parts or where the part rotates under the lens. Keep the part no deeper than about half the dome's height, or the walls shadow the mark. Check that the camera hole clears your lens and any analyzer film you add behind it; a film in the optical path moves the focus a few millimetres.

Does infrared light remove glare on metal?

No. A polished surface mirrors 850 nm exactly the way it mirrors white light — wavelength does not change the law of reflection, so the glare band stays where it was. Infrared earns its place when inks behave differently: a red or black overprint that hides a code from the eye can transmit or scatter at 850 or 940 nm, so an infrared ring reads through it. It also removes the strobing visible light that operators dislike.

How fast can the part move and still decode?

Cap the exposure at half a module of travel: 0.5 × module width divided by belt speed. For a 0.5 mm module at 0.5 m/s that gives 0.5 ms; at 1 m/s you are down to 0.25 ms, still within reach of a free-run exposure. The clean fix is a strobed ring at 20 to 50 µs with the exposure synchronized — blur vanishes at any belt speed, provided the shutter is global so the modules stay square.