Repository navigation
Validate magnification on synthetic shapes; add --phase-sigma - #66
Merged
Merged
Conversation
Pulsating circles, squares, rings and hollow squares have exact ground truth after magnification, so scripts/synthetic_shapes.py measures the output edge against it. The pipeline's gain follows the flat-top filter model at every frequency with zero phase lag, band mode is exact, k=1 is an identity and all edge directions are magnified alike. Two systematic effects are documented: motion carried by the DTCWT lowpass band is not amplified (a filled circle reaches 0.88k at 5 levels), and edges degrade once the magnified displacement exceeds about 3 px. Of the three #39 proposals, amplitude-weighted phase smoothing is kept as an opt-in --phase-sigma (CPU): it reduces amplified noise and halo in noisy low-contrast texture at some cost in edge magnification. A soft phase limit and level selection made results worse and were dropped. tests/test_synthetic_shapes.py keeps the correctness checks; the full study is in docs/research/synthetic-validation.md. Closes #39
2 tasks
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.
Closes #39
Full write-up with plots and every measurement:
docs/research/synthetic-validation.md.What's in this PR
scripts/synthetic_shapes.py: renders pulsating circles, squares, rings and hollow squares (r(t) = r0 + r1·sin(2πft), camera-like blurred edges) and measures the magnified output against the exact ideal (radiusr0 + k·r1·sin). It reports gain, phase lag, harmonics, isotropy, jitter, ghost energy and line doubling.tests/test_synthetic_shapes.py(12 tests, ~20 s): frequency response against the filter model at 0.3/1.5/8 Hz, zero phase lag, band mode inside and outside the band, k = 1 identity, isotropy for circle and square, the lowpass limitation (documented as a range), and no doubling of a 1 px ring at 2 px motion.--phase-sigma/magnify_motions(phase_sigma=...): amplitude-weighted spatial smoothing of the amplified phase (Wadhwa et al. 2013). CPU only, off by default; rejected with--gpu. The phase step was refactored to "phase + (k−1)·detail", which is numerically the same as before (golden test passes).scripts/bench_high_k.py: textured-scene (ground truth) and face.mp4 benchmark.Findings
Correct:
H2(f)·(1+(k−1)(1−Hlow(f)))from 0.1 to 12 Hz with 0.00-frame phase lag.Limitation 1: the lowpass band isn't magnified. A filled circle reaches 0.88k at 5 levels and 0.92k at 7; thin lines reach ~1.0k.
Limitation 2: beyond ~3 px of magnified displacement, edges stop short and leave echo edges (1 px ring: 0.89k at 3 px, 0.61k at 8 px).
Options:
max_phaseπ/2Acceptance criteria
--phase-sigma, default off).Tests