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.
- 📷 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.
Ensure you have Python installed along with the following dependencies:
pip install opencv-python numpy
git clone https://github.com/mehtadigisha/motion-tracker.git
cd motion-tracker
python motiondetection.py
- 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.
- 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.