mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
Merge pull request #10902 from alalek:port_10695
This commit is contained in:
commit
a0c2718adb
@ -304,11 +304,10 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleBlobDetectorImpl::detect(InputArray image, std::vector<cv::KeyPoint>& keypoints, InputArray)
|
void SimpleBlobDetectorImpl::detect(InputArray image, std::vector<cv::KeyPoint>& keypoints, InputArray mask)
|
||||||
{
|
{
|
||||||
CV_INSTRUMENT_REGION()
|
CV_INSTRUMENT_REGION()
|
||||||
|
|
||||||
//TODO: support mask
|
|
||||||
keypoints.clear();
|
keypoints.clear();
|
||||||
Mat grayscaleImage;
|
Mat grayscaleImage;
|
||||||
if (image.channels() == 3 || image.channels() == 4)
|
if (image.channels() == 3 || image.channels() == 4)
|
||||||
@ -372,6 +371,11 @@ void SimpleBlobDetectorImpl::detect(InputArray image, std::vector<cv::KeyPoint>&
|
|||||||
KeyPoint kpt(sumPoint, (float)(centers[i][centers[i].size() / 2].radius) * 2.0f);
|
KeyPoint kpt(sumPoint, (float)(centers[i][centers[i].size() / 2].radius) * 2.0f);
|
||||||
keypoints.push_back(kpt);
|
keypoints.push_back(kpt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mask.empty())
|
||||||
|
{
|
||||||
|
KeyPointsFilter::runByPixelsMask(keypoints, mask.getMat());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr<SimpleBlobDetector> SimpleBlobDetector::create(const SimpleBlobDetector::Params& params)
|
Ptr<SimpleBlobDetector> SimpleBlobDetector::create(const SimpleBlobDetector::Params& params)
|
||||||
|
Loading…
Reference in New Issue
Block a user