fixed SIFT when keypoints vector is empty (#1162)
authorMaria Dimashova <no@email>
Fri, 8 Jul 2011 15:54:57 +0000 (15:54 +0000)
committerMaria Dimashova <no@email>
Fri, 8 Jul 2011 15:54:57 +0000 (15:54 +0000)
modules/features2d/src/sift.cpp

index 4cdf920..4203ebe 100644 (file)
@@ -1722,7 +1722,8 @@ void SIFT::operator()(const Mat& image, const Mat& mask,
         KeyPointsFilter::removeDuplicated( keypoints );
 
         // Compute descriptors.
-        cvSeqRemoveSlice( featuresSeq, cvSlice(0, featuresSeq->total) );
+        if( featuresSeq->total > 0 )
+            cvSeqRemoveSlice( featuresSeq, cvSlice(0, featuresSeq->total) );
     }
 
     for( size_t i = 0; i < keypoints.size(); i++ )