- make sure we don't crash for an empty image
authorVincent Rabaud <no@email>
Fri, 1 Jul 2011 01:28:14 +0000 (01:28 +0000)
committerVincent Rabaud <no@email>
Fri, 1 Jul 2011 01:28:14 +0000 (01:28 +0000)
modules/features2d/src/orb.cpp

index d28b20c..90b1655 100644 (file)
@@ -532,7 +532,7 @@ void ORB::operator()(const cv::Mat &image, const cv::Mat &mask, std::vector<cv::
 void ORB::operator()(const cv::Mat &image_in, const cv::Mat &mask, std::vector<cv::KeyPoint> & keypoints_in_out,
                      cv::Mat & descriptors, bool do_keypoints, bool do_descriptors)
 {
-  if ((!do_keypoints) && (!do_descriptors))
+  if (((!do_keypoints) && (!do_descriptors)) || (image_in.empty()))
     return;
 
   cv::Mat image;