Merge pull request #10536 from Sahloul:bug_fix/BLOB

This commit is contained in:
Alexander Alekhin 2018-01-07 06:50:49 +00:00
commit e3a6d74945

View File

@ -311,7 +311,7 @@ void SimpleBlobDetectorImpl::detect(InputArray image, std::vector<cv::KeyPoint>&
//TODO: support mask //TODO: support mask
keypoints.clear(); keypoints.clear();
Mat grayscaleImage; Mat grayscaleImage;
if (image.channels() == 3) if (image.channels() == 3 || image.channels() == 4)
cvtColor(image, grayscaleImage, COLOR_BGR2GRAY); cvtColor(image, grayscaleImage, COLOR_BGR2GRAY);
else else
grayscaleImage = image.getMat(); grayscaleImage = image.getMat();