필터 지우기
필터 지우기

find the center of the circle in image

조회 수: 4 (최근 30일)
mathScience
mathScience 2015년 2월 22일
댓글: Image Analyst 2015년 2월 22일
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

답변 (1개)

Image Analyst
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
mathScience
mathScience 2015년 2월 22일
I would like to find the center of circle although I don't know any information about the circles. What I want to do is click anywhere inside a circle and get information (mainly center of the circle) about the circle I clicked.
The image below is the example of circles. Circles with different positions and radius.
Thank you
Image Analyst
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!

Translated by