How does 'imerode' function compute erosion with the 'shape' attribute set to 'full'?
Show older comments
How does 'imerode' function compute erosion when 'shape' attribute is set to 'full'?
As an example, consider the following code:
A = [ 0 1 1 1 0 1 ;...
0 1 1 1 0 1 ;...
1 1 1 1 1 1 ;...
1 1 0 1 1 1 ;...
1 1 0 1 1 1 ];
B = [1 1]; % structuring element
D1 = imerode(A,B,'full');
>> D1 =
0 0 1 1 0 0 1
0 0 1 1 0 0 1
1 1 1 1 1 1 1
1 1 0 0 1 1 1
1 1 0 0 1 1 1
- -
| |
^ ^
The first column The last column should
should all be 0 all be zero
I was expecting the first column and the last column of the output matrix 'D1' to be all zeros, but they contain non-zero elements in the output. Is this behavior expected?
Accepted Answer
More Answers (0)
Categories
Find more on Morphological Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!