How can find the cartesian coordinates of circle in a image
조회 수: 5 (최근 30일)
이전 댓글 표시

Hello guys..
I have this image (attached in the post) that has two red circles... How can I find the cartesian coordinates of each circle ? Thanks
댓글 수: 0
답변 (1개)
Jon
2015년 8월 6일
편집: Jon
2015년 8월 6일
First, convert the image to binary using im2bw. Then use bwboundaries to return each object boundary. The result of bwboundaries should be a 2-element cell (one for each blob). Each cell has two columns; the first is the y-coordinates, the second is the x-coordinates.
If you'll be doing any more image processing, you should really go through this very nice tutorial by Image Analyst: https://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial
EDIT: if you want ALL the x,y coordinates, not just the boundaries, after converting to binary just use
allcoords = find(BW);
Remember that y-coordinates are returned in the first column, x in the second.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!