In the task, I got an discontinuous edge image, how could make it closed? in other word make the curve continuous. And the shape could be any kind, cause this the coutour shadow
You can try using distance transform
% binarize im=rgb2gray(im); im=im>100; % Distance transform bd=bwdist(im); maxDist = 5; bd(bd