Perform morphological closing.
The matrix img must be numeric while SE can be a:
The closing corresponds to a dilation followed by an erosion of img, using the same SE, i.e., it is equivalent to:
imerode (imdilate (img, se), se);
See also: imdilate, imerode, imopen.
Package: image