Documentation

Dilate an image. More...

## Modules

dilate
The C++ interface for dilate.

af_dilate
The C interface for dilate.

## Detailed Description

Dilate an image.

The dilation function takes two pieces of data as inputs. The first is the input image to be morphed, and the second is the mask indicating the neighborhood around each pixel to match.

In dilation, for each pixel, the mask is centered at the pixel. If the center pixel of the mask matches the corresponding pixel on the image, then the mask is accepted. If the center pixels do not matches, then the mask is ignored and no changes are made.

Dilation supports n-channel images (ie. 3D matrices). However each tile must be 2D and will be the same for all channels. If you wish to use separate masks for channels, you can extract the channel, apply the operation and store the resulting channel back in the array.

Image dilation is useful for bluring and smoothing edges.

For further reference, see: Dilation (morphology)

// Convert [0-255] image to logical
img_in = img_in > 127;
// Dilate an image, 8-neighbor connectivity