How to crop an image in MATLAB
조회 수: 3 (최근 30일)
이전 댓글 표시
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:
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!