Fit the background brightness from the photo border and subtract it, so
side-lit photos threshold cleanly. The clicked pixel (or, without a click,
the border) decides whether the piece is darker or lighter, replacing the
invert checkbox. Adds the MDF-on-wood-floor photo as a regression fixture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Filtering holes after the margin let -2 mm grow 1 mm specks past the
3 mm cutoff, and could drop real holes shrunk by a positive margin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>