In the example here, I do not know why it called the median filter first before the hough circle algorithm. Is this meant to give better detection?
Also, is there any other tricks in general that maybe useful when calling Hough circle algorithm? In particular, if the circular object has same brightness with its background, hence looking homogeneous on the grey scale, is there anything I can do here?
Also, if I cannot get perfect detection, I would prefer having less detected circles but rather the detected ones are correct.
Thanks
The blur will help avoid false circle detection by reducing noise, because openCV uses a gradient version of the hough circle detection algorithm, outlined here: http://homepages.inf.ed.ac.uk/rbf/BOOKS/BANDB/LIB/bandb4_3.pdf
The size of the blur will interplay with the upper threshold for the internal Canny edge detector, which is param_1. You'll want to play around with that.
To get around the brightness problem, try detecting just with isolated R, G and B channels. To get more complete results, you can then shift hue by 60 and then use isolated channels again.