BLOB - Support RGBA
authorHamdi Sahloul <hamdisahloul@hotmail.com>
Sun, 7 Jan 2018 05:30:40 +0000 (14:30 +0900)
committerHamdi Sahloul <hamdisahloul@hotmail.com>
Sun, 7 Jan 2018 05:30:40 +0000 (14:30 +0900)
modules/features2d/src/blobdetector.cpp

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