Author : Sristhi
Face recognition is a process of identifying or verifying the identity of an individual or user based on their facial features. This paper focus on recognition of a person through the face and identify the person by name. The first step for a facial recognition system is to recognize a human face and extract it data from the observed image.
Steps for installation of necessary Tools Required for Face Recognition
Step 1: Install Pycharm IDE
Step 2: Install numpy and cv2 libraries
Step 3: numpy is install through command prompt and we have to write
Command : pip install numpy.
Step 4: cv2 is install through command prompt and we have to write
Command : pip install opencv-contrib-python.
Numpy
In python working with arrays is difficult because it is very slow so we use this library which work very fast. Mathematical and logical operations on arrays can be performed through this. Numpy contains different variance of numerical types.in this project I used unit8 that means unsigned integer that means (0 to 255). It is import in IDE like “import numpy as np”
Figure 1
OpenCV
Opencv is an open-source image recognition library. It is used for machine learning, computer vision and image processing. OpenCV supports various modules for face recognition.
Converting image to grayscale use cv2.cvtColor() and COLOR_BGR2GRAY.
For storing image use imread() and show this image by imshow().
Cascade Classifier is used to store the variable.
detectMultiscale() function is used for detecting face and rectangle function is used to mark on face.
Figure 2
Step : 1
load haarcascade_frontalface_default.xml.
Figure 3
Figure 4
Output of this dataset will be:
Figure 5
Step 2:
Create arrays for training data and labels.
Open training images in our data path.
Create a numpy array for training data and labels.
Figure 6
Output: Dataset model taining completed.
Step 3: Face detection.
Figure 7
Figure 8
Output:
Github :
https://github.com/srishti397/face-detection
References :
https://i0.wp.com/techvidvan.com/tutorials/wpcontent/uploads/sites/2/2020/07/Uses-of-NumPy-1.jpg?w=828&ssl=1
Comments