A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
dilate
ArrayFire Functions | ArrayFire Functions by Category » Image Processing » Morphological Operations

Dilation(morphological operator) for images More...

## Functions
AFAPI array | dilate (const array &in, const array &mask)
| C++ Interface for image dilation (max filter)
AFAPI af_err | af_dilate (af_array *out, const af_array in, const af_array mask)
| C Interface for image dilation (max filter)

## Detailed Description

Dilation(morphological operator) for images

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.

For further reference, see: Dilation (morphology)

Sample input and output are shown below:

Input Image | Mask | Intermediate Result | Output Image

## Function Documentation

## ◆ af_dilate()

AFAPI af_err af_dilate | ( | af_array * | out,
|  | const af_array | in,
|  | const af_array | mask )

C Interface for image dilation (max filter)

Parameters

  [out] | out | array is the dilated image
  [in] | in | array is the input image
  [in] | mask | is the neighborhood window

Returns
  AF_SUCCESS if the dilated successfully, otherwise an appropriate error code is returned.

Note
  if `mask` is all ones, this function behaves like max filter

## ◆ dilate()

AFAPI array dilate | ( | const array & | in,
|  | const array & | mask )

C++ Interface for image dilation (max filter)

Parameters

  [in] | in | array is the input image
  [in] | mask | is the neighborhood window

Returns
  the dilated image

Note
  if `mask` is all ones, this function behaves like max filter