DEMONSTRATION VIDEO
Techniques & Theory
A facial recognition system uses bio metrics to map facial features from a photograph or video. It compares the information with a database of known faces to find a match. That's because facial recognition has all kinds of commercial applications. It can be used for everything from surveillance to marketing.
We took this idea for Attendance management system with face recognition. The Web camera capture the image and store it by the instructions of Program-1.Image will be stored as Numpy matrix and the image captured will be stored in the folder. While running our second program it compare the webcam image with the captured and store image, In this the Rows and column values of the images are compared and matched for the Attendance system so this make the Attendance management system Automated. To do this process we use Python OpenCV as software part and Raspberry PI3 and Web camera as Hardware part.
ALGORITHM
Attendance Recognition - 1
Reference: Local Binary Patterns with Python & OpenCV
- Capturing images from webcam and storing in Database folder
- Import Computer Vision package - cv2
- Import Numerical Python package - numpy as np
- Load human face cascade file using cv2.CascadeClassifier built-in function cv2.CascadeClassifier([filename])
- Check if human face cascade file is loaded
- Defining face_detector function Defining face_detector function
- Function detects faces and returns the cropped face
- If no face detected, it returns the input image
- Convert RGB to gray using cv2.COLOR_BGR2GRAY built-in function BGR (bytes are reversed)
- cv2.cvtColor: Converts image from one color space to another
- Detect objects(faces) of different sizes using cv2.CascadeClassifier.detectMultiScale
- cv2.CascadeClassifier.detectMultiScale(gray, scaleFactor, minNeighbors)
- scaleFactor: Specifies the image size to be reduced
- Faces closer to the camera appear bigger than those faces in the back.
- minNeighbors: Specifies the number of neighbors each rectangle should have to retain
- Higher value results in less detection but with higher quality.
- Faces are cropped when they detected.
- Resize the frame using cv2.resize built-in function
- cv2.resize(capturing, output image size, x scale, y scale, interpolation)
- Display cropped faces using imshow built-in function and all images are stored in the folder.# Attendance Recognition - 2:
- Train images are read from path_image and converted to gray
- Numpy array is created for Index using np.asarray
- np.array(Index, dtype)
- dtype=np.int32 is an 32 bit integer
- Local Binary Pattern Histogram (LBPH) is used for face recognition
- LBP - For each pixel in grayscale image, neighborhood of size r
- is selected surrounding the center pixel. LBP value is calculated
- For this center pixel and stored in the output 2D array.
- Histogram - Graphical representation of tonal distribution in image
STEP-1
RASPBIAN INSTALLATION ON RASPBERRY PI
- Install RASPNIAN OS on Raspberry-pi.
STEP-2
CONNECTING RASPBERRY PI TO LAPTOP
STEP-3
INSTALLING REQUIRED PACKAGES FOR PYTHON OPENCV
sudo apt-get update
sudo apt-get -y install python-pip
sudo apt-get -y install python-git
sudo apt-get -y install python-numpy
sudo apt-get -y install python-scipy
sudo apt-get -y install python-opencv
sudo pip install --upgrade cython
sudo pip install -U scikit-learn
sudo pip install imutils
sudo apt-get -y install python-sklearn
sudo apt-get -y install python-skimage
STEP 4
Connect Camera, Raspberry pi and Display
STEP 5:Program For Image Capture
Program as per code given in the attachment.