Performing dilation on an image includes:

Increasing the size of the object by expanding the image pixels and adding pixels
to the boundary of the object.

Filling small holes and broken areas

Connecting areas separated by a space smaller than the structuring element

The direction and extent of the growth of an object in an image depends on the shape of
the structuring element. Each structuring element has an origin.

If the structuring element is symmetrical, the origin coincides with its
centroid.

If the structuring element is asymmetrical, the pixel in the structuring element
that is close to its centroid and is in the top-left direction is considered as the
origin.

The Dilation block rotates the structuring element about this
origin and places the origin over each pixel of the image object. The block creates the
dilated image from the local maxima values at each pixel.

**Binary Dilation**The binary dilation of *A* by *B*,
denoted as *A* ⨁ *B*, is defined as the set operation:

where $$\widehat{B}$$ is the reflection of the structuring element *B*. Note
that some applications use a definition of dilation in which the structuring element is
not reflected.

**Grayscale Dilation**In the general form of grayscale dilation, the structuring element
has a specified height. The grayscale dilation of
*A*(*x*, *y*) by
*B*(*x*, *y*) is defined as:

where *D*_{B} is the domain of the
structuring element *B* and *A*(*x*,
*y*) is assumed to be –∞ outside the domain of the image. To create a structuring element with
nonzero height values, use the syntax `strel(nhood,height)`

, where
`height`

specifies the height values and `nhood`

corresponds to the structuring element domain
*D*_{B}.

Grayscale dilation is often performed with a flat structuring element (*B*(*x*,*y*) =
0). Grayscale dilation using such a structuring element is equivalent to a
local-maximum operator:

All of the `strel`

syntaxes except for
`strel(nhood,height)`

,
`strel("arbitrary",nhood,height)`

, and
`strel("ball",...)`

produce flat structuring elements.