Face Recognition System Using OpenCV in Python


Face recognition is the task of identifying an already detected object as a known or unknown face.Often the problem of face recognition is confused with the problem of face detectionFace Recognition on the other hand is to decide if the "face" is someone known, or unknown, using for this purpose a database of faces in order to validate this input face.

OpenCV


OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software li/brary. which is built to provide a common infrastructure for machine learning algorithms and computer vision. It has thousands of optimized algorithms which can be used different purposes like detecting and recognizing faces, identifying objects and many more. We need it to take pictures using our webcam and some manipulation needed to be done in the image.

To install the library you need to install pip in your system after that you can follow the steps in command prompt:
Step 1: pip install opencv-python
Step 2: pip install opencv-contrib-python

NumPy


NumPy is the fundamental package for scientific computing in Python which provides a multidimensional array object other mathematical operations can be performed using this but simply speaking we just need it to convert our images into some form of an array so that we can store the model that has been trained.
To install the li/brary you can type a simple line of code in your command shell:
pip install numpy

Haar Cascade


Haar Cascade is basically a classifier which is used to detect the objects for which it has been trained for, from the source. The result is an XML file which stores the trained result. If said simply the Haar Cascade is trained by superimposing the positive image over a set of negative images. The training requires a high spec system and a good internet connection and thousands of training images that is why it is carried out in the server. For increasing the efficiency of the results they use high-quality images and increase the number of stages for which the classifier is trained. We need haar cascade frontal face recognizer to detect the face from our webcam.Now, let us test our chatbot and see how it responds.

for Source Code click here.


FaceRecognition.py



Trainer.py



livefacerecognizer.py



trainingImages



Face Recognizing



Please reach me out over LinkedIn for any query.

Thanks for reading!!!