how to remove objects close to image border
조회 수: 2 (최근 30일)
이전 댓글 표시
hello everyone, i have a problem related with image processing. btw, i have an image like this :

but i want to remove the object closest to the image border ( in this case, the closest one is on the right of the border)
do you know how to do that? thx before.
댓글 수: 0
채택된 답변
Image Analyst
2017년 1월 28일
Sorry - I was sleeping, hence the delay on my part.
Simply crop the image with imcrop(), then call imclearborder(), then pad with padarray():
margin = 50; % Whatever
croppedImage = imcrop(binaryImage, [margin, margin, columns - 2 * margin, rows - 2 * margin]);
binaryImage = imclearborder(croppedImage);
binaryImage = logical(padarray(binaryImage, margin));
댓글 수: 2
Image Analyst
2017년 1월 30일
No. It will remove any object, no matter what size, if it enters the margin. If you want size based filtering, see bwareafilt() or bwareaopen().
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!