Commit a0c2718a authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #10902 from alalek:port_10695

parents a836892e aab390c5
...@@ -304,11 +304,10 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag ...@@ -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>& ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment