This project demonstrates how to detect faces using OpenCV and Haar Cascade Algorithm, and extract them from an image. The project is designed to work with a CSI camera, but can also work with other cameras.
Install OpenCV by running the following command in the terminal:
pip install opencv-python
Download the Haar Cascade XML file from OpenCV GitHub repository.
Clone or download the project repository to your local machine.
Install the face_recognition library by running the following command in the terminal:
pip install face_recognition
Note: face_recognition requires NumPy, dlib, and Click to be installed as well. If you have any issues with installation, refer to the official installation guide.
This installation guide assumes that you already have Python and pip installed on your machine. If not, you will need to install them first before proceeding with the installation of OpenCV and face_recognition.
Connect the CSI camera or other camera to your device.
Run the main.py
file from the project directory in the terminal:
python main.py
This project was inspired by the following sources: