- Open Access
- Total Downloads : 114
- Authors : Bahajathul Fathema , Alamuri Dedeepya Lakshmi , Bandlamudi Ravali , Raja Rajeswari Dokku
- Paper ID : IJERTV7IS020120
- Volume & Issue : Volume 07, Issue 02 (February 2018)
- DOI : http://dx.doi.org/10.17577/IJERTV7IS020120
- Published (First Online): 26-02-2018
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License: This work is licensed under a Creative Commons Attribution 4.0 International License
Real Time Face Detection Using Matlab
(Using Viola-Jones Algorithm)
Bahajathul Fathema Electronics and Communication Engineering VasireddyVenkatadri Institute of Technology
Guntur, India.
Alamuri Dedeepya Lakshmi Electronics and Communication Engineering VasireddyVenkatadri Institute of Technology
Guntur, India.
Bandlamudi Ravali
Electronics and Communication Engineering VasireddyVenkatadri Institute of Technology Guntur, India.
Raja Rajeswari Dokku Electronics and Communication Engineering VasireddyVenkatadri Institute of Technology
Guntur, India.
Abstract—This electronic document is about face detection. In computer literature face detection has been one of the most studied topics. Given an arbitrary image, the goal of this project is to determine whether or not there are any faces in the image and detection of eyes and upperbody. While this appears to be a trivial task for human beings, it is very challenging task for computers. The difficulty associated with face detection can be attributed to many variations in scale, location, view point, illumination, occlusions, etc. Although there have been hundreds of reports reported approaches for face detection, if one were asked to name a single face detection algorithm that has most impact in recent decades, it will most likely be the Viola and Jones face detection, which is capable of processing images extremely rapidly and achieve high detection rates. In thiswe are going to study and understand the Viola- Jones algorithm by implementing the detection frame work and based on that implementation, conduct experiment to improve the performance.
Keywords Face Detection, Challenges, Haar, Adaboost, Cascade Classifier.
-
INTRODUCTION
In the past 10 years, there has been an exponential development in the field of image processing. New generation computers are becoming smarter and faster to process Terabyte of data. Object recognition that gained attention in the field because of its utility in industries such as manufacturing, packing etc. Super market is the common example and that uses a barcode to identify a product. A manufacturing unit employs a device that needs to find the position of the object accurately. For example, the bottle filler robotic arm needs a computer vision and that is used to detect the structural nature of the object. Computer vision allows the computer to sense the object and process the desired information at blazing speeds. Just like eyes are the source forhuman, a camera is the source for computer.
Face detection is also a part of theobject detection. Face detectioncan be classified into two classes (face and non- face).
These applications are needs to locate the position of the face in the image or video. Moreover, it has added a much needed aspect of security in the recent years.Some of the key implementations of face detection are the Biometric systems, a front sided camera (selfie) of a smart phone, human presence detection. Basically face detection senses
the presence of the facein a 2D frame. Several methods and approaches are developed for the face detection.
Depending on the data feed into the computer, the results are generated by it. The correctness and the reliability of the algorithm used. Some parameters are used as a standardto evaluate the performance of the face detectors
-
Learningtime: Thetime required to adapt and improve the reliability to differentiate between a face and non-face.
-
Samples needed for training: More accuracy is obtained by the more number of the samples and the result obtained sacrificing the speed of detection,
-
The ratio between detection rate and false alarm,d)Execution time.
In section3, some factors affecting the face detection algorithm are discussed. Section 4 describes the commonly used face detection approaches. Section 5 throws the light on the viola Jones method with adaptive boost learning.
-
-
LITERATURE REVIEW
Over the years many contributions were done to the field of face detection and recognition. G.Yung came with multiresolution rule method. This is the knowledge based method and it is used to detect the face by using the structural nature of the face [4]. Feature based method uses the facial features [5][6], skin colour [7][8] and it is combined with the multiple features [9] of the face for better accuracy and detection speed, the accuracy is sacrificed. Template matching method was employed. For this steady and uniformly scaled images are used. Predefined face templates [10] and deformable templates [11] were introduced which was completely a predefined structure without using learning. Appearance based methods gives faster and more accurate resultsthat could distinguish a face from a non-face in any environmental conditions. For getting desired resultsNeutral networks models[12] are commonly used.
-
CHALLENGES
The challenges corresponding to the face detection can be attributed to the following factors:
-
Head pose:
As the human head is somewhat like a sphere in 3D space so it is difficult to get the image of the face facing to the viewerand at the centre position all time as shown in fig
-
Due to this, sometimes an eye, partial nose cannot be viewed properly [13]. Hence that may appear in half profile and would rather make it easy to detect the face.
Fig.1. Head rotated in horizontal direction.
-
-
Image orientation:
An image can be upside-down or can be mirror image of original image. This can foil theprocess of face detection. Fig.2,Shows the orientation of the face in a 3D space.
Fig.2.same face in different pose.
-
Obstruction in front of the face:
Haar features are used to classify the detection object in the viola jones method. It is based on the difference in the intensity level of the different parts of the face and is used to detect weather it is face or not. Due to the presence of another object in front of the face it is difficult to detect the required feature of the face. In the basic face detection method to increase the efficiency more features with more data points are incorporated. Some of the cases such as the sun glass on face, mouth covered, eyes covered as shown in fig.3, In addition to thesefactors, object infront of the face or else hair in front of the face can also affect the face detection.
Fig.3.Simple occluded face images.
-
-
FACE DETECTION METHODS
Fig.4.Commonly used face detection methods
-
Feature based
The unique elements of the face are used in the feature based approach. A face can be detected using the elements such as eyes, nose and lips. The feature based approach is reliable because the structure and size of these elements are different from those of the non-face. The face of the subject always contains these elements and their position is related to each other. Nowadays, skin is used to detect the face as a human skin has unique texture and colour than that of non- face objects. The desired region can be highlighted using edges, which play a very important role. For this purpose blobs and contours are used. Feature based approach needs to localize the face on image. In this method we find the skin region and if we find at least one eye in the frame it is said to be valid. The next step is facial features identification (fiducial points). To detect the eye pupil from the eye detect region the H-plane of the HSV colour space is used.
In order to minimize the eye look for an area, we assuming hat the eyes expected position to be at upper portion of the face. For eye detection Haar-like features cascade is used. It locates the eyes in the rectangular regions. By taking the Hue information of the eye image, an algorithm is developed to locate the eye pupils in a given ROI of eyes. In the threshold image, the threshold and contour of hue image is detected.Centroid of the contour is detected as the eye pupil. Next, by using Haar-like features we can detect the nose of the object. Based on the facial geometry for mouth location estimation, an approach is proposed that having known eyes centre and the position of the nose. The detected face location of the other element of the face can be known by maintaining the uniform distance between the eye and the nose tip.
Advantage:
-
Features are invariant to pose and orientation change.
Disadvantage:
-
Hardship to locate facial features because of several corruptions (illumination, noise, occlusion).
-
Difficult to detect features because complex background.
-
-
Knowledge based
Knowledge based approach is also known as Top-down approach. This method mainly uses the geometrical nature of the face. The two eyes of the human face are symmetrical to each other and the nose is at centre point of the face.
G.Yang and T.S. Huang presented an algorithm for rule based face detection in frontal views for multi resolution image. In this algorithm a set of human coded rules are used to represent the face of the object. Fig. 5,the general steps are
-
The centre part of face has uniform intensity values.
-
The difference between the average intensity values of the centre part and the upper part is significant.
-
A face often appears with two eyes that are symmetric to each other, a nose and a mouth.
Fig.5.A typical face used in knowledge-based top-down methods
There are three levels in these methods: Level 1(lowest resolution):
Apply the rule the centre part of the face has 4 cells with a basically uniform intensity to search for candidates.
Level 2: Local histogram equalization followed by edge equalization followed by edge detection.
Level 3: Search for eye and mouth features for validation.
Fig.6. (a) n = 1, original image. (b) n = 4. (c) n = 8. (d) n = 16.Original and corresponding low resolution images. Each square cell consists of n x n pixels in which the intensity of each pixel is replaced by the average intensity of the pixels in that cell.
This test was carried out on 60 images. The method detected face in 50 images with 28 as false face detection. One attractive features of this method is that a coarse-to-fine or focus-of-attention strategy is used to reduce the required computation.
-
-
Appearance based
To find the relevant features of face and non- face, it relays on techniques from statistical analysis and machine learning. . The learned characteristics are in the form of distributed models or discriminant functions that are consequently used for face detection[16]. For better computational efficiency dimensionality of the image is reduced. This method uses classification and uses the
features in the search window. In this method commonly used features are census transform and Haar- like features. The statistical method needs learning between the enormous instances. To create a cascade classifier of multistage adaboosting combines some weak classifiers. An image containing face has some strong classifiers and weak classifiers. In order to detect the weak classifier a search window is used and if it is above the certain threshold then it passes the weak classifier to strong classifier. This methods of this method is the non-face window is easily rejected which increases the speed and accuracy. Multilayer perceptron neural network, support vector machine, Hidded markov model, principal component analysis are some examples.
Methodology is explained in Fig.7, at first pre- processing of input image is done. In this pre-processing treatment includes rotation, scaling and quantizing. Then the classifiers are used for labelling and distinguishing the data. Post processing contours around the detected face.
Fig.7. Facial feature recognition for classification
Advantages:
-
Use powerful machine learning algorithms.
-
Has demonstrated good empirical results.
-
Fast and fairly robust.
-
Extended to detect faces in different pose and orientation.
Disadvantages:
-
Usually needs to search over space and scale.
-
Need lots of positive and negative examples.
-
Limited view-based approach.
-
-
Template matching
It is commonly used in the systems where there is high possibility of getting a human face. Predefined structure of uniform size and shape of template is used and that makes the detection of the desired object and it is easy to comparing the template with objects. In case of face detection, the template matching finds the relation between
the input image or video and the face patterns or the features Fig.8, shows a template for face detection.
Fig.8. A template of human face shape oriented in vertical and rotated form
Template matching method is deformable and based on the facial contours. Unlike the appearance based method which uses neural network, templates are hand coded (not learned) and uses correlation to locate the faces.
Advantages:
-
Simple method
-
Include less amount of data points for face detection
Disadvantages
-
For frontal views, face must be having occlusion
-
Face(s) must of same size as that of the template
-
This method is dependent to size, scale and rotation
-
Computational efficiency is less
-
To cover more views of the face, more number of templates are needed and hence needs more time to detect a face.
-
-
-
VIOLA JONES APPROACH
In order to detect an object using a camera, viola and jones algorithm is one of the fast and accurate approaches. All the smart phones and digital cameras manufacturers are adapting these techniques to enhance the focus. Haar and adaboost features help the algorithm to detect the face in a fraction of second. Then, they are subtracted from the total of white boxes. Finally, the result will be compared to the defined threshold and if the criteria are met, the feature considers a hit
Fig.9. Flow chart of the algorithm
This approach is used to detect the objects combines four key concepts:
-
Simple rectangular features, Haar-like features.
-
Integral image for rapid feature detection.
-
Adaboost machine- learning method.
-
Cascaded classifier to combine many features efficiently.
-
Haar like features
Haar like features are used todetect variation in the black and light portion of the image. This computation forms a single rectangle around the detected face. Based on the colour shade near nose or forehead a contour is formed. Some commonly used Haar features are:
-
Two rectangle feature.
-
Three rectangle feature.
-
Four rectangle feature.
(a)
(b)
(c)
Fig.10. (a) Two rectangle feature (b)Three rectangle feature (c)Four rectangle feature
The value of two rectangle feature is the difference between the sums of the pixels within the two rectangle regions as shown in fig.10, in three rectangles, the value is centre rectangle subtracted by the addition of two surrounding rectangles. Whereas four rectangle features computes the difference between the diagonal pairs of the rectangles[20]. Fig.10, Two features of Haar.
Haar-like feature can be calculated with the following equation [13] :
Feature =ie{1N}wi.RecSum (x,y,w,h) —–(1)
Where RecSum (x,y,w,h) i the summation of intensity in any given upright or rotated rectangle enclosed in adetection window and x, y, w, h are for coordinates, dimensions, and rotation of that rectangle, respectively. Haar Wavelets represented as box classifier which is used to extract face features by using integral image which is described in the next section.
-
-
Integral Images
They are also known as summed area tables. Integral image is used to felicitate quick feature detection. The meaning of integral image is the outline of the pixel values in the original images.
The integral image at location (x,y) contains the sum of the pixels above and to the left of (x, y) inclusive
II (x, y) = i(x, y)
x x, y y
As can be seen from Fig.11, each location of x and y in the integral image is the sum of pixel values in above and left location of x and y [21].
Fig.11. Demonstration the concept of integral image
Fig.12. Finding the sum of shaded rectangular area
For instance in Fig.12, let 1,2,3,4 be the values of the integral image at the corner of a rectangle, next the sum of original image values within the rectangle can be computed as the below equation and only 3 additions are required for any size of the rectangle.
SUM = 4-2-3+1
Value = (pixels in white area) – (pixels in black area) (3)
-
Adaboost machine learning method
For combining different classifiers of same data set this algorithm uses concept of bagging .The purpose of this concept is to improve an unstable classifier where a small change in the learning set produces a large change in the classifier.
We use adaboost algorithm to select small features from the face which helps to compute the image fast and easily. This method gives desired region of the object discarding unnecessary background. This model can be interpreted by using neural networks.
Adaboost learning method is fast and it gives desired data. This data can be classified into classifier which contains small features commonly employed for pattern detection. It has high accuracy and detection speed but requires more time to train.
-
Cascade classifier
This algorithm (viola and jones) eliminates the face candidates quickly using cascade of stages making stricter requirements in each stage with further stages become difficult to candidate to pass if they fail in any one of the stage. If the candidate passes all the stages then the face is said to bedetected.
Graphical user interface(GUI):
The real-time face detection program is developed using any higher version of MATLAB. A graphic user interface allows users to perform tasks interactively by using controls likes switches and sliders. GUI can be created easily and can be run in MATLAB or be used as stand- alone application.
OUTPUTS:
Fig.13. Detection of eyes
Fig.14. Detection of face
Fig.15. Detection of upper body
-
-
CONCLUSION
In this paper, we have discussed about the commonly used face detection methods. These methods signify the importance and utility for different applications. Since these methods are dynamic, much advancementis made every day to achieve accurate and true face detection.
This approach of detecting face was derived by viola and jonesto increase computational efficiency. All the smart phones and digital cameras manufacturers are adapting these techniques to enhance the focus. Haar and adaboost features help the algorithm to detect the face in a fraction of second.
REFERENCES
-
Hsu, Rein-Lien, Mohamed Abdel-Mottaleb, and Anil K. Jain. "Face detection in color images." Pattern Analysis and Machine Intelligence, IEEE Transactions on 24.5 (2002): 696-706.
-
A.S. Georghiades, P.N. Belhumeur, D.J. Kriegman, From few to many: illumination cone models for face recognition under variable lighting and pose, IEEE Trans. Pattern Anal. Mach. Intell. 23 (6) (2001) 643660.
-
MayankChauha and MukeshSakle. Study & Analysis of Different Face Detection Techniques. International Journal of Computer Science and Information Technologies, Vol. 5 (2), 2014, 1615-1618.
-
G. Yang and T. S. Huang, Human Face Detection in Complex Background, Pattern Recognition, vol. 27, no. 1, pp. 53-63, 1994.
-
T.K. Leung, M.C. Burl, and P. Perona, Finding Faces in Cluttered Scenes Using Random Labeled Graph Matching, Proc. Fifth IEEE Intl Conf. Computer Vision, pp. 637-644, 1995.
-
K.C. Yow and R. Cipolla, Feature-Based Human Face Detection, Image and Vision Computing, vol. 15, no. 9, pp. 713-735, 1997.
-
J. Yang and A. Waibel, A Real-Time Face Tracker, Proc. Third Workshop Applications of Computer Vision, pp. 142- 147, 1996.
-
S. McKenna, S. Gong, and Y. Raja, Modelling Facial Colour and Identity with Gaussian Mixtures, Pattern Recognition, vol. 31, no. 12, pp. 1883-1892, 1998
-
R. Kjeldsen and J. Kender, Finding Skin in Color Images, Proc. Second Intl Conf. Automatic Face and Gesture Recognition, pp. 312- 317, 1996.
-
I. Craw, D. Tock, and A. Bennett, Finding Face Features, Proc. Second European Conf. Computer Vision, pp. 92-96, 1992
-
A. Lanitis, C.J. Taylor, and T.F. Cootes, An Automatic Face Identification System Using Flexible Appearance Models, Image and Vision Computing, vol. 13, no. 5, pp. 393-401, 1995.
-
H. Rowley, S. Baluja, and T. Kanade, Neural Network-
Based Face Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 20, no. 1, pp. 23-38, Jan. 1998.
-
Sharifara, Ali, et al. "A general review of human face detection including a study of neural networks and Haar feature-based cascade classifier in face detection." Biometrics and Security Technologies (ISBAST), 2014 International Symposium on.IEEE, 2014.
-
Zhengming Li; LijieXue; Fei Tan, "Face detection in complex background based on skin color features and improvedAdaBoost algorithms," Progress in Informatics and Computing (PIC), 2010 IEEE International Conference on , vol.2, no., pp.723,727, 10-12 Dec. 2010.
-
Campadelli, Paola, RaffaellaLanzarotti, and Chiara Savazzi."A feature-based face recognition system."ImageAnalysisand Processing, 2003.Proceedings. 12th International Conference on.IEEE, 2003.
-
Yang, Ming-Hsuan, David J. Kriegman, and NarendraAhuja. "Detecting faces in images: A survey." Pattern Analysis and Machine Intelligence, IEEE Transactions on 24.1 (2002): 34- 58.
-
Xiaowei Zhao, XiujuanChai ,"Context Constrained Facial Landmark Localization Based on Discontinuous Haar-like Feature" International Conference on Computer Vision (ICCV2013),2013.
-
Paul Viola, Micheal Jones, "Rapid object detection using a Boosted Cascade of Simple features" CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION, 2001.
-
Lienhart and J. Maydt. An Extended Set of Haar-like Features for Rapid Object Detection. IEEE ICIP 2002
-
MonaliChaudhari, GaureshVanjare, DhairyaThakkar, Malay Shah and AmitKadam, Intelligent Surveillance and Security System, Vol. 3, Issue 3, March 2015, pp. 2291- 2299.
-
Cordiner, A.; Ogunbona, P.; Wanqing Li, "Face detection
using generalised integral image features," Image Processing (ICIP), 2009 16th IEEE International Conference on , vol., no., pp.1229,1232, 7- 10 Nov. 2009.
-
Ms.Drashti H. Bhatt ,Mr.Kirit R. Rathod , Mr.Shardul J. Agravat. Article: A Study of Local Binary Pattern Method for Facial Expression Detection. International Journal of Computer Trends and Technology (IJCTT) 7(3):151-153, January 2014. Published by Seventh Sense Research Group.