Skip to content

This Python code is able to track objects by a specified color (green in that case). I use that for tracking my green juggling balls.

Notifications You must be signed in to change notification settings

alvgoro/Balls_Tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a short Python code using OpenCV which is able to track balls using a camera or a video input.

I followed the PyImageSearch tutorial from: https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/

Thanks a lot Adrian Rosebrock for sharing us your knowledges :)

In my code I changed several lines to correct some issues.

  • Here you can track more than one ball.
  • If there are 2 or more balls, you need to identify each ball. OpenCV read the frame from right-bottom to left-top (I guess). It is not a problem if you don't want to track, but if you do, you need to identify and save correctly each ball position. I got it using minimun distances among balls.

A little error in the code: I am not able to know the origin of the error. The paths sometimes cross over. I tried to clear the vector in which I save the positions, but it still be there. If anyone has any idea doesn't hesitate to contact me, I am always open to learn :)

alt text alt text

About

This Python code is able to track objects by a specified color (green in that case). I use that for tracking my green juggling balls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages