Separable Convolution. More...
Functions | |
AFAPI array | convolve (const array &col_filter, const array &row_filter, const array &signal, const convMode mode=AF_CONV_DEFAULT) |
C++ Interface for separable convolution on two dimensional signals. More... | |
AFAPI af_err | af_convolve2_sep (af_array *out, const af_array col_filter, const af_array row_filter, const af_array signal, const af_conv_mode mode) |
C Interface for separable convolution on two dimensional signals. More... | |
Separable Convolution.
Separable Convolution is faster equivalent of the canonical 2D convolution with an additional prerequisite that the filter/kernel can be decomposed into two separate spatial vectors. A classic example of such separable kernels is sobel operator. Given below is decomposition of vertical gradient of sobel operator.
\( \begin{bmatrix} -1 & 0 & +1 \\ -2 & 0 & +2 \\ -1 & 0 & +1 \\ \end{bmatrix} \)
can be decomposed into two vectors shown below.
\( \begin{bmatrix} 1 \\ 2 \\ 1 \\ \end{bmatrix} \)
\( \begin{bmatrix} -1 & 0 & +1 \\ \end{bmatrix} \)
AFAPI af_err af_convolve2_sep | ( | af_array * | out, |
const af_array | col_filter, | ||
const af_array | row_filter, | ||
const af_array | signal, | ||
const af_conv_mode | mode | ||
) |
C Interface for separable convolution on two dimensional signals.
[out] | out | is convolved array |
[in] | col_filter | is filter that has to be applied along the coloumns |
[in] | row_filter | is filter that has to be applied along the rows |
[in] | signal | is the input array |
[in] | mode | indicates if the convolution should be expanded or not(where output size equals input) |
AFAPI array convolve | ( | const array & | col_filter, |
const array & | row_filter, | ||
const array & | signal, | ||
const convMode | mode = AF_CONV_DEFAULT |
||
) |
C++ Interface for separable convolution on two dimensional signals.
[in] | signal | is the input signal |
[in] | col_filter | is the signal that shall be along coloumns |
[in] | row_filter | is the signal that shall be along rows |
[in] | mode | indicates if the convolution should be expanded or not(where output size equals input) |
domain
, AF_CONV_AUTO, heuristically switches between frequency and spatial domain.