circle fitting
3 次查看(过去 30 天)
显示 更早的评论
I have a binary image. This image contains white points randomly a ranged inside a region of interest. I want to draw a circle that can include all these points inside it. Means that I want to write a code that detect all these active points automatically and draw a circle in such a way that all the active (white) points come inside this circle. And outer most white point become a part of the boundary of circle. Can anyone help me in that?
0 个评论
采纳的回答
Walter Roberson
2012-3-1
regionprops() the binary image, asking for Centroid and ConvexHull.
The center of the circle will be the centroid.
The ConvexHull will be an N x 2 array of x+y points. The point in that list that is furthest from the centroid will be the point that must be passed through; i.e., that maximum distances will be the radius of the circle.
You could also use the PixelIDList instead of the ConvexHull; it just gives you more points whose distance would have to be calculated.
3 个评论
Image Analyst
2012-3-2
Then don't accept the answer yet. We don't take personal emails - virtually no one here does. You can post your pictures to tinypic.com, or check here: http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
更多回答(1 个)
Image Analyst
2012-3-1
3 个评论
Image Analyst
2012-3-2
Neither Walter's nor John's solution will work if you have a random smattering of dots along the top of an arc. In that case you'd have to do a fit. Apparently that's complicated. I have a paper or reference to fitting a circle that I'll try to look up later for you.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!