jacynty123
Newbie level 1
Hi!
I have a problem with understanding some issues concerning mathematical morphology performer on binary image. When the structural element is matrix let’s say 3x3, then the result of binary image erosion is understandable for me. However I do not understand the case when we use , for example 2x2 matrix as structural element. The center point of this element is in the top left corner according to the equation used by MATLAB:
origin = floor((size(nhood)+1)/2), where nhood is our structural element. To specify, the I have a problem when in the center there is 0 not 1. Below is MATLAB code I used:
A=[0 0 0 0 0 0 0;0 0 1 1 1 0 0;0 0 1 1 1 0 0;0 0 1 0 1 0 0;...
0 0 0 1 1 0 0;0 0 1 1 1 0 0;0 0 0 0 0 0 0]
B = [0 1 0;1 0 1;0 1 0];
B1 = [1 0 1;0 1 0;1 0 1];
B2 = [0 1; 1 1];
C = imerode(A,B)
D = imerode(A,B1)
E = imerode(A,B2)
I would be grateful for any help with understanding this topic.
I have a problem with understanding some issues concerning mathematical morphology performer on binary image. When the structural element is matrix let’s say 3x3, then the result of binary image erosion is understandable for me. However I do not understand the case when we use , for example 2x2 matrix as structural element. The center point of this element is in the top left corner according to the equation used by MATLAB:
origin = floor((size(nhood)+1)/2), where nhood is our structural element. To specify, the I have a problem when in the center there is 0 not 1. Below is MATLAB code I used:
A=[0 0 0 0 0 0 0;0 0 1 1 1 0 0;0 0 1 1 1 0 0;0 0 1 0 1 0 0;...
0 0 0 1 1 0 0;0 0 1 1 1 0 0;0 0 0 0 0 0 0]
B = [0 1 0;1 0 1;0 1 0];
B1 = [1 0 1;0 1 0;1 0 1];
B2 = [0 1; 1 1];
C = imerode(A,B)
D = imerode(A,B1)
E = imerode(A,B2)
I would be grateful for any help with understanding this topic.