SecureCam is a Python-based application designed to monitor a live camera feed for human presence using OpenCV's face detection. It provides advanced features such as recording videos when a face is detected, real-time FPS display, and user interaction through a GUI built with PyQt5. The app is suitable for use in personal or small-scale security monitoring systems.
- Real-time Face Detection: Detects human faces within a predefined box.
- Auto Recording: Starts recording when a face is detected within the box and stops after a specified duration or if no face is detected for a given time.
- Video Overlay: Displays FPS and timestamp on the video feed.
- GUI Controls:
- View recordings.
- Stop recording.
- View logs.
- Stop alert.
- Logs System: Tracks and displays system activities.
- Text-to-Speech Integration: Announces recording start and stop events.
The following libraries and tools are required to run SecureCam:
- Python 3.8 or later
- OpenCV (
cv2
) - PyQt5
- pyttsx3
- Use the GUI to monitor the camera feed and control the recording system.
- Camera Feed: Displays the live video feed with detection overlays.
- Info Panel: Displays current date, time, and last detection information.
- Logs Panel: Displays a log of system events.
- Control Buttons:
- View Recordings: Placeholder for viewing recorded videos.
- Delete Recordings: Placeholder for deleting recordings.
- View Logs: Displays the system log.
- Stop Recording: Stops the current recording manually.
- Stop Alert: Placeholder for stopping alerts.
- Recording starts when a face is detected inside the predefined green box.
- Stops if no face is detected for 20 seconds or when the maximum recording duration (10 minutes) is reached.
Checks if a detected face lies within the predefined green box.
Starts recording a video with a unique filename based on the current timestamp.
Stops the video recording and releases the video writer object.
Adds an overlay to the video feed showing the current timestamp and FPS.
- Detection Box: The detection box can be adjusted by modifying
box_x
,box_y
, andbox_size
. - Recording Duration: Modify
max_recording_duration
to change the maximum recording time. - Alert Messages: Customize the text-to-speech messages in
start_recording()
andstop_recording()
.
This project is licensed under the MIT License. See the LICENSE
file for details.
- OpenCV for computer vision tools.
- PyQt5 for GUI development.
- pyttsx3 for text-to-speech functionality.