Wednesday, March 23, 2011

Exercise 5, Code Improvement

We thought that, except for cropping the processed image, the best way to improve the correct detection ratio of the found balls and reduce false detections would be to substitute the cvFindContours function currently used (which finds any closed contour) with a more specialized function, in this case cvHughCircles. This enables us to specifically look only for circles instead of contours. At first, we made a small standalone program that enables you to load a saved picture and will apply grayscaling and Gaussian filtering before attempting to find circles in the picture.

Testing the algorithm, we obtain some nice results:















The thicker red circle around the blue ball is the one our algorithm has found.
Then we proceed to substitute the necessary code in the auball2 plugin. One downside that still remains is that finding the balls correctly still greatly depends on lighting conditions, as the image fed into the cvHughCircles function is heavily filtered beforehand.

No comments:

Post a Comment