The core of the merode algorithm should be:
if( Se(m,n)~=0 && tmp1>0 && tmp2>0 && tmp1<=Isize(1,1) && tmp2<=Isize(1,2) )
if (Image(tmp1,tmp2)~= 1)
otherwise any erosion-kernel with zeros in it will erode away everything but exact copies of the kernel.

2

07 Dec 2004

mdilate
This has 2 files mdilate.m(performs dilation of image) and merode.m(performs erosion on image).

Markus Karlsson

Four nested for-loops don't provide an efficient algorithm, sorry.

Comment only