This project implements real-time face detection using OpenCV library in C++ programming language. The project uses pre-trained Haar cascades classifiers to detect faces in real-time video stream captured by the webcam.
- OpenCV library version - 3.3.1 vc14
- Visual Studio Code
- Webcam
- Include directories: Path to the "include" folder in your OpenCV installation.
- Library directories: Path to the "lib" folder in your OpenCV installation.
Preprocessor :
_CRT_SECURE_NO_WARNINGS
_DEBUG
_CONSOLE
LINKER : (Debug Mode)
opencv_world331d.lib
- Clone the repository to your local machine.
- Install OpenCV on your system.
- Open a terminal and navigate to the cloned repository directory.
- Compile the project using the following command:
g++ -std=c++11 -Wall -pedantic -o face_detector face_detector.cpp `pkg-config --cflags --libs opencv`
- Run the executable using the following command:
./face_detector
- The application will start and show a live stream from your webcam. It will detect faces in real-time and draw a rectangle around them.
├── face_detector.cpp # main application source file
├── README.md # README file
We would like to thank the OpenCV community for providing the Haar feature-based cascade classifier and the sample code that inspired this project. Additionally, we want to acknowledge the developers of the C++ programming language and the GCC and Clang compilers for their contributions to the software development community.