Repository navigation
fix: refine the photo outline past background lines and refuse outlines shifted across the card - #521
Merged
Merged
Conversation
…es shifted across the card The device check of the #493 integration tip found that photo refinement failed on real photos: wood grain outside the card took all 5 line slots of an edge in the 15% search band, so the card edge was never tried (6 of 9 not_refined). The photo now uses a band of 2 x cornerMotionMax. The edge refiner also refuses an outline whose opposite edges move in opposite directions by more than 2% of the short side (oppositeEdgeShiftMax), the outline that cut 4-5 mm off held-still cards. The photo asked for bar no longer counts a clip whose photo outline is an inside outline, and the branch-alone run drops its Mac timing limit. A real device photo with EXIF orientation backs a PhotoOutline test. Refs #493
In parallel on the 3-core macos-15 runner the suite hung with every test started and none finished, also with the device-photo test skipped. Each test passes alone, and the suite passes one at a time in 19 seconds. Refs #493
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes from the device check of the #493 integration tip (comment). Diagnosis on the throwaway branch
diag/493-device.main): no Mac timing limit. The limits on false outlines and on inside outlines onplainframes at tilt0stay. CI run 39688321178 failed only on timing (65 ms on the runner against 20 ms).macos/CardDetectorTests/Fixtures/device-photo). It has the photo at 1280 x 720 with EXIF orientation 6, the kept frame's luma as PNG, and the held-still outline and intrinsic matrix. It is 0.9 MB. The owner approved it.detector:testruns the Swift fixture tests one at a time (--no-parallel). Run in parallel on the 3-coremacos-15runner, the suite hung twice with every test started and none finished. It also hung with the device-photo test skipped. Each test passes alone on the runner, and the suite passes one at a time in 19 s (probe runs 39715264925 and 39719853270 on the throwaway branchdiag/521-ci-probe).Evidence
not_refined, 2 wererefinedand 1 wasmotion_refused. The new tests fail as follows:refines the outline on a device photo with EXIF orientation…and…background lines parallel to the card's top edgegive.notRefined.keeps the card's edges when a line outside one edge and a line inside the opposite edge would shift the outlinefails.1 of 1 → 0 of 1).detector:testpasses 35 of 35, jestdetector-replay.test.tspasses 36 of 36, and typecheck and lint pass. The device dumps run offline with this code:refined, 0.2 to 3.6 px from the held-still outline.Replay against
origin/spec/493-detector-replay(M3). Every bar passes, exit 0. Rows that changed:['| Condition | Photo asked for | Settle time median | Jitter median | Photo outline median | Inside photo outlines | Hand shift median | Result |']
| --- | --: | --: | --: | --: | --: | --: | --- |
| sleeve | 4 of 5 → 4 of 5 | 1200 ms → 1200 ms | 0.06 mm → 0.06 mm | 1.96 mm → 1.84 mm | 1 → 0 | 1.03 mm → 0.94 mm | pass |
sleeve-clip-003no longer asks for a photo. On the integration branch, its photo outline was an inside outline, 5.5 mm off. Mac timing p95 is 6.7 → 6.8 ms, and the photo outline median over all clips stays at 0.06 mm.Replay against
origin/main(branch alone): every fixed limit passes, exit 0.Merge Danger
Door: two-way
Blast Radius: detector
Every frame-loop outline goes through the new rule. A Vision proposal that is shifted by more than about 4% of the card height and also inset is now refused, where before it was refined. On the device frames this happened only on the wrong outline in frame 85.