%greyscale morphological dilation with 1x9 kernel beeld=imread('coins.jpg','jpg'); [r k dim3]=size(beeld); A=beeld(:,:,1); nieuw=A; for i=1:r for j=1:k if j>1 & A(i,j-1)2 & A(i,j-2)3 & A(i,j-3)4 & A(i,j-4)