Pages

Sunday, February 27, 2011

Ball Tracking with OPENCV

Again, mechomaniac's article gave me jump-start to tracking a ball.

Below is a video of the code in action. I had to tweak parameters to the cvHoughCircles() function and the HSV thresholds to prevent false detection.



An important thing to note is that OpenCV's HSV format stores the Hue component as an 8-bit integer in the range of 0-179. This is unlike other graphics software which use Hue values from 0-255.

I observed the following frame rates:

Frame rates vs Resolution
Resolution With Hough Circle detection Without Hough Circle detection
320x240 ~5fps ~9fps
640x480 ~2fps ~4fps

Based on the benchmark here, I agree with the author that there might be a USB bandwidth limitation that is resulting in low frame rates. I am looking at using the DSP on the board to speed up OpenCV and use a direct interface to a camera to acquire images.

No comments:

Post a Comment