Fix #4363 - wrong hierarchy (RETR_TREE) in findContours#19951
Merged
alalek merged 3 commits intoopencv:3.4from Apr 22, 2021
stal12:3.4
Merged
Fix #4363 - wrong hierarchy (RETR_TREE) in findContours#19951alalek merged 3 commits intoopencv:3.4from stal12:3.4
alalek merged 3 commits intoopencv:3.4from
stal12:3.4
Conversation
Member
|
Thank you for the contribution! Could you please add simple regression test for that case? |
Merged
danielenricocahall
pushed a commit
to danielenricocahall/opencv
that referenced
this pull request
May 27, 2021
* Fix opencv#4363 - wrong hierarchy (CV_RETR_TREE) in findContours * Add regression test for findContours * use C++11 => C++98 on 3.4 branch
Merged
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.
This pull requests slightly modifies the behaviour of findContours() when the
modeflag is set toRETR_TREE, in order to avoid a subtle bug.In the uncommon case that the same border pixel belongs to two different contours marked with the same index, it is important to be able to tell which of the two contours is the "last one encountered", in order to reliably find a father for the next contour met during the scan. This pull request address that specific case.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.