Commit 0b1575c4 authored by Maria Dimashova's avatar Maria Dimashova

fixed SIFT when keypoints vector is empty (#1162)

parent fbed6d1d
......@@ -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++ )
......
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