The C interface for filter. More...

afError af_filter_S (float *d_out, unsigned xi, unsigned yi, const float *d_in, unsigned xf, unsigned yf, const float *d_filter, unsigned type, float value, bool conv, bool full, unsigned batchA, unsigned batchF)
 2D Image filtering/convolution. More...
 
afError af_filter_D (double *d_out, unsigned xi, unsigned yi, const double *d_in, unsigned xf, unsigned yf, const double *d_filter, unsigned type, float value, bool conv, bool full, unsigned batchA, unsigned batchF)
 Double precision, Image filtering. More...
 

Detailed Description

The C interface for filter.

Apply an arbitrary filter (also known as a kernel) to an image. This function can be used for several tasks in image processing including noise removal or blurring (especially when combined with the gaussiankernel).

This function involves specifying a 1D or 2D filter, a (usually) small array with an odd number of pixels in each dimension. Each pixel in the output image is the weighted sum of the original pixels and all neighboring pixels, where the weight is specified by the filter.

Pixels outside of the image contribute a 0 to the average. This occurs when processing pixels on the edge of an image, or pixels that are close to the edge when a large filter is used.

Function Documentation

afError af_filter_S ( float *  d_out,
unsigned  xi,
unsigned  yi,
const float *  d_in,
unsigned  xf,
unsigned  yf,
const float *  d_filter,
unsigned  type,
float  value,
bool  conv,
bool  full,
unsigned  batchA,
unsigned  batchF 
)

2D Image filtering/convolution.

Parameters
[out]d_outThe filtered output
[in]xiNumber of rows in input image
[in]yiNumber of columns in input image
[in]d_inInput image
[in]xfNumber of rows in the input filter
[in]yfNumber of columns in the input filter
[in]d_filterInput filter (on device)
[in]typeused to specify behavior near the boundaries -{Symmetric(1), Repeating(2), Circular(3), Value(4)}
[in]valueif type=4, this value is used for out of bounds
[in]convtrue for convolution, false for correlation
[in]fulltrue for expanded convolution, false otherwise
[in]batchANumber of input images (gfor)
[in]batchFNumber of input filters (gfor)Single precision, Image filtering
afError af_filter_D ( double *  d_out,
unsigned  xi,
unsigned  yi,
const double *  d_in,
unsigned  xf,
unsigned  yf,
const double *  d_filter,
unsigned  type,
float  value,
bool  conv,
bool  full,
unsigned  batchA,
unsigned  batchF 
)

Double precision, Image filtering.