This repository contains code for real-time face detection and recognition using the Fisherfaces algorithm.
The face detection and recognition system uses the OpenCV library to perform real-time face detection and recognition on a live video stream. It detects faces in the video frames, preprocesses the face images, and then classifies them using the Fisherfaces algorithm. The detected faces are surrounded by rectangles, and the recognized faces are labeled with their corresponding IDs and confidence scores.
- Real-time face detection and recognition
- Preprocessing techniques like histogram equalization for improved recognition performance
- Training of the face classifier using the Fisherfaces algorithm
- Draw rectangles around detected faces and label recognized faces
- Python 3.x
- OpenCV (cv2) library
- PIL library
- Numpy library
- Clone the repository:
git clone https://github.com/Teja78906/face-detection-recognition.git- Install the required libraries:
pip install opencv-python pillow numpy- Run the UserDataCapturingUtil.py
python UserDataCapturingUtil.pythis will capture the training data used by the faceDetector algorithm for face detection
- Run the faceDetector.py script:
python faceDetector.py- The script will open the video capture and start detecting and recognizing faces in real-time.
You can adjust the confidence threshold for face recognition by modifying the confidence_threshold parameter in the detect() function. Experiment with different preprocessing techniques in the preprocess_image() function to enhance the quality of input images.