OpenCV Never Forgets a Face

All the cool phones now are doing facial recognition. While that sounds like a big job, you can add face detection and recognition easily to your projects if you can support the OpenCV library. [LinuxHint] has a great tutorial that steps you from the basics of OpenCV to actually acquiring and identifying faces. It is aimed at Ubuntu users, but the code would apply to any OpenCV-supported platform. You can also see a less detailed tutorial to learn more about installing OpenCV on the Pi Zero from [DanishMalhotra].

Of course, any facial recognition system is going to need a camera. The nice thing about the first tutorial is that it assumes you know nothing about OpenCV, so it covers the basics on up to using the face-related libraries.

There are two distinct operations to accomplish for face recognition. The first is to simply identify that the image contains a face. This is useful all by itself sometimes (for example, a selfie camera or a Snapchat-like filter). OpenCV provides the Haar cascade face detector that uses some Haar classification algorithms to quickly find patterns in images.

Once you find a face, Eigenfaces can recognize it by matching regions to a known database of face types. There are several databases the tutorial discusses that you can use.

The more building blocks you have, the easier it is to make impressive projects. OpenCV is certainly a high-powered building block. If you want to do the Eigenface algorithm on something smaller, it is certainly possible.

12 thoughts on “OpenCV Never Forgets a Face

  1. The final link to the cornell ee & ce program was facinating! I can’t wait to incorporate it into one of my projects. Overhead has always been the main roadblock for me and AI. (having never bought a computer but my 3 Pis firsthand)

  2. That Face Recognition tutorial (by LinuxHint) is a duplicate of my tutorial “http://shervinemami.info/faceRecognition.html”! Most of the page is copied word-for-word from my page that I wrote 7 years ago! Please replace your link to LinuxHint’s page with a link to my page or one of the other genuine Face Recognition tutorials online that use original content. If you need proof whether I was the original author or if LinuxHint is, you can view my webpage stats at the bottom of the page to see it has been around for 7 years, or notice that I have also written about Face Recognition in various places including in the book “https://www.amazon.com/Mastering-OpenCV-Practical-Computer-Projects/dp/1849517827”.

    1. The code is the same, but the explanation is certainly not a “word for word” copy of yours. I haven’t read all of either of them, so maybe there’s deeper similarities I didn’t pick up on. But you’ve certainly over stated the level of copying he’s done.

      1. Pretty much all of section 4 (the main section) is copied mostly word-for-word, they just changed 1 or 2 words per sentence, probably to make it less obvious as a duplicate. And they removed some of the sentences or paragraphs that explain the maths & theory. But it’s still a duplicate of my work that they didn’t ask me permission to re-use.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s