How to crop an image in MATLAB
1 回表示 (過去 30 日間)
古いコメントを表示
![](/matlabcentral/answers/uploaded_files/72558/001bin.jpg)
I have this binary image. Now I want to crop this image in such a way that I have only the leaf part and the remaining part(which contains another angled black part) are removed. I wont use manual cropping. This should be by final image:
![](/matlabcentral/answers/uploaded_files/72561/final.jpg)
Thank You!
0 件のコメント
回答 (1 件)
Image Analyst
2017 年 3 月 17 日
Simply invert then call bwareaopen() and imclearborder()
mask = bwareaopen(~mask, 1000);
mask = imclearborder(mask);
% Invert again if you want black on white (usually that's not a good idea though).
mask = ~mask;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!