The morphological closing (Serra, 1982)
  of a set \(W\) by a distance \(r > 0\)
  is the set of all points that cannot be
  separated from \(W\) by any circle of radius \(r\).
  That is, a point \(x\) belongs to the closing \(W*\)
  if it is impossible to draw any circle of radius \(r\) that
  has \(x\) on the inside and \(W\) on the outside.
  The closing \(W*\) contains the original set \(W\).
For a small radius \(r\), the closing operation
  has the effect of smoothing out irregularities in the boundary of
  \(W\). For larger radii, the closing operation smooths out
  concave features in the boundary. For very large radii,
  the closed set \(W*\) becomes more and more convex.
The algorithm applies dilation followed by
  erosion.