Are there any efficient algorithm to detect circular shape of arbitrary size in an image?
Usually this problem is tackled using the Hough transform. Check it here:


OpenCV
Scikit


After you have some hints for the possible location of the circles and their diameter then you can calculate the distance (e.g. Euclidean) from the pixels you have to an ideal model (circle parametric equations: x = r.cos a; y = r.cos a)