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

Functions

AFAPI array erode (const array &in, const array &mask)
 C++ Interface for image erosion (min filter) More...
 
AFAPI af_err af_erode (af_array *out, const af_array in, const af_array mask)
 C Interface for image erosion (min filter) More...
 

Detailed Description

Erosion(morphological operator) for images.

The erosion function is a morphological transformation on an image that requires two inputs. The first is the image to be morphed, and the second is the mask indicating neighborhood that must be white in order to preserve each pixel.

In erode, for each pixel, the mask is centered at the pixel. If each pixel of the mask matches the corresponding pixel on the image, then no change is made. If there is at least one mismatch, then pixels are changed to the background color (black).

For further reference, see: Erosion (morphology)

Sample input and output are shown below:

erode_orig.png
Input Image
mask.png
Mask
erode_inter.png
Intermediate Result
erode.png
Output Image

Function Documentation

AFAPI af_err af_erode ( af_array out,
const af_array  in,
const af_array  mask 
)

C Interface for image erosion (min filter)

Parameters
[out]outarray is the eroded image
[in]inarray is the input image
[in]maskis the neighborhood window
Returns
AF_SUCCESS if the eroded successfully, otherwise an appropriate error code is returned.
Note
if mask is all ones, this function behaves like min filter
AFAPI array af::erode ( const array in,
const array mask 
)

C++ Interface for image erosion (min filter)

Parameters
[in]inarray is the input image
[in]maskis the neighborhood window
Returns
the eroded image
Note
This function can be used as min filter by using a mask of all ones
Examples:
image_processing/image_editing.cpp, and image_processing/morphing.cpp.