diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index 1c0bbf1b0b..af94fac0e4 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -1268,7 +1268,7 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std:: scales.push_back((float)factor); } - if( !featureEvaluator->setImage(gray, scales) ) + if( scales.size() == 0 || !featureEvaluator->setImage(gray, scales) ) return; // OpenCL code