Category: 

What Is OpenCV Face Detection?

Article Details
  • Written By: Alex Newth
  • Edited By: Angela B.
  • Images By: ビッグアップジャパン, Carlosseller
  • Last Modified Date: 25 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
In late 19th-century London, mail was delivered to residential addresses up to twelve times each day.   more...

September 28 ,  1924 :  Two US military planes complete the first flights around the world.  more...

Open Source Computer Vision Library (OpenCV) is a program that comes with many modules and scripts for advanced video techniques on a computer. One of the scripts is OpenCV face detection, which uses a webcam to detect faces. As of 2011, many programmers are working on a way to expand this module to recognize a particular face instead of just recognizing whether a face is captured. This system works by recognizing common facial attributes, such as eyes and mouth, to determine whether a real face is being displayed.

In the OpenCV program library, there is a script called Haar Cascade. This module provides a facial detection system, but the detection has limited capabilities. The OpenCV face detection, without modification, can only detect if a face is displayed. This is done by accessing the computer’s webcam and checking the video that returns. If common facial attributes such as eyes and mouth are detected, then the OpenCV facial detection system will say a face is present.

New OpenCV users may have difficulty finding the facial recognition script. Like many other scripts, this is stored in the “Samples” section. By accessing the script, OpenCV can automatically use the recognition system without the programmer having to install the script manually.

Ad

Many programmers are working on the OpenCV open-source interface to improve the OpenCV face detection system. Instead of just recognizing whether a face is displayed by the webcam, the modified system is expected to recognize specific faces. This is primarily done by taking an image of someone’s face, showing that person on the webcam, and then comparing the two images. If the images are similar, then the facial detection will say the person is the same as in the stored image.

Some problems are apparent in the OpenCV face detection system, mostly with how effective the detection is. These problems come mostly from facial coordinates, such as where the eyes are. If the eyes or other facial elements are not where OpenCV expects them to be, then it will say a face is not present, even if one is. This requires programmers to manually enter the coordinates by hand each time the facial interface is used.

OpenCV face detection has a few uses beyond just being fun and giving programmers a way to enhance their skills. Facial detection can be used for security, especially when modified to recognize specific faces. This can also be used to easily store facial images from a webcam, instead of accidentally capturing other images.

Ad

You might also Like

Recommended

Discuss this Article

Mammmood
Post 4

@NathanG - For security purposes, I think you could combine a face detection algorithm with a motion detection algorithm.

Motion detection works by looking for shifting images in a frame of video – those shifting images are classified as motion. The detection of motion is done by comparing one frame to the next to see if any pixels changed.

If you combine this with the facial recognition algorithm, you not only know that someone moved, but you can get a close up on who it is. That would provide the ultimate security and deterrence in the end.

NathanG
Post 3

@Charred - I agree. I don’t think that eye detection should be all that hard. Let’s remember that this is open source software however. There may be commercial products that do the job better.

For example, I have a facial animation program. What it does is takes a facial image, like from a still photo or clip art, and then animates it and lip syncs it according to whatever audio track you provide.

The program automatically detects the location of the eyes and the mouth, although you can tweak the coordinates just like the OpenCV face detection software does.

Charred
Post 2

@everetra - I don’t understand why the face detection algorithm would have a hard time determining where the eyes are. It seems to me that this is the most prominent part of the facial features.

After all, you have two ovals with mostly white, and then different pigmentation in the center depending on the color of the eye. If I were writing the application the first thing that I’d have the program do is to zero in on the eyes, and then work itself out from there. That approach seems like it should work most of the time.

everetra
Post 1

I would think that pattern recognition is the key concept behind this kind of software. I read a book on image enhancement algorithms once and it showed how you could use computer code to apply different effects to an image.

There was a lot of smart technology in the code, where it used pattern recognition to determine certain sets of features and stuff. I think the concept would apply here.

The OpenCV library looks at patterns of pixels to determine what part of the image is a “face” and what part is a background. I would think it would look at color values too, like darker, reddish colors for the pigmentation of the skin.

I don’t think that it would be foolproof but it should deliver positive results most of the time.

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}