Automatic attendance management system using face recognition

Published Jun 08, 2020
 3 hours to build
 Advanced

There are automated systems which are used for recording the attendance of a person within the organization, but the limitation is that the attendance is registered only when entering and leaving the work area. We proposed the attendance system using surveillance camera which is used to record the attendance of students in a classroom with some time interval in a day.

display image

Components Used

Raspberry Pi 4B
Raspberry Pi 4BRaspberry Pi 4B
1
USB Webcam
Cameras & Camera Modules USB 2.0 WEBCAM1080PLNSCVEMICAD
1
5VDC Adapters Power Supply
Wall Mount AC Adapters ac-dc, 5 Vdc, 2 A, SW, wall-plug, EU, P5 center pos, level VI, black
1
Description

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

  1. Capturing images from webcam and storing in Database folder
  2. Import Computer Vision package - cv2
  3. Import Numerical Python package - numpy as np
  4. Load human face cascade file using cv2.CascadeClassifier built-in function cv2.CascadeClassifier([filename])
  5. Check if human face cascade file is loaded
  6. Defining face_detector function Defining face_detector function
  7. Function detects faces and returns the cropped face
  8. If no face detected, it returns the input image
  9. Convert RGB to gray using cv2.COLOR_BGR2GRAY built-in function BGR (bytes are reversed)
  10. cv2.cvtColor: Converts image from one color space to another
  11. Detect objects(faces) of different sizes using cv2.CascadeClassifier.detectMultiScale
  12. cv2.CascadeClassifier.detectMultiScale(gray, scaleFactor, minNeighbors)
  13. scaleFactor: Specifies the image size to be reduced
  14. Faces closer to the camera appear bigger than those faces in the back.
  15. minNeighbors: Specifies the number of neighbors each rectangle should have to retain
  16. Higher value results in less detection but with higher quality.
  17. Faces are cropped when they detected.
  18. Resize the frame using cv2.resize built-in function
  19. cv2.resize(capturing, output image size, x scale, y scale, interpolation)
  20. Display cropped faces using imshow built-in function and all images are stored in the folder.# Attendance Recognition - 2:
  21. Train images are read from path_image and converted to gray
  22. Numpy array is created for Index using np.asarray
  23. np.array(Index, dtype)
  24. dtype=np.int32 is an 32 bit integer
  25. Local Binary Pattern Histogram (LBPH) is used for face recognition
  26. LBP - For each pixel in grayscale image, neighborhood of size r
  27. is selected surrounding the center pixel. LBP value is calculated
  28. For this center pixel and stored in the output 2D array.
  29. 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.

 

Codes

Downloads

AUTOMATIC ATTENDANCE MANAGEMENT SYSTEM Download
Automatic attendance management system Download

Institute / Organization

SNS college of Technology
Comments
Ad