![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/178594/image.jpeg)
how can find maximum width of object
1 回表示 (過去 30 日間)
古いコメントを表示
how can I automatically find the maximum width of this object in a binary image? I've shown the maximum width in red line
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149754/image.jpeg)
0 件のコメント
回答 (1 件)
Image Analyst
2015 年 10 月 5 日
You can use minboundrect() in John D'Errico's function http://www.mathworks.com/matlabcentral/fileexchange/34767-a-suite-of-minimal-bounding-objects
Or else if you don't want the bounding box width, and want the actual width perpendicular to the major axis at the mid point, you can use my attached demo. regionprops() does not give the actual feret diameters, just the axis lengths of an ellipse fitted to the blob.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/178594/image.jpeg)
4 件のコメント
hyz
2017 年 4 月 27 日
Hi Image Analyst. I know I want to know if there is any possible modification to make your farthest_points function able to compute the feret diameter along the right edge of moon. As now, it computes the distance at med point, which sometimes might not be the maximum distance. Thanks.
Image Analyst
2017 年 4 月 27 日
Use the radon transform to get the width of the binary object along any angle you want. It's the radon() function.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!