find the center of the circle in image
조회 수: 4 (최근 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.
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
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!