How to save bounding box image?
7 次查看(过去 30 天)
显示 更早的评论
i am having trouble in saving bonding box image for later use but i can't.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163245/image.jpeg)
0 个评论
回答(1 个)
Y.L.K KHUMAN
2014-5-22
[L, a,]=bwlabel(I); %%Label connected components
propied=regionprops(L,'BoundingBox'); %%Measure properties of image regions
for n=1:size(propied,1) %%Plot Bounding Box
rectangle('Position',propied(n).BoundingBox,'EdgeColor','g','LineWidth',1);
end
for n=1:a %%Objects extraction
[r,c] = find(L==n);
n1=Segout(min(r):max(r),min(c):max(c));
figure, subimage(~n1);
pause(0.5)
imsave();
end
*imsave() function will save your bounded image.
2 个评论
Azum Saeed
2018-7-2
I hope you found the answer but leaving it for people who might have lesser time. so segout is basically the image complete image it self and but not a function. min(r):max(r) are the range from where till where you want to copy image to n1 object.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!