Ask Your Question
0

Maximum distance a face can be detected (from camera)?

asked 2015-02-25 23:15:20 -0600

safrimus gravatar image

Hello,

I am currently working on a project in which I am trying to detect a person face using OpenCV. I am able to detect the face successfully using the detectMultiScale function as long as the person is less than about 3.5 meters from the camera. Since I am new to OpenCV, I wanted to know if there was a way to increase the distance at which the user can stand? or is this a limitation of the lbpcascade_frontalface.xml file?

Thanks in advance!

edit retag flag offensive close merge delete

Comments

2

there is a minimum Size limit of 24x24 pixels.

(you can't detect something smaller than the cascades were trained upon.)

berak gravatar imageberak ( 2015-02-26 01:11:51 -0600 )edit

... but you can train a cascade with smaller data

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-26 02:24:14 -0600 )edit

^^ probably not that much. 20 seems to be lower limit

berak gravatar imageberak ( 2015-02-26 02:26:35 -0600 )edit
1

well I've trained an 14x18 LBP, and it worked pretty nice, ofcourse with a svm classifier

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-26 05:55:03 -0600 )edit

oooh, so, that's no more a Cascade or such, just a 2-class SVM ? for faces ? using integral images, too ? sounds pretty interesting !

berak gravatar imageberak ( 2015-02-26 06:01:37 -0600 )edit
1

no-no-no, I have trained an LBP cascade for faces, but because there were many false-detections, I have also trained a classifier for improve the detection.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-26 07:04:51 -0600 )edit

That makes sense. Thanks for your replies. I might train on smaller data or just use some other feature to detect the user.

safrimus gravatar imagesafrimus ( 2015-02-26 09:58:47 -0600 )edit

do not go very far in the size, you'll not get anymore the faces centered or you'll going to loose information

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-02-26 10:15:18 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
-1

answered 2015-02-27 09:50:51 -0600

It's what I'm currently doing with a project now. Your goal is to find the smallest size of an image that a face can be detected from. You've trained an LBP to detect faces, but are receiving false positives.

You can constrain the positives by using another cascade to detect for eyes. For example, you find 5 faces in an image 1024x768. 4 are real people, while one is the cascade giving a false positive (on a wall or something).

By using the eye-detection cascade, you can feed the detected faces into the eye detector. Do this with the image(cv::Rect eyes), where image is where the webcam image is stored. If then, you watch for the size of the vector<cv::rect> where the eyes are stored, you can tell if it's successful or not. If it's a null vector, it's probably ... (more)

edit flag offensive delete link more

Comments

I think that training a classifier for validating the faces is much faster than detecting the eyes...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-03-02 03:38:19 -0600 )edit

That is true. However the LBP does tend to give false positives. Since it does, you can run the faces directly through the Haar cascade that detects eyes. That is really quick. And then, if you don't detect eyes for a given face, you can throw the face out.

My way was a compromise of getting the speed of the face LBP, and the accuracy of the face Haar cascade. It's a bit more complicated, but does work.

jwcrawley gravatar imagejwcrawley ( 2015-03-03 06:51:08 -0600 )edit

your approach is good, but it has nothing to do with the real question: "Maximum distance a face can be detected (from camera)?" which is linked to the size of the training data...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-03-03 07:28:38 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-02-25 23:15:20 -0600

Seen: 2,810 times

Last updated: Feb 27 '15