Search code examples
c++copencvtrackball

Is there is a demo C/C++ OpenCV program available that does simple ball tracking from a web camera?


Is there any open source or demo code available in C/C++ for OpenCV that does simple ball tracking?

Basically I want to hold a red-colored ball in front of my web camera and I want OpenCV to detect its location. If I move the ball towards the right or left of the screen the program will detect the location of the ball has changed and output its new location.

I have successfully installed Open CV 2.3.1 on the raspberry pi with a web camera, eventually I want to execute the code on the pi.


Solution

  • I just stumbled upon this. It is a cvBlob example and very similar to what you want to do. Source code is here here.