Skip to content

Include keypoint positions in sorting of points by norm to tie-break#23370

Closed
simonlynen wants to merge 1 commit intoopencv:4.xfrom
simonlynen:patch-1
Closed

Include keypoint positions in sorting of points by norm to tie-break#23370
simonlynen wants to merge 1 commit intoopencv:4.xfrom
simonlynen:patch-1

Conversation

@simonlynen
Copy link
Copy Markdown
Contributor

@simonlynen simonlynen commented Mar 17, 2023

This makes LineSegmentDetector deterministic by including keypoint positions as tie-breaker when sorting the seed points by norm. Without this change the region growing in LSD is non-determinstic and thus the returned lines are changing between invocations.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • 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

@asmorkalov asmorkalov changed the base branch from master to 4.x March 20, 2023 06:45
@asmorkalov asmorkalov added category: imgproc feature bug pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch and removed feature labels Mar 20, 2023
@asmorkalov
Copy link
Copy Markdown
Contributor

OpenCV 3.4 branch has the same issue. Could you rebase the patch on top of 3.4 branch and re-target it to 3.4. OpenCV team will merge it to 4.x and 5.x during regular merge procedure.

@asmorkalov
Copy link
Copy Markdown
Contributor

Actually, if reproducibility is the only requirement, std::stable_sort may be a solution.

@asmorkalov asmorkalov self-requested a review March 21, 2023 15:19
@asmorkalov asmorkalov self-assigned this Mar 21, 2023
@asmorkalov asmorkalov added this to the 4.8.0 milestone Mar 21, 2023
@simonlynen
Copy link
Copy Markdown
Contributor Author

Moving this to #23388 which uses stable_sort and targets 3.4

@simonlynen simonlynen closed this Mar 22, 2023
@simonlynen simonlynen deleted the patch-1 branch March 22, 2023 03:13
simonlynen added a commit to simonlynen/opencv that referenced this pull request Mar 22, 2023
…ing keypoints prior to region growing

This makes LineSegmentDetector deterministic by using stable_sort for ordering points by norm. Without this change the region growing in LSD is non-determinstic and thus the returned lines are changing between invocations.

This is a replacement for opencv#23370
thewoz pushed a commit to thewoz/opencv that referenced this pull request Jan 4, 2024
…ing keypoints prior to region growing

This makes LineSegmentDetector deterministic by using stable_sort for ordering points by norm. Without this change the region growing in LSD is non-determinstic and thus the returned lines are changing between invocations.

This is a replacement for opencv#23370
thewoz pushed a commit to thewoz/opencv that referenced this pull request May 29, 2024
…ing keypoints prior to region growing

This makes LineSegmentDetector deterministic by using stable_sort for ordering points by norm. Without this change the region growing in LSD is non-determinstic and thus the returned lines are changing between invocations.

This is a replacement for opencv#23370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug category: imgproc pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants