find the center of the circle in image
7 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to find the center of the circle by just clicking inside of the circle.
I learned how to get the position where I clicked with
[x, y] = ginput
and how to find the center of circle with
[centers, radii] = imfindcircles(image,[Rmin Rmax])
But, what I want to do is to find the center of a circle by clicking anywhere inside a circle when I have many circles in the image.
Please let me know if you have any advice.
Thank you
0 个评论
回答(1 个)
Image Analyst
2015-2-22
It depends on what information you have. Do you have a list of each circle that exists? Like an N by 3 array of x,y,radius? If so, just see which x,y in the array is closest to where you clicked. Do you have an image of circles? You might need to segment the image until you get an array of x,y,radius locations of every circle in the image. See my Image Segmentation Tutorial in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. What kind of data are you starting with? Please read this and then attach a screenshot.
2 个评论
Image Analyst
2015-2-22
That's EXACTLY what my tutorial does that I referred you to. Did you look at the link and see the tutorial? Here is a link to the one,specific tutorial that you need: http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial---blobsdemo-- Just replace the image with your image and you should be ready to go.
See the numbers? I put those at the centroids.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!