The routine bwlpolyshape() in this submission, takes as input an image containing a number of objects. The routine returns, for each object, a polyshape representing the code's idea of a minimal, best-fitting polygon to the objects' boundaries.
The input image can be a binary image, in which case each contiguous region represents an object:
subplot(1,2,1); imshow(BW,[]);
subplot(1,2,2); pgons=bwlpolyshape(BW, Visualize=true)
For images containing discontinuous objects, a label map can be used:
引用格式
Matt J (2025). Fit polyshape to objects in image (https://ww2.mathworks.cn/matlabcentral/fileexchange/181422-fit-polyshape-to-objects-in-image), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2024b
与 R2016b 及更高版本兼容
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!