Fix Single ThresholdBug in Simple Blob Detector#19859
Merged
alalek merged 3 commits intoopencv:3.4from Apr 8, 2021
Merged
Conversation
5defa8d to
8762110
Compare
cast type in comparison and remove docs address bug with using min dist between blobs in blob detector use scalar instead of int address bug with using min dist between blobs in blob detector
8e6822e to
d5f6495
Compare
danielenricocahall
added a commit
to danielenricocahall/opencv
that referenced
this pull request
May 27, 2021
…ctor-single-thresh Fix Single ThresholdBug in Simple Blob Detector * address bug with using min dist between blobs in blob detector cast type in comparison and remove docs address bug with using min dist between blobs in blob detector use scalar instead of int address bug with using min dist between blobs in blob detector * fix namespace and formatting
alalek
reviewed
Oct 5, 2021
| // if the difference between min and max threshold is less than the threshold step | ||
| // we're only going to enter the loop once, so we need to add curCenters | ||
| // to ensure we still use minDistBetweenBlobs | ||
| centers.push_back(curCenters); |
Member
alalek
reviewed
Oct 6, 2021
| SimpleBlobDetector::Params params; | ||
| params.minThreshold = 250; | ||
| params.maxThreshold = 260; | ||
| std::vector<KeyPoint> keypoints; |
Member
There was a problem hiding this comment.
params.minRepeatability = 2 by default.
This is why no keypoints are detected here if there is one "threshold" only (which parameters combination doesn't makes sense).
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.
Per the bug mentioned in #6667, if there is only one threshold, the logic which uses
minDistBetweenBlobsis not reached. This PR addresses that issue by ensuring that, if there is only one threshold, we addcurCentersbefore the blob distance checking logic. The test replicates the test setup described in the issue, which originally failed but now passes, ascentersis now populated and therefore we extract keypoints.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.