I have an image of concentric circles, I would like to find the radii of the circles (only the innermost few are important).
I've had a go using what I could find in previous posts, but am a bit confused about which method I should be using - if I need MorphologicalComponents, or whether to use SelectComponents "count" or "equivalentradius", or colornegate etc. Sometimes the circles are broken (especially when I binarize), so I need to look for incomplete circles too..
So far I have:
i = Import["http://i.imgur.com/oTTM9MG.jpg"];
b = Binarize[i, {0.3, 1}];
m = MorphologicalComponents[b];
c = SelectComponents[m, {"Count", "Holes"},
1000 < #1 < 20000 && #2 > 0 &] // Colorize
ComponentMeasurements[c, {"Centroid", "EquivalentDiskRadius"}]
or, using :
i = Import["http://i.imgur.com/oTTM9MG.jpg"];
disk = ColorNegate[Binarize[i, {0.3, 1}]];
rings = ComponentMeasurements[
disk, {"Centroid", "EquivalentDiskRadius"},
450 <= #1[[1]] <= 550 && 325 <= #1[[2]] <= 375 &&
10 <= #2 <= 500 &];
Show[{disk,
Graphics[{{Red, Circle[rings[[1, 2]][[1]], rings[[1, 2]][[2]]]}}]}]
Am I making it harder than it is? Could someone bump in the right direction?
both this, How to find circular objects in an image? and this, Finding the centroid of a disk in an image were helpful (but I need to expand it to multiple circles and fit partial circles).
Any help would be appreciated. Thanks!