function BW = myErosion(Img,SE)
	[m,n] = size(Img);
	[a,b] = size(SE);
	sumSE = sum(SE(:));
	BW = zeros(m,n);
	ma = fix((a-1)/2); 
	nb = fix((b-1)/2); 
	maCenter = ceil(ma+1);  
	nbCenter = ceil(nb+1); 
	% Cicle for Img
	for u = 1 + ma : m - ma 
		for v = 1 + nb : n - nb 
			tmp = 0;
			% Cicle for SE
			for i = -ma:ma    
				for j = -nb:nb
					if Img(u+i,v+j) == 1 && SE(maCenter + i,nbCenter + j) == 1 
						tmp = tmp + 1;
					end                    
				end
			end
			if tmp == sumSE % all 1's in the same position
				BW(u,v) = 1;
			end
		end
	end
end