Skip to content

Recogniser for grammar 002: white-balance-robust ink-set matching#2

Merged
jamesdward merged 1 commit into
mainfrom
feat/recogniser-002
Jul 6, 2026
Merged

Recogniser for grammar 002: white-balance-robust ink-set matching#2
jamesdward merged 1 commit into
mainfrom
feat/recogniser-002

Conversation

@jamesdward

Copy link
Copy Markdown
Owner

What

Milestone 2, Phase 6 — grid-family measurers for iso-002, wired in via a measurer registry keyed by structure.type (band → cascade measurers, grid → new ones; the image is measured once per family, and 001's behaviour is byte-identical).

  • Grid measurers (recogniser/measure_grid.py): grid module by edge-projection autocorrelation (audit 002 §2's own method), flat-ink extraction, parent/product separation via the committed multiply arithmetic, overprint-residual verification (audit §5: verification, not identification), stripe rhythm, coarse primitive-mix classifier (measured but uncommitted per SI-008).
  • The milestone's core requirement — ink relationships must survive white-balance shift: ink_set scores as max(absolute, relationship). The relationship path estimates a per-channel diagonal gain from a consensus cluster of sheet/measured ratios, excluding channel observations lost to clipping (≥250 / ≤5), scores clipped channels one-sidedly (measurement loss, not identity mismatch), then re-separates overprint products in corrected space. The estimated gain and clipping report are published in every claim's working.
  • Measured behaviour: clean 002 render identifies at 0.909; warm cast (1.15, 1.0, 0.85) that clips two bright inks still identifies at 0.781 with the applied gain recovered to within 0.01/channel; absolute-only matching collapses to 0.055 under the same cast.
  • SPEC-ISSUES: SI-020 (relationship-mode colour scoring is undefined in the spec; documents the v0 design and constants), SI-021 (limits of colour-only overprint verification).

Tests

19 new tests including the clipping regression (exact previously-failing case pinned). Full suite: 107 passed. 001 recogniser tests unchanged except one iso-002 test that asserted the pre-Phase-6 absence of grid measurers, updated to assert the new graceful cross-family behaviour.

- measurer registry keyed by structure.type; image measured once per
  family; 001 band path byte-identical
- measure_grid.py: grid module via edge-projection autocorrelation, flat-ink
  extraction, parent/product separation, overprint residual verification
- two-path ink_set match: absolute Lab delta-E vs relationship path that
  estimates a per-channel white-balance gain (saturation-aware consensus
  estimator, one-sided scoring of clipped channels) — ink relationships
  survive casts that destroy absolute values (SI-020, SI-021)
- 19 grid tests incl. clipping regression; 107 total green
@jamesdward
jamesdward merged commit 1096c7c into main Jul 6, 2026
1 check passed
@jamesdward
jamesdward deleted the feat/recogniser-002 branch July 6, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant