This project implements a simple face detection algorithm using OpenCV in Python. It detects faces from an image using a pre-trained classifier.
Make sure you have Python installed on your system. You will need to install OpenCV for Python, which can be done easily using pip.
-
First, install the necessary Python packages:
pip install opencv-python
-
Replace
test1.jpgwith your own image for face detection. Ensure the image is in the same directory as the script, or update the file path in the script accordingly.
- Place your image (for example,
test1.jpg) in the same directory as the script. - Run the
main.pyscript to detect faces in your image:python main.py
- The script loads the image (
test1.jpgby default) and applies the face detection using OpenCV’s Haar Cascade Classifier. - Detected faces are highlighted with rectangles, and the output image is displayed.
This project is licensed under the GPL 3 License.
