To find circles' centers with subpixel accuracy if the radius of the circle is known (and constant), I use this approach:
- Take an image with a single circle (refferred to as marker below). Its radius should be the same as the radius of the circles you want to find.
- Detect edges (magnitude of the Sobel gradient, then some threshold to remove low-intensity edges), both in the test image and in the flipped marker image. I do not apply edge thinning at this stage and do not identify exact points on the edge.
- Cross-correlate edges of the test image with the edges of the flipped marker. You get some peaks where the centers are located.
- Find peaks' centers with subpixel accuracy. Center of mass or fitting a 2D Gaussian bell may work well.
- Add shifts which correspond to known position of the center of the circle in the marker.
Otherwise, if points on the circle are known with sufficient accuracy, least mean squares fitting should solve the problem of finding the center (see @nikie's answer).