Closed timotheeg closed 3 years ago
Might as well skip shine detection for the other levels then? Save some cycles
Might as well skip shine detection for the other levels then? Save some cycles
I thought about that, but I reasoned keeping the shine detection might still help overall. Exiting early on black blocks still applies for the top part of the board and for at least one hole per row for the bottom part.
So there's a threshold number of blocks where the early exit is no longer beneficial, but I haven't done the math to figure out what the threshold is, to check it i's really worth keeping.
Also, I kept the shine check to keep the PR small, and to not have to make scanField()
aware of the level. That one is a rather lousy reason though, the one above is better.
I will probably do the math ... sometimes 😅
Context
On some capture cards, interlacing artifacts can be incorrectly detected as block shine, and while the block color is never matched against the black, picking the darkest color instead.
The shine optimization is needed for levels x6 and x7 on retron because the colors is so close to black that block detection is unreliable for them, and the shine is a better approach.
Approach