From 967a88759fde8d3a5226511d2772e6e964177f09 Mon Sep 17 00:00:00 2001 From: Alexander Karsakov Date: Tue, 28 Oct 2014 16:06:36 +0300 Subject: [PATCH] Don't process empty src image in GFTT --- modules/imgproc/src/featureselect.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/imgproc/src/featureselect.cpp b/modules/imgproc/src/featureselect.cpp index 4a234f3a96..e51859e012 100644 --- a/modules/imgproc/src/featureselect.cpp +++ b/modules/imgproc/src/featureselect.cpp @@ -275,6 +275,12 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners, _mask, blockSize, useHarrisDetector, harrisK)) Mat image = _image.getMat(), eig, tmp; + if (image.empty()) + { + _corners.release(); + return; + } + if( useHarrisDetector ) cornerHarris( image, eig, blockSize, 3, harrisK ); else