Function for finding circle radius
Afficher commentaires plus anciens
Hello everyone,
I've made a diffraction experiment in which I got diffraction circles, and I need to measure the radius. For the task, I've taken pictures of the circles, and I'm trying to measure the circles with Matlab. For this, the camera was always in the same position, and I've taken a picture of a ruler so then I can relate pixels to length.
To measure the radius, first I thought of adjusting a function of a circle (f(x,y)=R^2((x-x_0)^2+(y_0)^2)), being the domain (x,y) the points of the image and the value f(x,y) the intensity of the image at that point. I thought of using the function fit, but I had problems at this point defining the fitType paramter. Is this a right aprroach? Should I fit a function or rather maximize one? I had doubts about this.
I did a little more research, and I found at this link https://la.mathworks.com/help/images/examples/detect-and-measure-circular-objects-in-an-image.html a Matlab tutorial for detecting circles with the function imfindcircles. However, the function did not work, as I suspect it only works with solid circles. Does someone know another function that can help me, or made one that can be useful?
I attach pictures of the circles. Any help is appreciated.
EDIT: Sample picture added

Thanks!!!
Réponses (2)
Image Analyst
le 18 Juin 2018
0 votes
Please unzip one of the images and attach it in your original message so we can see it more easily (there are many who won't bother to unzip and then load your image).
Image Analyst
le 18 Juin 2018
0 votes
How do you define when the circle "ends"? Some brightness level? See my attached demos to get the average radial profile. Use it to find a good threshold. It's somewhat of a judgment call since the radius is fuzzy - not sharp. Then threshold and use regionprops to get the Equivalent Circular Diameter.
See my Image Segmentation Tutorial https://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
4 commentaires
Miguel Perez Andrade
le 19 Juin 2018
Image Analyst
le 19 Juin 2018
Are you saying that you need to measure multiple circles on each image? Also, are you saying that thresholding to find circles based on their intensity is no good? If not, then why not and what do you think it is, if not intensity, that defines the circle(s)?
Miguel Perez Andrade
le 19 Juin 2018
Image Analyst
le 19 Juin 2018
So you want the inner and outer radius of the outermost two rings?
And why don't you think thresholding is the way to go? Why can't you just threshold, clean up a bit to get only two rings and get rid of noise, then call bwboundaries(), and pass the boundaries into the FAQ code to get the center and radius of the inner and outer boundaries?
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!