Commit d71f31b9 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1433 from Sahloul:freak_gray_img

parents 39af4822 be84634c
......@@ -333,8 +333,13 @@ void FREAK_Impl::compute( InputArray _image, std::vector<KeyPoint>& keypoints, O
((FREAK_Impl*)this)->buildPattern();
// Convert to gray if not already
Mat grayImage = image;
CV_Assert(grayImage.channels() == 1);
Mat grayImage;
if( image.channels() == 3 || image.channels() == 4 )
cvtColor(image, grayImage, COLOR_BGR2GRAY);
else {
CV_Assert(image.channels() == 1);
grayImage = image;
}
// Use 32-bit integers if we won't overflow in the integral image
if ((image.depth() == CV_8U || image.depth() == CV_8S) &&
......
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