How to reduce perimeter of Image in Matlab?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I want to erode (Reduce the perimeter) of the below image by 7 pixels such that only the image within the red circle is kept.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195032/image.jpeg)
I thought this could be done with imerode, but this also reduces the central pixels which I do not want!
Thank You :)
댓글 수: 0
채택된 답변
Image Analyst
2018년 9월 3일
Try this:
se = strel('disk', 7, 0);
binaryImage = grayImage > 0; % Threshold.
mask = imerode(binaryImage, se);
grayImage(~mask) = 0;
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!