Ask Your Question
0

OpenCV face detection in iPhone

asked 2012-09-24 21:02:44 -0600

Thomas_N gravatar image

updated 2012-09-25 06:01:01 -0600

Kirill Kornyakov gravatar image

Dear All,

I implement OpenCV face detection in iPhone 4. When I look at the time taken for the implementation of the function

face_cascade->detectMultiScale(*grayMat, faces, haar_scale,
                                   haar_minNeighbors, haar_flags, haar_minSize );

It takes nearly 120msec. I can't tolerate that amount of time for my application. How can I improve the performance to reduce the processing time? My configurations are:

float haar_scale = 1.15;  
int haar_minNeighbors = 3;  
int haar_flags = 0 | CV_HAAR_SCALE_IMAGE | CV_HAAR_DO_CANNY_PRUNING;  
cv::Size haar_minSize = cvSize(60, 60);

Thanks.
Thomas

edit retag flag offensive close merge delete

Comments

1

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-09-25 06:37:06 -0600

Kirill Kornyakov gravatar image
  1. Try to use LBP features instead of Haar. It may give you ~3x speedup. Cascade file for the LBP face detector is available in the OpenCV repository.
  2. Try to increase haar_minSize parameter, because it greatly affects the speed.
  3. Right now you can try CV_HAAR_FIND_BIGGEST_OBJECT, on mobiles it is sometimes true that you need only the largest face.
  4. You can also try to use DetectionBasedTracker class which does tracking. It greatly reduces apparent processing time, because slow detection is performed in a background thread.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-24 21:02:44 -0600

Seen: 1,563 times

Last updated: Sep 25 '12