Code readingTroubleshooting

Multiple QR codes not reading: isolate image and search faults

Multiple QR codes not reading? Isolate each symbol, compare thresholding methods, and test search settings before changing cameras or readers.

LumaSpec Vision10 min read Share on LinkedIn

On this page 10 sections
  1. 01Start by locating where the second result disappears
  2. 02Test each QR code in an independent region
  3. 03Check quiet zones, sampling, and exposure
  4. 04Compare grayscale, global threshold, and adaptive threshold
  5. 05Work through a pixel-per-module example
  6. 06Check multi-symbol search and region handling
  7. 07Validate the fix across representative images
  8. 08Choose hardware only after identifying the limiting factor
  9. 09Close the fault with a repeatable checklist
  10. 10Questions

When an image contains two QR codes but returns only one result, changing search options is not the most informative first test. The missing symbol may have poor contrast, an obstructed quiet zone, or insufficient sampling. Alternatively, the decoder or application may stop after its first result. This troubleshooting sequence separates those causes using saved images, individual code regions, controlled preprocessing, and explicit result logging. You can then decide whether to change the image, the search configuration, or the application handling.

Start by locating where the second result disappears

Save the original image before resizing, thresholding, annotation, or display conversion. Record the expected payload of each symbol separately. A screenshot of the application window may contain scaling artifacts that are absent from the acquired image.

Check three boundaries independently:

  • Image input: Does the decoder receive the complete image at its original dimensions?
  • Decode output: Does the documented decoding interface return one result or a collection of results?
  • Application output: Does the application retain every returned result, or overwrite earlier results with the final value?

Log a result count, payload, and location for every successful decode. Where the interface provides them, retain the detected symbol corners as well.

A display showing one payload does not prove that only one code decoded. Conversely, two location markers do not prove that both payloads decoded successfully.

For applications that lose results after decoding, the guide to barcode event handling without recursive updates addresses the downstream event path. Keep that investigation separate from image-quality testing.

Test each QR code in an independent region

Make a separate region of interest around each symbol, preserving the surrounding background. Do not crop tightly against the outer dark modules: the decoder needs the quiet zone around the symbol.

Run these tests with the same decoder settings:

  1. Decode the unchanged full image.
  2. Decode the region containing the first symbol.
  3. Decode the region containing the second symbol.
  4. Repeat using regions extracted directly from the original image, without resizing.

Record the outcomes rather than relying on visual impressions.

Observation Leading explanation Next test
Both regions decode, but the full image returns one result Multi-symbol search, search budget, or result handling Inspect the returned collection and documented search settings
The same region fails alone and in the full image Local image quality or symbol damage Inspect sampling, contrast, focus, and quiet zone
A region decodes only after enlarging its crop margin Clipped quiet zone or distracting boundaries Restore background clearance in the acquisition
Both regions decode only after thresholding Grayscale contrast or binarization sensitivity Compare preprocessing across a representative image set
All saved images decode, but live operation loses results Acquisition, timing, or application association Compare saved frames and per-frame logs under load

Success in separate regions is useful evidence, not absolute proof of a search limitation. Cropping also changes the intensity distribution and local context presented to the decoder.

Check quiet zones, sampling, and exposure

Inspect the missing symbol at native pixel scale. Start with the finder patterns, small modules, and surrounding background rather than the payload text printed nearby.

For standard QR Code symbols, preserve a quiet zone at least four modules wide on every side. Measure clearance relative to module pitch, not as a fixed physical distance. A neighboring code, printed border, or dark fixture can intrude into that area.

Then check these likely causes in order:

  • Glare: Saturated reflections can erase dark modules. Adjust illumination geometry or diffusion before attempting stronger thresholding.
  • Insufficient sampling: Small modules represented by very few pixels are sensitive to focus, alignment, and resampling.
  • Defocus or motion blur: Adjacent light and dark modules merge, especially in the smaller symbol.
  • Uneven illumination: One symbol may occupy a bright reflection while the other sits in shadow.
  • Perspective: A tilted symbol has smaller projected modules on its compressed side.

Inspect intensity profiles across several module boundaries. A gray image can look acceptable on a display while having weak separation between printed marks and background.

The related guide to barcode preprocessing for rotation, blur, and glare explains acquisition defects that also matter here. QR localization differs from linear-barcode decoding, so do not transfer every preprocessing operation unchanged.

Compare grayscale, global threshold, and adaptive threshold

Keep the original grayscale image as the baseline. Some decoding implementations already perform their own binarization, so an externally thresholded image is an alternative input to test, not an automatic improvement.

Compare the following paths while holding crop coordinates and search settings constant.

Input path When it can help Main failure mode
Original grayscale Adequate contrast with useful intensity detail Decoder binarization struggles with local brightness variation
Global threshold Relatively uniform background and distinct dark marks A threshold suited to one symbol damages the other
Adaptive threshold Gradual illumination changes across the image Local noise or unsuitable neighborhood size distorts modules

For an image represented from 0 to 255, global thresholds of 80, 120, and 160 provide a small exploratory sweep. These are test values, not recommended production settings. Inspect whether each threshold preserves the finder patterns and separates neighboring modules.

Adaptive thresholding calculates a local decision level. Its neighborhood must be large enough to contain meaningful foreground and background, rather than following individual module interiors. If the neighborhood approaches the size of the whole image, its local advantage diminishes.

Start with native-size images and avoid aggressive sharpening, repeated resizing, or morphology. These operations can alter module boundaries and create misleading improvements on isolated examples.

Reducing an image to two intensity levels may make both symbols readable because it changes the decoder's input segmentation. That result identifies a useful hypothesis; it does not establish a universal fix. Repeat it across different exposure levels, print batches, and symbol positions.

Work through a pixel-per-module example

Sampling should be calculated for the smaller or more distant symbol, not the easiest code in the scene. Use projected module width along the most compressed image direction.

For a front-facing symbol, an initial estimate is:

pixels per module = image width × module pitch / field width required image width = field width × target pixels per module / module pitch

Assume an inspection image is 1920 pixels wide and covers a field width of 160 mm. A symbol contains 29 modules across its encoded area, which measures 14.5 mm. The quiet zone is additional to that encoded area.

The arithmetic is:

  • Module pitch = 14.5 mm / 29 = 0.5 mm.
  • Image sampling = 1920 pixels / 160 mm = 12 pixels/mm.
  • Module sampling = 12 pixels/mm × 0.5 mm = 6 pixels/module.
  • Required quiet zone per side = 4 × 0.5 mm = 2 mm.
  • Quiet zone in the image = 2 mm × 12 pixels/mm = 24 pixels per side.

As an initial design allowance, test around 3–5 pixels per module, then validate with the actual decoder and worst-case images. This is not a guaranteed decoding threshold or a substitute for optical contrast.

For a target of 5 pixels/module in this example, the horizontal requirement is 160 mm × 5 / 0.5 mm = 1600 pixels. Leave additional allowance for position variation, perspective, and reduced optical contrast.

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

The calculation estimates sampling, not decoding success. If measured sampling is adequate but only one symbol fails, compare its illumination, print quality, and local quiet zone before increasing resolution.

Check multi-symbol search and region handling

Once each symbol decodes independently, investigate the full-image search configuration. Consult the manufacturer's or software provider's documentation for the exact supported behavior.

Check whether the selected entry point returns a single result or multiple results. A setting that increases search effort may improve candidate detection without changing how many results the application receives.

Also verify:

  • The enabled symbology includes the required QR variant.
  • Any maximum-result setting allows the expected number of symbols.
  • A timeout or search budget is not ending processing prematurely.
  • The configured search region contains both symbols and their quiet zones.
  • Result filtering does not discard repeated payloads at different locations.
  • The application iterates over the entire returned collection.

If symbol positions are predictable, separate documented decode regions can be an effective design. Preserve a margin around each expected position and test the full range of mechanical movement.

When region-based results are combined, translate local coordinates back into the full-image coordinate system. Deduplicate overlapping detections using location as well as payload. Two physical labels can legitimately carry identical data.

For repeated conveyor captures, duplicate detection with overlapping images explains why image detections and physical items need separate identities. Do not use a payload-only filter to solve both problems.

Validate the fix across representative images

Build a labeled test set before choosing the final preprocessing path. Include normal images and known difficult cases: dim illumination, glare, position shifts, tilted labels, print variation, and expected motion.

A practical diagnostic batch might contain 60 saved images with two expected symbols each. That gives 60 × 2 = 120 expected symbol results.

Suppose the baseline returns 114 correct symbol results, with both symbols present in 54 images:

  • Symbol recall = 114 / 120 = 95%.
  • Complete-image success = 54 / 60 = 90%.

If preprocessing returns 118 correct results and completes 58 images, those figures become approximately 98.3% and 96.7%. The improvement is useful, but the remaining failures still require investigation.

Track incorrect payloads, duplicate results, and processing time separately. A setting that finds more symbols but exceeds the station's timing allowance is not a complete production fix.

Use some images for tuning and reserve others for a final check. A small diagnostic batch establishes direction; it does not demonstrate a very low production failure rate. Define acceptance limits from the process requirements.

Choose hardware only after identifying the limiting factor

Changing hardware is justified when the current acquisition cannot provide sufficient detail, illumination control, field coverage, or motion handling. It is not the first remedy for an application that ignores returned results.

Use fixed code readers when the documented decoding and communication functions match the task. Use area scan cameras when the application needs direct image access and control over its processing pipeline. Consider smart cameras when their documented onboard tools and result interfaces meet the inspection requirements.

The LS-CRD-0028 is a fixed code reader with a global shutter. Confirm QR support, simultaneous-symbol handling, region configuration, and result formatting in its documentation before selecting it for this task.

Fixed code readers2560 x 2048 fixed code reader, 30 fps, 60 codes/s, 8 mm lens (LS-CRD-0028)LS-CRD-0028
Interface
Fast Ethernet
Resolution
5 MP
Sensor format
1/1.7"
Shutter
Global
$920.00View part

The LS-CMR-0166 is a USB3 area scan camera with a rolling shutter. In an acquisition-based system, decoding is an application function; test moving symbols for geometric distortion as well as exposure blur.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 (12 MP) 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

These cards identify different hardware approaches, not validated solutions for an unseen image. Compare candidates through the camera finder after defining the necessary sampling, exposure, and processing architecture.

Close the fault with a repeatable checklist

Before accepting the change or ordering replacement hardware, confirm the following:

  • [ ] Original images are saved without display scaling or annotations.
  • [ ] Each symbol has been tested independently with background clearance.
  • [ ] Quiet zones remain clear throughout the expected position range.
  • [ ] Grayscale and thresholded inputs were compared using identical search settings.
  • [ ] The application records every returned payload and location.
  • [ ] Identical payloads on different physical labels remain distinguishable.
  • [ ] Accuracy and processing time meet the station's acceptance limits.
  • [ ] Final settings pass a reserved image set and a live operating check.

The usual image-processing answer is wrong when the second result already exists but is discarded downstream. The usual search-setting answer is wrong when the missing symbol also fails in isolation. Keep those two findings explicit in the fault record.

For a new acquisition setup, start with the camera configuration step. If the limiting factor remains unclear, use applications support with original images, symbol dimensions, field coverage, and the full-image versus separate-region test results.

Questions

Why does only one of two QR codes decode?

The decoder may be using a single-result interface, stopping at a search limit, or struggling with one symbol's image quality. The application may also discard additional results. Decode each symbol in a separate region, then compare those results with the full-image result collection.

Should every QR image be converted to black and white?

No. Thresholding can improve separation between dark modules and background, but it can also remove useful detail or distort weak modules. Keep grayscale as the baseline and compare alternatives across varied images. A successful threshold on one image is not sufficient evidence for a production setting.

How much background should a QR code crop include?

For a standard QR Code symbol, preserve at least four module widths of clear background on every side. Convert that clearance to pixels using the module pitch in the acquired image. Also allow for label movement so the search region does not clip the quiet zone.

How many pixels per module should a QR code have?

There is no universal pixel count that guarantees success across optics, printing, and decoders. Around 3–5 pixels per module is a useful initial design allowance, followed by validation. Measure the smallest projected modules, particularly when a symbol is tilted or positioned farther from the camera.

When should separate decoding regions replace a full-image search?

Separate regions are useful when label positions are predictable and each region can retain the complete symbol and quiet zone. Test the expected mechanical movement and translate result coordinates correctly. A full-image search remains preferable when symbol positions vary beyond reliable region boundaries.