Merge pull request #1433 from Sahloul:freak_gray_img

pull/1233/merge
Alexander Alekhin 7 years ago
commit d71f31b962
  1. 9
      modules/xfeatures2d/src/freak.cpp

@ -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) &&

Loading…
Cancel
Save