This project is a simple security camera system built using opencv-Python. The system utilizes a webcam to capture footage and detects motion by comparing differences between consecutive frames. When motion is detected, an alarm sounds using the winsound library. The project leverages the powerful opencv library for video processing and motion detection.
- Real-time Motion Detection: Continuously captures video and compares consecutive frames to detect any motion.
- Alarm System: Sounds an alarm using the
winsoundlibrary when motion is detected. - Easy Setup: Simple and straightforward setup using a webcam and Python libraries.
- Python 3.x
- OpenCV (
opencv-python) - Winsound (standard library on Windows)
- time (library for FPS rate)
-
Clone this repository:
git clone https://github.com/SARFAS-P/Security-Camera-with-Motion-Detection.git
-
Install the required dependencies:
pip install opencv-python
-
open in VSCODE:
Run the script to start the security camera system:
- The webcam captures video footage.
- Each frame is converted to grayscale and blurred to reduce noise.
- The system compares the current frame with the previous frame to detect any differences.
- If significant differences are found (indicating motion), the alarm sounds using the winsound library.
- Feel free to fork this repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.