MotionEye is a PyQt6 desktop app for detecting motion in video files using frame differencing. It is a student project that runs on the CPU and does not use deep learning.
- Frame differencing motion detection
- Region of Interest (ROI) selection
- Adjustable parameters:
- Bounding box threshold (object size filter)
- NMS threshold (suppression of overlapping boxes)
- Motion threshold (sensitivity)
- Gaussian blur (noise reduction)
- Save video with bounding boxes
- Optional live camera preview
- Main Window
- Video Loaded
- File Menu (Open Video)
- Detection In Progress (Camera)
- Parameter Bar
- Python 3.8 or newer
- pip (Python package manager)
-
Clone or download the repository
-
Create and activate virtual environment (recommended):
python -m venv venv
Activate:
- Windows:
venv\Scripts\activate - Linux/Mac:
source venv/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt
python main.pyAlternative command:
python -m motioneye.ui.main_window- Click File → Open Video (or press
Ctrl+O) - Select a video file (supports: .mp4, .avi, .mov, .mkv)
- Play/Pause: Play video with real-time motion detection
- Frame Slider: Navigate through video frames
- Start/End Frame: Set analysis range
- Bbox Thresh: Minimum detected object size (100-10000 pixels)
- NMS Thresh: Suppression intensity for overlapping boxes (0.01-0.90)
- Motion Thresh: Motion sensitivity (1-255, lower = more sensitive)
- Gaussian Blur: Smoothing filter size (1-31, odd values only)
- Click Select ROI button
- Draw a rectangle on the video frame to define detection area
- Click Reset ROI to remove the selection
- Click Save Video with Detections
- Choose output location and filename
- Wait for processing to complete
MotionEye/
├── main.py # Application entry point
├── README.md # This file
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
│
├── motioneye/ # Main package
│ ├── __init__.py
│ ├── assets/ # Application assets
│ │ └── logo.png # Application logo
│ │
│ ├── core/ # Detection algorithms
│ │ ├── __init__.py
│ │ └── detection.py # Motion detection core
│ │
│ └── ui/ # User interface
│ ├── __init__.py
│ └── main_window.py # Main GUI window
│
└── data/ # Optional: sample videos
└── samples/ # Place sample videos here
Steps used in detection:
- Frame subtraction: absolute difference between consecutive frames
- Gaussian blur: smoothing to reduce noise
- Thresholding: binary mask from motion pixels
- Contour detection: find connected regions
- Bounding boxes: rectangles around moving objects
- NMS: remove overlapping detections
- Fast on CPU
- No GPU required
- No model training
- Low memory use
- Sensitive to camera movement and lighting changes
- Works best with a stationary camera
- Parameter tuning depends on the scene
- PyQt6: GUI framework
- OpenCV: Video and image processing
- NumPy: Numerical computations
Camera functionality is experimental and may have issues:
- Limited to live preview
- No recording support
- Less stable than video file mode
- Recommended to use video files for stable operation
| Issue | Solution |
|---|---|
| No detections | Increase motion sensitivity, adjust Gaussian blur |
| Too many false positives | Increase motion threshold, increase bbox threshold |
Contributions are welcome. You can submit issues or pull requests.
This project is developed for educational purposes.
Motion Detection Student Team
Tips: Start with default parameters and adjust for your video.




