fixed CascadeClassifier::detectMultiScale when TBB
authorMaria Dimashova <no@email>
Mon, 25 Oct 2010 12:05:22 +0000 (12:05 +0000)
committerMaria Dimashova <no@email>
Mon, 25 Oct 2010 12:05:22 +0000 (12:05 +0000)
modules/objdetect/src/cascadedetect.cpp
tests/cv/src/tsysa.cpp

index e8d22c4..56ab356 100644 (file)
@@ -898,10 +898,10 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
         
         int yStep = factor > 2. ? 1 : 2;
     #ifdef HAVE_TBB
-        const int PTS_PER_THREAD = 100;
-        stripCount = max(((sz1.height*sz1.width)/(yStep*yStep) + PTS_PER_THREAD/2)/PTS_PER_THREAD, 1);
-        stripSize = (sz1.height + stripCount - 1)/stripCount;
-        stripSize = (stripSize/yStep)*yStep;
+        const int PTS_PER_THREAD = 1000;
+        stripCount = ((sz1.width/yStep)*(sz1.height + yStep-1)/yStep + PTS_PER_THREAD/2)/PTS_PER_THREAD;
+        stripCount = std::min(std::max(stripCount, 1), 100);
+        stripSize = (((sz1.height + stripCount - 1)/stripCount + yStep-1)/yStep)*yStep;
     #else
         stripCount = 1;
         stripSize = sz1.height;
index daac020..a801d25 100644 (file)
@@ -50,7 +50,7 @@ const char* blacklist[] =
     "calibrate-camera-artificial", //ticket 472
     //"calibrate-camera-cpp",        //ticket 564
     //"calibrate-stereo-c",          //ticket 565
-    "cascade-detector",            //ticket 432
+    //"cascade-detector",            //ticket 432
     "chessboard-detector",         //ticket 569
     "chessboard-subpixel",         //ticket 473
     "color-luv",                   //ticket 502