I'm learning opencv and I have a question for you. I got this final processed image.
The original image is two balls that are near and they are the same color. I would get the center and the radius of each ball. If the balls are distant I do this using findContours and drawContours with option CV_FILLED, so I can do the average of the pixel position of each ball and I get the center. The problem is when the balls are close so I don't get two different contours and I can't do the average of the pixel position. I obtain this image (the center is indicated with a circle):
Could you give some advice? I do the edge detection using Canny algorithm.
A Hough transformation is a common approach to detect geometrical entities in the image. OpenCV has a function implemented for circles. Check this out:
http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html