function dilateCookies

image=im2double(imread('cookies.png'));
clean = isodata(image) < image;
a=clean;

N=65;
M=65;
a = imdilate(clean, strel('disk', 5));
a = imerode(a, strel('disk', N));
subplot(1,2,1), imshow(a);
a = imdilate(a, strel('disk', M));
a=im2double(a);
a=a.*image;
%a=imreconstruct(image, a, 4);
subplot(1,2,2), imshow(a);