https://github.com/mehtadigisha/motion-tracker
https://github.com/mehtadigisha/motion-tracker
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mehtadigisha/motion-tracker
- Owner: mehtadigisha
- Created: 2025-02-25T13:20:16.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-25T13:33:56.000Z (8 months ago)
- Last Synced: 2025-02-25T14:33:04.078Z (8 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Motion Tracker
## Overview
This is a simple motion tracking application using OpenCV and Python. It allows the user to select a point on a video feed, and the system will track its movement using the Lucas-Kanade Optical Flow method. The motion trail of the selected point is visualized on the screen.## Features
- 📷 Uses OpenCV to capture video from the webcam.
- 🖱 Allows the user to select a point by clicking on the video feed.
- 🔍 Tracks the selected point's motion using optical flow.
- 🎨 Draws motion trails to visualize movement.
- ⏹ Press `ESC` to exit the application.## Requirements
Ensure you have Python installed along with the following dependencies:```bash
pip install opencv-python numpy
```## Usage
### 1. Clone the repository
```bash
git clone https://github.com/mehtadigisha/motion-tracker.git
cd motion-tracker
```### 2. Run the script
```bash
python motiondetection.py
```### 3. Interact with the application
- Click on the video window to select a point for tracking.
- The selected point will be tracked with a motion trail.
- Press `ESC` to exit.## Code Explanation
- Captures video from the webcam using OpenCV.
- Converts frames to grayscale for processing.
- Uses `cv2.calcOpticalFlowPyrLK` for tracking movement.
- Updates and draws the motion trail on the frame.## Output
https://github.com/user-attachments/assets/72b11f6d-3714-480f-ae26-4bf882e55f6b