diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index ad3a73052..38c2e0a0b 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -992,9 +992,9 @@ public: { mtx->lock(); rectangles->push_back(Rect(cvRound(x*scalingFactor), cvRound(y*scalingFactor), winSize.width, winSize.height)); - mtx->unlock(); rejectLevels->push_back(-result); levelWeights->push_back(gypWeight); + mtx->unlock(); } } else if( result > 0 )