Repository navigation
Commit 7d77356
detect: gate scene texture out of the locator and stop fragmenting codes
Real captures drowned the locator in noise: dense print flood-filled into
near-frame-sized 'matrix' blobs, text rows/columns passed as linear regions,
and one physical code was reported as a pile of overlapping fragments — while
a close-up code filling the frame produced no candidate at all (huge modules
leave the texture pass blind, and the size cap killed its region).
- cap regions at max_region_frac of the frame unless a confirmed finder backs
them (a close-up code legitimately fills the frame)
- rank finder-backed regions first, then largest
- suppress a candidate overlapping an accepted one by >50% of the smaller box
- reject linear regions that are not scannable (reading extent < 0.75x bar
extent) or whose dark mask breaks up along the bar axis like text glyphs
- band finderless matrix guesses to code-like ink coverage (22..85% dark)
- synthesize candidates from unclaimed finder hits (count >= 2)
- keep Region as the un-grown core box; grow linear quiet zones at emission
- micro-opts on the hot path: direct row slices in the tile pass, reused
run buffer in the finder scan (~12% faster 1080p locate)
Real scenes: EAN-amid-text 16 -> 2 candidates with the barcode ranked first;
close-up QR 7 -> 1 (exact box); pure text areas now yield zero candidates.
Synthetic recall stays 100% in the bench and tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 55e57be commit 7d77356
6 files changed
Lines changed: 448 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
33 | 47 | | |
34 | | - | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
40 | | - | |
| 54 | + | |
| 55 | + | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | | - | |
131 | | - | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
0 commit comments