Dilation(morphological operator) for images. More...

Functions

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

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:

dilate_orig.png
Input Image
mask.png
Mask
dilate_inter.png
Intermediate Result
dilate.png
Output Image

Function Documentation

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]outarray is the dilated image
[in]inarray is the input image
[in]maskis 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
AFAPI array af::dilate ( const array in,
const array mask 
)

C++ Interface for image dilation (max filter)

Parameters
[in]inarray is the input image
[in]maskis the neighborhood window
Returns
the dilated image
Note
if mask is all ones, this function behaves like max filter
Examples:
computer_vision/harris.cpp, and image_processing/morphing.cpp.