From e3317876455cdc4929a8c0da721a976a87f5544d Mon Sep 17 00:00:00 2001 From: Zifei Tong <5kilograms@gmail.com> Date: Thu, 27 Dec 2012 15:43:16 +0800 Subject: [PATCH] Fix race condition for Cascade Classifier when TBB enabled. --- modules/objdetect/src/cascadedetect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 )