Ask Your Question

Revision history [back]

i think you can scale down your image before detection as shown here

i think you can scale down your image before detection to speed up your app as shown here

int scale = 2 ; // you can try other values       
resize( srcGray, srcGray, Size(srcGray.cols/scale , srcGray.rows/scale ), INTER_LINEAR );
cat_face_cascade.detectMultiScale( srcGray, faces, 1.2, 5 , 0 , Size(64, 64));
.
.
.
resize( srcGray, srcGray, Size(srcGray.cols*scale , srcGray.rows*scale ), INTER_LINEAR );

also look ufacedetect.cpp what to do --scale parameter

i think you can scale down your image before detection to speed up your app as shown here

int scale = 2 ; // you can try other values   Mat srcGray1;
      resize( srcGray, srcGray, Size(srcGray.cols/scale , srcGray.rows/scale ), srcGray1, Size(srcGray.cols/2, srcGray.rows/2), INTER_LINEAR );
 cat_face_cascade.detectMultiScale( srcGray, srcGray1, faces, 1.2, 5 , 0 , Size(64, 64));
 .
.
.
resize( srcGray, srcGray, Size(srcGray.cols*scale 
for( size_t i = 0; i < faces.size(); i++ )
       {
          Point center(faces[i].x * 2 + faces[i].width, faces[i].y *2 + faces[i].height );
          ellipse(srcGray, center, Size(faces[i].width , srcGray.rows*scale faces[i].height ), INTER_LINEAR );
0, 0, 360, Scalar(255, 0, 255), 4, 8, 0);
       }//endfor

also look ufacedetect.cpp what to do --scale parameter

i think you can scale down your image before detection to speed up your app as shown here

      Mat srcGray1;
      resize( srcGray, srcGray1, Size(srcGray.cols/2, srcGray.rows/2), INTER_LINEAR );
      cat_face_cascade.detectMultiScale( srcGray1, faces, 1.2, 5 , 0 , Size(64, 64));

.
.
.

for( size_t i = 0; i < faces.size(); i++ )
       {
          Point center(faces[i].x * 2 + faces[i].width, faces[i].y *2 + faces[i].height );
          ellipse(srcGray, center, Size(faces[i].width , faces[i].height ), 0, 0, 360, Scalar(255, 0, 255), 4, 8, 0);
       }//endfor

also look ufacedetect.cpp what to do --scale parameter