Documentation
|
|
C++ interface for Convolution. More...
| array | convolve (const array &f1, const array &f2, const array &signal, bool expand=false) |
| Separable convolution (2D) with device arrays. More... | |
| template<typename ty > | |
| array | convolve (unsigned n1, const ty *h_f1, unsigned n2, const ty *h_f2, const array &signal, bool expand=false) |
| Separable convolution (2D) with host arrays. More... | |
| array | convolve (const array &signal, const array &filter, bool expand=false) |
| Convolution (1D,2D,3D). More... | |
| template<typename ty > | |
| array | convolve (const array &signal, unsigned ndims, unsigned *dims, const ty *h_kernel, bool expand=false) |
| Convolution (1D,2D,3D) with host filter. More... | |
C++ interface for Convolution.
A convolution is a common operation between a source array, a, and a filter (or kernel) array b. The answer to the convolution is the same as computing the coefficients in polynomial multiplication, if a and b are the coefficients.
Another way to think about it is that the filter kernel is centered on each pixel in a, and the output for that pixel or data point is the sum of the products.
Consider the following example with the calculation for the first few points shown as a comment:
Note that pixels that are outside an image or data points that are outside the domain of a signal are treated as zero.
| array af::convolve | ( | const array & | f1, |
| const array & | f2, | ||
| const array & | signal, | ||
| bool | expand = false |
||
| ) |
Separable convolution (2D) with device arrays.
| [in] | f1 | filter along the columns (first dimension) |
| [in] | f2 | filter along the rows (second dimension) |
| [in] | signal | |
| [in] | expand | Performs expanded convolution if true. Default is false |
| array af::convolve | ( | unsigned | n1, |
| const ty * | h_f1, | ||
| unsigned | n2, | ||
| const ty * | h_f2, | ||
| const array & | signal, | ||
| bool | expand = false |
||
| ) |
Separable convolution (2D) with host arrays.
| [in] | n1 | number of elements in f1 |
| [in] | h_f1 | host pointer containing the column filter |
| [in] | n2 | number of elements in f2 |
| [in] | h_f2 | host pointer containing the row filter |
| [in] | signal | |
| [in] | expand | Performs expanded convolution if true. Default is false |
| array af::convolve | ( | const array & | signal, |
| const array & | filter, | ||
| bool | expand = false |
||
| ) |
| array af::convolve | ( | const array & | signal, |
| unsigned | ndims, | ||
| unsigned * | dims, | ||
| const ty * | h_kernel, | ||
| bool | expand = false |
||
| ) |
Convolution (1D,2D,3D) with host filter.
| [in] | signal | |
| [in] | ndims | Number of dimensions for the filter h_kernel |
| [in] | dims | Array containing dimension sizes of filter h_kernel |
| [in] | h_kernel | Host-side array containing the filter kernel coefficients |
| [in] | expand | Performs expanded convolution if true. Default is false |