Face detection MATLAB - slanted and up side down

1.2k views Asked by At

I am working on a MATLAB project which enables the user to do face detection and blur them out.

Built-in functions used:

vision.CascadeObjectDetector

The problem with this function: It only detects frontal faces.

The methods I tried: Use imrotate function in a while loop to rotate the image while the degree is less then 360. So I thought that it would work. I increment the rotation by 23 everytime.

Cons: It doesn't work, it changes the spatial resolution of the image.

1

There are 1 answers

2
Dima On

I have done some experiments in the past, and I have learned that the vision.CascadeObjectDetector using the default frontal face model can tolerate about 15 degrees of in-plane rotation. So I would advise rotating the image by 15 or even 10 degrees at a time, rather than 23.

The problem with training your own detector in this case is the fact that the underlying features (Haar, LBP, and HOG) are not invariant to in-plane rotation. You would have to train multiple detectors, one for each orientation, every 15 degrees or so.

Also, are you detecting faces in still images or in video? If you are looking at a video, then you may want to try tracking the faces. This way, even if you miss a face because somebody's head is tilted, you'll have a chance to detect it later. And once you detect a face, you can track it even if it tilts. Take a look at this example.