This project uses OpenCV (cv2
) to capture video from a webcam and detect faces and bodies using pre-trained Haar cascades. When a face or body is detected, the program automatically starts recording a video, and the recording stops a few seconds after detection ends. This guide provides a step-by-step breakdown of the code.
To run this project, you need the following:
- Python 3.x
- OpenCV (
cv2
library) - A webcam
You can install OpenCV using pip:
pip install opencv-python