Function for finding circle radius

3 次查看(过去 30 天)
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!!!

回答(2 个)

Image Analyst
Image Analyst 2018-6-18
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
Image Analyst 2018-6-18
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.
  4 个评论
Miguel Perez Andrade
I realize I've been expressing myself wrongly: what I need to measure aren't circles, they are rings. What I need is the radius of the rings that are seen in the picture, that are 2 in all cases. Maybe this distinction betwenn circles and rings makes the problem more clear
Image Analyst
Image Analyst 2018-6-19
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?

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by