Ask Your Question

Salvar's profile - activity

2017-12-26 11:11:22 -0600 received badge  Nice Question (source)
2016-09-26 23:17:55 -0600 received badge  Notable Question (source)
2015-09-10 01:37:11 -0600 received badge  Popular Question (source)
2013-08-14 08:46:31 -0600 received badge  Supporter (source)
2013-08-14 08:46:09 -0600 commented answer Detecting small faces in large photos using OpenCV and Python

Thanks for the answer! Most of the faces are at least 20x20, so I think this should work. I've been going through most of the APIs in the post you linked, and some look very promising. I think I'll tinker a bit with some of them before I start the weeks-long process of training my own classifier (and then maybe finding out that they don't work well). Thanks!

2013-08-14 08:44:02 -0600 received badge  Scholar (source)
2013-08-09 22:49:04 -0600 received badge  Student (source)
2013-08-09 11:11:25 -0600 asked a question Detecting small faces in large photos using OpenCV and Python

Hi!

I'm currently working on a project where I need to analyze thousands of high-resolution photos, detect visible faces and blur them out. I've read quite a bit about OpenCV (and spent a day building and playing around with it), and I feel that it's the right direction to solve this problem.

Currently, I have gotten pretty far along with OpenCV, to the point where I can process a photo, pass it to the detectMultiScale() function and use one of the provided Haar cascade files to detect a good number of faces.

However, the hit rate is still pretty abysmal no matter how I play around with the function parameters, or which cascade file I use (frontalface_default vs. frontalface_alt vs. frontalface_alt_tree). I'm perfectly fine with some false positives and false negatives, but I'm nowhere near the rate I'd call acceptable.

What I think might be causing my problems is that most of the faces in my photos are quite small, usually around 20x20 pixels. From what I've read, the default face cascade files expect larger faces (but I might very well be wrong about that). I therefore wanted to explore the option of creating my own Haar cascade classifier for the faces that appear in our photos.

However, before I start walking down that road which might take days or even weeks to travel, I have some questions that hours and hours of Googling haven't really answered for me yet. I'd appreciate any input you have on this.

My questions are:

  • How small of a face can the provided Haar cascade classifiers reliably detect (to a reasonable degree)?
  • What are best practices when it comes to building a custom haar cascade classifier for a use case such as this?
    • The use case being: Small faces in large photos of an outside environment in good lighting, ranging from profile to frontal.
  • And finally: What kind of hit detection can I reasonably expect if I go through the entire process of grabbing say, 2,000 small face positives with anywhere from 1,000 to 4,000 negatives, and build a classifier from that?

Thanks!