changed surfFeaturesFinder::find() to allow CV_8UC1 type images
authorGurpinder Singh Sandhu <gpsinghsandhu@yahoo.com>
Thu, 4 Apr 2013 17:22:07 +0000 (22:52 +0530)
committerGurpinder Singh Sandhu <gpsinghsandhu@yahoo.com>
Thu, 4 Apr 2013 17:22:07 +0000 (22:52 +0530)
http://code.opencv.org/issues/2926

modules/stitching/src/matchers.cpp

index 2231d13..d05afff 100644 (file)
@@ -348,7 +348,15 @@ SurfFeaturesFinder::SurfFeaturesFinder(double hess_thresh, int num_octaves, int
 void SurfFeaturesFinder::find(const Mat &image, ImageFeatures &features)
 {
     Mat gray_image;
-    CV_Assert(image.type() == CV_8UC3);
+    CV_Assert((image.type() == CV_8UC3) || (image.type() == CV_8UC1));
+    if(image.type() == CV_8UC3)
+    {
+        cvtColor(image, gray_image, CV_BGR2GRAY);
+    }
+    else
+    {
+        gray_image = image;
+    }
     cvtColor(image, gray_image, CV_BGR2GRAY);
     if (surf == 0)
     {