Skip to content

konynour/Motion-Detection-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ₯ Motion Detection Project

A Python project that detects motion from videos using OpenCV.


🌟 Overview

This project uses simple computer vision techniques to detect motion in video streams. It's ideal for:

  • Beginners learning OpenCV
  • Building security camera simulations
  • Real-time object tracking demos

πŸ“‚ Project Structure

motion-detection/
β”‚
β”œβ”€β”€ motion_detection.py       # Main Python script
β”œβ”€β”€ test.mp4                  # Example video input
β”œβ”€β”€ static.png                # Optional image output
β”œβ”€β”€ README.md                 # Project documentation
β”œβ”€β”€ .gitignore                # Files to exclude from Git

πŸ› οΈ Requirements

Install dependencies with:

pip install opencv-python imutils matplotlib numpy

🧠 How It Works

  1. Read video frame by frame
  2. Convert frames to grayscale
  3. Compare current and previous frames to detect movement
  4. Highlight detected movement with bounding boxes

▢️ Usage

Run the script with:

python motion_detection.py
  • By default, it uses the webcam.
  • To use a video file, replace cv2.VideoCapture(0) with your file path.

πŸ”’ .gitignore

These files are ignored by Git:

static.png
test.mp4
test.png

πŸ“Έ Output Example

Add screenshots or output images here, like:

Motion Detection Output


πŸ“˜ License

MIT License
This project is free to use for learning and experimentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors