Automated Face Detection System


Published on

Presentation about the project of face detection automation .

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • O O Face recognition can be categorized into appearance-based, geometry-based, and hybrid approaches.
  • O O Face recognition can be categorized into appearance-based, geometry-based, and hybrid approaches.
  • O O Face recognition can be categorized into appearance-based, geometry-based, and hybrid approaches.
  • Automated Face Detection System

    1. 1. openCV based image processed attendence system 1.abhiroop ghatak 2. rohit verma 3. sunny Jain 4. vivek mittal Under the guidance of Sangeetha jaganathan <ul><ul><ul><li>openCV based image processed attendance system </li></ul></ul></ul>1. rohit verma 2. sunny Jain 3. vivek mittal 4. abhiroop ghatak
    2. 2. Problem Statement <ul><li>: Given an image, to identify it as a face and/or extract face images from it. </li></ul><ul><li>To retrieve the similar images (based on a heuristic) from the given database of face images. </li></ul>
    3. 3. System steps
    4. 4. Intro. to openCV <ul><li>(OPEN Source Computer Vision) A library of real time computer vision routines from Intel. First released in 2000, Open CV code is used in applications such as object, face and gesture recognition, lip reading and motion tracking. </li></ul>
    5. 5. <ul><li>Example applications of the OpenCV library are Human-Computer Interaction (HCI); Object Identification, Segmentation and Recognition; Face Recognition; Gesture Recognition; Motion Tracking, Motion Understanding; and Mobile Robotics. </li></ul>
    6. 6. Applications  Access Control
    7. 7. Features <ul><li>Image and video I/O </li></ul><ul><ul><li>file and camera based input, image/video file output </li></ul></ul><ul><li>Image data manipulation </li></ul><ul><ul><li>allocation, release, copying, setting, conversion </li></ul></ul><ul><li>Matrix and vector manipulation, and linear algebra routines </li></ul><ul><ul><li>products, solvers, eigenvalues, </li></ul></ul><ul><ul><li>Various dynamic data structures </li></ul></ul><ul><ul><li>lists, queues, sets, trees, graphs </li></ul></ul><ul><li>Basic image processing </li></ul><ul><ul><li>filtering, edge detection, corner detection, sampling and interpolation, color conversion, morphological operations, histograms, image pyramids </li></ul></ul>
    8. 8. Modules <ul><li>OpenCV Functionality </li></ul><ul><li>-more than 350 algorithms </li></ul><ul><li>Cxcore </li></ul><ul><ul><li>Data structures and linear algebra support. </li></ul></ul><ul><li>cv </li></ul><ul><ul><li>Main OpenCV functions. </li></ul></ul><ul><li>Cvaux </li></ul><ul><ul><li>Auxiliary (experimental) OpenCV functions . </li></ul></ul><ul><li>Highgui </li></ul><ul><ul><li>GUI functions. </li></ul></ul>
    9. 9. Why is Managing OpenCV Objects Important ? <ul><li>Video, 30 frames per second </li></ul><ul><li>Each frame is an image </li></ul><ul><li>Images are arrays of pixels </li></ul><ul><li>A 640x480 image is 307,200 pixels </li></ul><ul><li>These must be represented in memory </li></ul><ul><li>How much memory does your machine have? </li></ul>
    10. 10. How Does OpenCV Represent Images? <ul><li>IplImage : Structure from Intel Image Processing Library </li></ul><ul><li>In addition to representing the image data IplImage holds utilizes a subset of IPL data useful in IP/CV: </li></ul><ul><li>IPL(Intel Image Processing Library) Image class. </li></ul><ul><li>IplImage is subclass of CvMat. IplImage support ROI(region of interest) and COI(color of interest). Most of CvMat method support ROI, and some of CvMat method support COI. </li></ul><ul><li>nSize : Size of Image </li></ul><ul><li>nChannels : Number of Image Channels (1-4) </li></ul><ul><li>width, height </li></ul><ul><li>ROI : Region of Interest </li></ul>
    11. 11. Handling IplImage <ul><li>When allocating IplImage in a loop be sure to deallocate in the loop as well </li></ul><ul><li>cvCreateImage ( CvSize size, int depth, int channels ); </li></ul><ul><li>header = cvCreateImageHeader (size,depth,channels); </li></ul><ul><li>cvCreateData (header); </li></ul><ul><li>cvCloneImage ( const IplImage* image ); </li></ul><ul><li>cvLoadImage ( const char* filename, int iscolor=1 ); </li></ul>Creating an IplImage <ul><li>The first two functions are useful for creating a blank image of the specified parameters. A possible use is in functions that require a pointer to a result. </li></ul><ul><li>The clone function performs an exact copy of the IplImage* parameter. </li></ul><ul><li>The load function loads an image from a file. </li></ul><ul><li>cvReleaseImage( IplImage** image ); </li></ul><ul><li>cvReleaseData( *image ); </li></ul><ul><li>cvReleaseImageHeader( image ); </li></ul>Destroying an IplImage <ul><li>cvReleaseImage will work for the 3 single step creation functions </li></ul><ul><li>The cvReleaseData / cvReleaseImageHeader combination is used when there is separate data and header information </li></ul>
    12. 12. Utilizing IplImage <ul><li>The IplImage structure makes it possible to target specific regions of an object for processing. </li></ul><ul><li>cvSetImageROI( IplImage* image, CvRect rect ); </li></ul><ul><li>cvResetImageROI( IplImage* image ); </li></ul><ul><li>cvGetImageROI( const IplImage* image ); </li></ul>Setting the Region of Interest (ROI ) Setting the ROI of the image allows the user to select a rectangular region of the image to work with. This is useful after localizing objects for extraction and further processing. While the region is set the rest of the image will be ignored. Meaning any operation directed on the image will act on only the region (including cvShowImage ). <ul><li>cvSetImageCOI( IplImage* image, int coi ); </li></ul><ul><li>cvGetImageCOI( const IplImage* image ); </li></ul>Setting the Channel of Interest (COI ) Setting the channel of the image allows the user to work with a particular layer of the image. i.e. The ‘R’ layer of an RGB image or the ‘V’ layer in the HSV format. NOTE: Not all OpenCV functions support this.
    13. 13. Other Static Array Types <ul><li>OpenCV uses the CvMat* as its general purpose matrix structure. It is managed in an equivalent style to IplImage* </li></ul><ul><ul><ul><ul><ul><li>CvMat </li></ul></ul></ul></ul></ul><ul><li>cvCreateMat( int rows, int cols, int type ); </li></ul><ul><li>mat = cvCreateMatHeader( rows, cols, type ); </li></ul><ul><li>cvCreateData( mat ); </li></ul><ul><li>cvCloneMat( const CvMat* mat ); </li></ul><ul><li>cvReleaseMat( CvMat** mat ); </li></ul><ul><li>OpenCV also has built in functions for mult-dimensional arrays (CvMatND) and sparse arrays (CvSparseMat). </li></ul>
    14. 14. Face detection Face recognition
    15. 15. <ul><li>Detecting a specified object class within a image. </li></ul><ul><li>Object detection has many applications in computer based vision. </li></ul><ul><ul><li>Object tracking, object recognition, scene surveillance. </li></ul></ul><ul><li>The focus of this project was to implement object detection, and to detect objects of the class face. </li></ul>what is object detection ?
    16. 16. <ul><li>Face detection is an important component of a video information retrieval system. </li></ul><ul><li>This research focuses on the upright-frontal face detection problem. </li></ul><ul><li>System flow chart : </li></ul>Resize image Image Contrast stretching Face Detection Faces Non-faces Transform to integral images
    17. 17. Paul Viola and Michael Jones technique <ul><li>Devised a technique that was both robust and very quick. </li></ul><ul><ul><li>15 times quicker than any technique at the time of release. </li></ul></ul><ul><li>A detection algorithm that could be operated in real-time. </li></ul><ul><ul><li>95% accuracy at around 17fps. </li></ul></ul><ul><li>Understanding is the primary goal. </li></ul><ul><li>It is a good technique ! </li></ul>
    18. 18. The Viola-Jones Technique(contd..) <ul><li>Feature extraction and feature evaluation. </li></ul><ul><ul><li>Rectangular features are used, with a new image representation their calculation is very fast. </li></ul></ul><ul><li>Classifier training and feature selection using a method called AdaBoost. </li></ul><ul><ul><li>A long and exhaustive training process. </li></ul></ul><ul><li>A degenerate decision tree of classifiers is formed. </li></ul><ul><ul><li>The key to the techniques speed. </li></ul></ul>
    19. 19. Features <ul><li>Four basic types. </li></ul><ul><ul><li>They are easy to calculate. </li></ul></ul><ul><ul><li>The white areas are subtracted from the black ones. </li></ul></ul><ul><ul><li>A special representation of the sample called the integral image makes feature extraction faster . </li></ul></ul>
    20. 20. Feature Extraction <ul><li>Features are extracted from sub windows of an sample image. </li></ul><ul><ul><li>The base size for a sub window is 24 by 24 pixels. </li></ul></ul><ul><ul><ul><li>In a 24 pixel by 24 pixel sub window there are 180,000 possible features to be calculated. </li></ul></ul></ul><ul><li>What is the end result of feature extraction? </li></ul><ul><ul><li>A lot of data! </li></ul></ul><ul><ul><ul><li>This is called over fitting and the amount of data must be reduced. </li></ul></ul></ul><ul><ul><ul><li>Overfitting can be compensated to an extent by logical elimination. </li></ul></ul></ul>
    21. 21. Face Detection Algorithm Face Localization Lighting Compensation Skin Color Detection Color Space Transformation Variance-based Segmentation Connected Component & Grouping Face Boundary Detection Verifying/ Weighting Eyes-Mouth Triangles Eye/ Mouth Detection Facial Feature Detection Input Image Output Image
    22. 22. Face Recognition Problem Statement Identify a person’s face image from face database. Applications Human-Computer interface, Static matching of photographs, Video surveillance, Biometric security, Image and film processing.
    23. 23. Challenges <ul><li>Variations in pose Head positions, frontal view, profile view and head tilt, facial expressions </li></ul><ul><li>Illumination Changes Light direction and intensitychanges, cluttered background, low quality images </li></ul><ul><li>Camera Parameters Resolution, color balance etc. </li></ul><ul><li>Occlusion Glasses, facial hair and makeup </li></ul>
    24. 24. Inter-class Similarity <ul><li>Different persons may have very similar appearance </li></ul>Twins Father and son
    25. 25. Intra-class Variability <ul><li>Faces with intra-subject variations in pose, illumination, expression, accessories, color, occlusions, and brightness </li></ul>
    26. 26. Face Recognition Using Eigenfaces
    27. 27. <ul><li>Face Images are projected into a feature space (“ Face Space ”) that best encodes the variation among known face images. </li></ul><ul><li>The face space is defined by the “ eigenfaces ”, which are the eigenvectors of the set of faces. </li></ul>Eigen Space and Eigen Faces
    28. 28. Principal Component Analysis (PCA) For a set M of N-dimensional vectors {x 1 , x 2 …x M } , PCA finds the eigenvalues and eigenvectors of the covariance matrix of the vectors  - the average of the image vectors an image as 1d vector u k - Eigenvectors  k - Eigenvalues Keep only k eigenvectors, corresponding to the k largest eigenvalues.
    29. 29. Method of Eigenfaces <ul><ul><li>Apply PCA on the training dataset </li></ul></ul><ul><ul><li>Project the Gallery set images to the reduced dimensional eigenspace. </li></ul></ul><ul><ul><li>For each test set image: </li></ul></ul><ul><ul><ul><li>Project the image to the reduced dimensional eigenspace. </li></ul></ul></ul><ul><ul><ul><li>Measure similarity by calculating the distance between the projection coefficients of two datasets </li></ul></ul></ul><ul><ul><ul><li>The face is recognized if the closest gallery image belongs to same person in test set </li></ul></ul></ul>
    30. 30. References.. <ul><li>“ Eigenfaces for Recognition”, Turk, M. and Pentland A., (1991) Journal of Cognitive Neuroscience, Vol. 3, No. 1, pp. 71-86. </li></ul><ul><li>. </li></ul><ul><li>file://localhost/C:/Program%20Files/OpenCV/docs/index.htm </li></ul>
    31. 31. Questions? <ul><li>How was my talk? </li></ul><ul><li>Can anything be explained better? </li></ul><ul><ul><ul><ul><ul><li>Thank you </li></ul></ul></ul></ul></ul>