This is a Python script that utilizes OpenCV to detect faces, eyes, and smiles in a webcam feed. It applies Haar cascades to detect these features and draws rectangles around them in real-time.
- Python 3.x
- OpenCV 4.x
-
Clone the repository: git clone https://github.com/H-Alireza/Smile-Detection-OpenCV.git
-
Install the required dependencies: pip install opencv-python
-
Download the Haar cascade XML files for face, eye, and smile detection and place them in the project directory.
-
Run the script: python smile_detection.py
-
The webcam feed will open in a new window, and the script will start detecting faces, eyes, and smiles in real-time.
-
Press 'q' to exit the application.
- Scaling factors and minimum neighbors for face, eye, and smile detection can be adjusted in the
detect_faces()
,detect_eyes()
, anddetect_smiles()
functions, respectively.
Contributions are welcome! If you find any issues or have suggestions for improvement, please create an issue or submit a pull request.