Skip to content

ximgproc: fix angle difference normalization in FastLineDetector merging#4088

Open
AYELET0527661122 wants to merge 3 commits intoopencv:4.xfrom
AYELET0527661122:AYELET0527661122-patch-1
Open

ximgproc: fix angle difference normalization in FastLineDetector merging#4088
AYELET0527661122 wants to merge 3 commits intoopencv:4.xfrom
AYELET0527661122:AYELET0527661122-patch-1

Conversation

@AYELET0527661122
Copy link
Copy Markdown

Fixes #3956
Fix angle difference computation in FastLineDetector::mergeSegments.

Previously the angular difference was computed using a direct absolute
difference between segment angles. As a result, collinear segments with
opposite directions (~pi radians apart) could fail to merge.

The angle difference is now normalized so that segments differing by pi
radians are treated as equivalent.

A regression test (mergeOppositeDirections) was added to verify that
touching parallel segments are merged correctly for both same and
opposite directions.

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

…geSegments

Normalize angle difference so segments with opposite directions
(~pi radians apart) can still be merged.
@AlexanderHaritonov
Copy link
Copy Markdown

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.

fast_line_detector do not merge segments oriented in the opposite direction

2 participants