Repository navigation
Document the L-shape fitting math, add the Zhang et al. reference, fix typo - #150
Open
CloudCorpRecords wants to merge 1 commit into
Open
CloudCorpRecords wants to merge 1 commit into
CloudCorpRecords wants to merge 1 commit into
Conversation
…x typo Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Rene Turcios <95189389+CloudCorpRecords@users.noreply.github.com>
CloudCorpRecords
force-pushed
the
docs/101-l-shape-fitting-math
branch
from
October 19, 2026 15:00
e465622 to
c1758a1
Compare
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 #101
Overview
Docs-only change to
src/components/detection/l_shape_fitting/l_shape_fitting_detector.pyso a beginner can match each step of the code to an equation. No behavior change._adaptive_range_segmentation: the distance-dependent thresholdr_th = MIN_RNG_TH_M + RNG_TH_RATE * d._merge_clusters: why overlapping neighborhoods are merged._rotate_points:c1 = cos(theta) x + sin(theta) y,c2 = -sin(theta) x + cos(theta) y, and why the rectangle becomes axis-aligned in that frame._calculate_variance_criterion: the distances to the nearest edged1_i,d2_i, the split intoE1/E2,gamma = -Var(E1) - Var(E2), and why the largest gamma is the best direction._calculate_rectangle: the angle search and the four edge linesa*x + b*y = c, matching thea,b,clists passed toRectangle._mearge_clusters->_merge_clusters(andmearged_*locals). It was only used inside this file.min_cost_angle: the criterion is maximized, so it starts at-inf. I did not rename it, to keep the change docs-only.Testing
pytest test/test_point_cloud_rectangle_fitting.py test/test_point_cloud_robustLS_rectangle_fitting.py test/test_rectangle.py-> 6 passed (headless,MPLBACKEND=Agg)._calculate_rectangleand_calculate_variance_criterionon a fixed synthetic L-shaped cluster (rotated 23 degrees, seeded noise) at three angle steps before and after the edit; the printed rectangle coefficients and criterion value are identical (the fit recovers 23 degrees).run_test_suites.sh), only the tests that import this module.Notes, not changed here
np.arange(0, pi/2 - step, step), so the last angle tried is just underpi/2 - step, notpi/2. It is harmless for a quarter-turn-symmetric rectangle, but if you want the docstring to say "[0, 90 deg)" exactly, the end bound could bepi/2. I left the behavior as is.AI assistance
This change was made with Claude Code (an AI coding agent), as
CLAUDE.mdanticipates; it wrote the docstrings and ran the checks above.