title: OpenCV setNumThreads Issue
body: <p>I'm trying to enable code paralelization on OpenCV 2.4.8 and for some reason it is not working. I've already built openCV with <code>WITH_TBB = ON</code> and <code>WITH_OPENMP = ON</code> but for some reason OpenCV is still not adding any boost to my processing procedures. </p>
  
  <p>Does anyone here knows what's going on?</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code> int main() {
  
  InitCounter();
  vector&lt; vector&lt;Point&gt; &gt; _contours;
  vector&lt;Vec4i&gt; _storage;
  vector&lt;Vec3f&gt; circles;
  
  VideoCapture capture("30-1.avi");
  ofstream fout("data.txt"); 
  
  if(!capture.isOpened()) 
  return -1;
  
  //time_t start, end;
  int counter=0;
  int frameCounter=0;
  int frameno=0;
  
  //clock_t startTime = clock();
  
  //time(&amp;start);
  
  for(;;)
  {
  
      Mat frame, finalFrame;
      capture &gt;&gt; frame; 
  
      // double start=CLOCK2();
  
      finalFrame = frame;
  
      cvtColor(frame, frame, CV_BGR2GRAY);
  
      GaussianBlur(frame, frame, Size(7,7), 1.5, 1.5);
      threshold(frame, frame, 20, 255, CV_THRESH_BINARY);
  
      dilate(frame, frame, Mat(), Point(-1, -1), 2, 1, 1);
      erode(frame, frame, Mat(), Point(-1, -1), 2, 1, 1);
  
      Canny(frame, frame, 20, 20*2, 3 );
  
      //double dur = CLOCK2()-start;
      //printf("avg time per frame %f ms. fps %f. frameno = %d\n",avgdur(dur),avgfps(),frameno++ );
  
      //time(&amp;end);
      //++counter;
      //double sec=difftime(end,start);
      //double fps=counter/sec;
      //cout&lt;&lt;fps&lt;&lt;endl;
      //fout &lt;&lt; fps&lt;&lt;"\n";
      //frameCounter++;
  
  
      vector&lt;Vec3f&gt; circles;
  
      findContours(frame,_contours,_storage,CV_RETR_CCOMP,CV_CHAIN_APPROX_SIMPLE );
  
      vector&lt;vector&lt;Point&gt; &gt; contours_poly( _contours.size() );
      vector&lt;Rect&gt; boundRect( _contours.size() );
      vector&lt;Point2f&gt;center( _contours.size() );
      vector&lt;float&gt;radius( _contours.size() );
  
      int temp = 0;
  
      for( int i = 0; i &lt; _contours.size(); i++ )
      { 
          if( _contours[i].size() &gt; 100 )
          {
             approxPolyDP( Mat(_contours[i]), contours_poly[i], 3, true );
             boundRect[i] = boundingRect( Mat(_contours[i]) );
             minEnclosingCircle( (Mat)_contours[i], center[i], radius[i] );
             temp = i;
             break;
          }
      }
  
      //Scalar color2 = Scalar( 0, 0,255 );
      //rectangle( finalFrame, boundRect[temp].tl(), boundRect[temp].br(), color2, 2, 7, 0 );
  
      //fout &lt;&lt; avgdur(dur)&lt;&lt;"\n"; 
      //frameCounter++;
  
      //if(frameCounter == 3600)
      //break;
  
      //imshow("frame", finalFrame);
      if(waitKey(1000/120) &gt;= 0) break;
      //waitKey(1000/120);
  }
  
   //clock_t ends = clock();
   //cout &lt;&lt; "Running Time : " &lt;&lt; (double) (ends - startTime) / CLOCKS_PER_SEC &lt;&lt; endl;
  
  system("pause");
   }
  </code></pre>