Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object tracking in python

I'm working on a program in PYTHON which is able to do the following:

A webcam is watching a movement, where an object is moving on a path. The object to be tracked is marked with a big yellow spot. I have to find this yellow spot, then calculate the center-point of this spot, and then make some calculations with it. It would be awesome, if the centerpoint would draw on the picture, and it remains there the whole time.

How would you make it happen? I1ve already looked at PIL, pygame and OpenCV but i can't find any working solution, only half-solutions. In what steps would you do it?

Thanks for your help, D

like image 975
Dan Avatar asked Jun 07 '26 22:06

Dan


1 Answers

Here's a nice demo (using Python and OpenCV) that seems to be what you're looking for: video, code

Whether this will work for you without modification depends on the details of your spot. The example uses cvHoughCircles to identify the circle, and if your object isn't a circle, you'll need to replace this.

like image 190
tom10 Avatar answered Jun 10 '26 10:06

tom10