Face detection in Matlab with source code
Face
Detection
Object detection and tracking are important
in many computer vision applications, including activity recognition,
automotive safety and surveillance. Presented here is an face detection
using MATLAB system that can detect not only a human face but also eyes and
upper body.
Face detection is an easy and simple task for humans, but
not so for computers. It has been regarded as the most complex and challenging
problem in the field of computer vision due to large intra-class variations
caused by the changes in facial appearance, ligh
ting and expression. Such
variations result in the face distribution to be highly nonlinear and complex
in any space that is linear to the original image space.
Face detection is the process of identifying one or more
human faces in images or videos. It plays an important part in many biometric,
security and surveillance systems, as well as image and video indexing systems.
WHAT IS
FACE DETECTION?
The definition of face detection refers to a subset of
computer technology that is able to identify people’s faces within digital
images. Face detection applications employ algorithms focused on detecting
human faces within larger images that might contain landscapes, objects and
other parts of humans.
HOW FACE DETECTION WORKS
Face detection technology might begin by searching for human
eyes. It might do this by testing valley regions in the gray-level image. It
might then use a genetic algorithm to detect facial regions including eyebrows,
the mouth, nose, nostrils and the iris. The algorithm would first identify
possible facial regions and then apply additional testing in order to validate.
APPLICATIONS OF FACE DETECTION
Photography– Facial
detection technology is being used more frequently in photography as a way to
help cameras autofocus on peoples’ faces. Another application is smile
recognition, which helps people take pictures at the perfect moment in order to
capture smiles.
Facial Recognition– One
of the most prevalent uses of face detection is a facial recognition system. A
facial recognition system matches an individual’s face instantly against a
database of photographs in order to establish identity. Facial recognition
tools are used to secure phones and apps. They are also used by retail
companies, airports, stadiums and other organizations in order to improve
security.
People Counting and Marketing – Face detection is being used by some marketers in order to
detect when people walk by a certain area. Face detecting systems can use
algorithms to predict age, gender and other factors in order to serve up
relevant advertisements.
Code Steps for Face detection:
1. load the image on the screen: I = imread('your image
name');
2. read the image
3. show the image % imshow(I)
4. than apply the code of face detection % FDetect= vision.CascadeObjectDetector;
%uploading an image
in the above code i have initialized the variable by name of
FDetect than vision. cascadeObjectDector is the cascade object detector uses
the Viola-Jones algorithm to detect people’s faces, noses, eyes, mouth, or
upper body.
5. %face detection
x=step(FDetect,I);
step calculates the step response of a
dynamic system. For the state-space case, zero initial state is assumed. When
it is invoked with no output arguments, this function plots the step response
on the screen.
6. adding color for face detection of your
choice e.g red, blue, green
for i=1:size(x,1)
rectangle('position',x(i,:),'LineWidth',5,'LineStyle','-','EdgeColor','g');
These are just few lines of code by which
face can easily be detected
I am sharing the screen shot of my code
with output:)
Output:)
Comments
Post a Comment