Skip to content

Stabilize optimized L-shape rectangles on unseen sides - #346

Open
Zeming-Yuan wants to merge 1 commit into
ShisatoYano:mainfrom
Zeming-Yuan:fix/issue-336
Open

Zeming-Yuan wants to merge 1 commit into
ShisatoYano:mainfrom
Zeming-Yuan:fix/issue-336

Conversation

@Zeming-Yuan

Copy link
Copy Markdown

Summary

Fixes #336

Root Cause

Point-to-edge distances weakly constrain the unseen sides of the rectangle. Small numerical changes can move the fitted center or dimensions while leaving the visible-edge fit nearly unchanged.

Changes

  • Add weak least-squares priors on the center, width, and length using the geometric fit as the reference.
  • Document the priors and add a regression test that measures corner movement after a one-ULP input perturbation.

How I checked it works

Verification

export MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1
python -m pytest -q test/test_robust_least_squares_detector.py::test_one_ulp_does_not_move_unseen_edges
bash run_test_suites.sh
# Run from each checkout with a separate output directory.
python /path/to/measure_issue_336.py /tmp/issue-336-sample --runs 8 --jobs 4 --probe

The regression failed on the base revision with 0.467514 m of corner movement and passed with the fix. The full suite passed with 204 tests and one CasADi warning.

With np.random.seed(0) on ARM64, all 28 pairs of independent simulation runs matched exactly in both revisions (0/603 differing rectangles, 0 m maximum corner displacement). In the controlled one-ULP probe, shifts greater than 1 mm dropped from 362/603 to 0/603. The maximum fell from 0.576306 m to 0.000682 m.

Images

Controlled one-ULP perturbation

This zoomed comparison shows simulation fit 545, which had the largest corner displacement before the fix. In each panel, the dashed outline comes from deliberately increasing one LiDAR return's x coordinate by one ULP. Both panels use the same scale. The maximum corner displacement for this fit fell from 0.576 m to 0.26 nm.

Fit 545 with a deliberate one-ULP input change. The outlines separate before the fix and overlap after it.

Final simulation frame before the fix

Final frame of the seed-0 simulation before the fix

Final simulation frame after the fix

Final frame of the seed-0 simulation after the fix

Book

Section 9.2 is planned. The detector docstring describes the priors.

This branch has not been deployed

No deployments
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.

OptimizedLShapeDetector: a tiny numerical difference can still move the optimized rectangle

1 participant