From 2d2499f610550d46711202a697d14c9a66e13165 Mon Sep 17 00:00:00 2001 From: Hamdi Sahloul Date: Sun, 7 Jan 2018 14:30:40 +0900 Subject: [PATCH] BLOB - Support RGBA --- modules/features2d/src/blobdetector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/features2d/src/blobdetector.cpp b/modules/features2d/src/blobdetector.cpp index e545891da1..72ff57bda9 100644 --- a/modules/features2d/src/blobdetector.cpp +++ b/modules/features2d/src/blobdetector.cpp @@ -311,7 +311,7 @@ void SimpleBlobDetectorImpl::detect(InputArray image, std::vector& //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();