Documentation


The C interface for erode. More...
afError  af_erode_B (bool *d_out, unsigned in_ndims, const unsigned *in_dims, const bool *d_in, unsigned nhood_ndims, const unsigned *nhood_dims, const bool *h_nhood, unsigned batch) 
Erode an Image. More...  
afError  af_erode_S (float *d_out, unsigned in_ndims, const unsigned *in_dims, const float *d_in, unsigned nhood_ndims, const unsigned *nhood_dims, const float *h_nhood, unsigned batch) 
Single precision, Image Erosion. More...  
afError  af_erode_D (double *d_out, unsigned in_ndims, const unsigned *in_dims, const double *d_in, unsigned nhood_ndims, const unsigned *nhood_dims, const double *h_nhood, unsigned batch) 
Double precision, Image Erosion. More...  
The C interface for erode.
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).
Erosion supports nchannel images (ie. 3D matrices). However a tile must be 2D and will be 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 erosion is useful for making edges more defined.
For further reference, you can look at the wikipedia page: Erosion (morphology)
afError af_erode_B  (  bool *  d_out, 
unsigned  in_ndims,  
const unsigned *  in_dims,  
const bool *  d_in,  
unsigned  nhood_ndims,  
const unsigned *  nhood_dims,  
const bool *  h_nhood,  
unsigned  batch  
) 
Erode an Image.
[out]  d_out  The eroded image 
[in]  in_ndims  Number of dimension elements in in_dims 
[in]  in_dims  Dimensions of d_in 
[in]  d_in  Input image 
[in]  nhood_ndims  Number of dimension elements in nhood_dims 
[in]  nhood_dims  Dimensions of h_nhood 
[in]  h_nhood  neighborhood patch (on host) 
[in]  batch  Number of input images (1 or ngfor) 
h_nhood
must be square and odd (3x3,5x5,7x7,...)Boolean, Image Erosion afError af_erode_S  (  float *  d_out, 
unsigned  in_ndims,  
const unsigned *  in_dims,  
const float *  d_in,  
unsigned  nhood_ndims,  
const unsigned *  nhood_dims,  
const float *  h_nhood,  
unsigned  batch  
) 
Single precision, Image Erosion.
afError af_erode_D  (  double *  d_out, 
unsigned  in_ndims,  
const unsigned *  in_dims,  
const double *  d_in,  
unsigned  nhood_ndims,  
const unsigned *  nhood_dims,  
const double *  h_nhood,  
unsigned  batch  
) 
Double precision, Image Erosion.