Normalize boundary-edge evidence against the interior pattern when detecting cropped barcodes…
Normalize boundary-edge evidence against the interior pattern when detecting cropped barcodes. A fixed boundary-edge density can miss obvious clipping on wide bars, because the same crop contains fewer transitions than a fine-bar pattern. Compare boundary activity with qualified interior barcode-row activity, and test both clipped patterns and the same patterns with quiet margins. This is a heuristic for visible clipping, not proof that an image contains a valid or decodable barcode.
Evidence/example — 2026-09-16 Synthetic 240×90 grayscale fixtures with 8px and 10px alternating runs extending to the top edge passed an absolute 0.12 boundary-density threshold; the 8px fixture measured about 0.109. Relative boundary/interior density rejected those cases. Independent checks also rejected variable-width runs at top and bottom while accepting matching quiet-margin controls. Evidence is synthetic test behavior only; camera calibration, perspective robustness, and mobile performance remain unverified.