Border treatment by imerode vs bwmorph(erode)
이전 댓글 표시
The two examples below show a case where the edge treatment during erosion seems to be different between imerode and bwmorph(erode). Matlab's documentation says that during erode operations, pad pixels are treated as MAX values to prevent border effects. imerode results below show that behavior, but the bwmorph('erode') results do not. Am I missing something?
>> imerode(ones(7,5), strel('square',3))
ans =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
>> a = bwmorph(ones(7,5), 'erode')
a =
0 0 0 0 0
0 1 1 1 0
0 1 1 1 0
0 1 1 1 0
0 1 1 1 0
0 1 1 1 0
0 0 0 0 0
Thanks!
답변 (1개)
J. Brady
2017년 2월 1일
0 개 추천
As you said, imerode pads the input matrix with MAX values to prevent border effects. However, bwmorph (which uses bwlookup to preform the erosion) pads the input matrix with zeros. (see http://www.mathworks.com/help/images/morphological-dilation-and-erosion.html and https://www.mathworks.com/help/images/ref/bwlookup.html)
카테고리
도움말 센터 및 File Exchange에서 Morphological Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!