This program uses the Tkinter library to create a user interface that displays the real-time camera feed. It also detects movements in the video stream using the background subtraction method and draws rectangles around the moving objects.
- Python 3.x
- OpenCV
- NumPy
- Pandas
- Pillow
- Make sure you have Python 3.x installed on your system.
- Install the required libraries using the following command:
pip install opencv-python numpy pandas pillow
- Run the program using the following command:
python motion_detection.py
- The application will open and display the live feed from your camera.
- Moving objects will be detected and surrounded by a green rectangle.
- The movement count in the video will be displayed.
^^ my cat ^^
- Press the "Escape" key to exit the application.
- Ensure that your camera is properly connected and allowed to be used by the application.
- The program uses the background subtraction algorithm to detect movements. This means any changes in the environment will be considered as movement. Use it in a stable environment for better results.
This program was written by Hajar Benjat.