IM2 = imdilate(IM,SE) dilates the grayscale, binary, or packed binary image
IM, returning the dilated image,
IM2.
IM2 = imerode(IM,SE) erodes the grayscale, binary, or packed binary image
IM, returning the eroded image
IM2.The argument
SE is a structuring element object or array of structuring element objects returned by the
strel function.
The morphological
close operation is a dilation followed by an erosion, using the same structuring element for both operations. The morphological
open operation is an erosion followed by a dilation, using the same structuring element for both operations.
these operations are performed on a stabilized video sequence done by SIFT. and basic background subtraction. se1 = strel('square',11) % 11-by-11 square
se2 = strel('line',10,45) % line, length 10, angle 45 degrees
se3 = strel('disk',15) % disk, radius 15
se4 = strel('ball',15,5) % ball, radius 15, height 5

sedisk = strel('square',10);
fg = imclose(fg, sedisk);


sedisk = strel('line',10,90);
fg = imclose(fg, sedisk);
sedisk = strel('line',15,5);
fg = imclose(fg, sedisk);


sedisk = strel('disk',10);
fg = imclose(fg, sedisk);
Deciding on the morphological structure is much harder than deciding on the threshold of background subtraction