How To Build A Face Detector?

3D faceEver wondered if you can build a working face detector quickly? If you are in computer vision, you would have built a face detector one time or the other. If not, then you will be able to build one by the end of this post. This blog post is not about the concept or the algorithm behind real time face detection. We will only deal with building one. If you are not willing to get your hands dirty, then this post wouldn’t be very useful to you.


As with most computer vision projects, this one is built on OpenCV as well. If you haven’t installed OpenCV yet, you can check out this blog post. Even though the installation procedure is for Mac OS X, it should work on most *nix style machines. The installation instructions in that post utilize the command line, which is generic. So you should be good to go as long as you have cmake. It’s pretty straightforward!

Building A Face Detector

Now we are ready to build a real time face detector. OpenCV comes with a sample face detection project, but the problem is that the code is too big. Unless you spend some time with it, you will not be able to understand what’s going on. So I have stripped it down to its most basic form. You can get the code here. The code is documented pretty well (at least I think so). So have fun with it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s