Object tracking based on color detection using OpenCV library and Python - Raspberry Pi
This project is build for tracking ball-shaped object based on its color. The project could be run on Raspberry Pi using Pi camera. For more detail please visit Pyimagesearch webpage.
The following packages are required to run the project:
- Python 3.8.2
- imutils 0.5.3
- OpenCV 4.2.0
- Install python from the www.python.org or use Anaconda.
- Install imutils using Pip or Conda:
- Pip
pip install imutils
- Conda
conda install -c conda-forge imutils
- Pip
- Instal OpenCV using Pip or Conda.
- Pip
pip install opencv-contrib-python
- Conda
conda install -c anaconda opencv
- Pip
- In order to use Raspberry Pi camera, simply run ball_tracking.py.
- To use your local machine (PC or Raspberry Pi) video, use following script in terminal and give your video file path:
python ball_tracking.py --video ball_tracking_example.mp4
If you find this repository helpful, please star and fork it to support me.
For questions, please contact Adrian Rosebrock in pyimagesearch.
OpenCV Track Object Movement by Adrian Rosebrock on September 21, 2015 [link]
This project is distributed under MIT License