Recursive Gaussian Filter is a low-pass IIR (infinite impulse response) Gaussian filter that smooths out the image by doing a series interconnection of low-order causal and anti-causal recursive filters. It approximates well wide support Gaussian filters, i.e. the ones with bigger standard deviations (sigma), while providing superior performance than direct-convolution Gaussian Filter. It has the advantage of filtering images at the same computing time no matter how large the sigma, as it does not have nor depend on the kernel support size.
It supports only one mode of operation:
The image below shows an usage example. The entire input image is blurred with a big sigma using Recursive Gaussian Filter to serve as background, while a mask is used to segment out and preserve the heron in the middle of it.
Input and mask | Gaussian sigma | Output |
---|---|---|
![]() ![]() | \[ \sigma=17 \] | ![]() |
Recursive Gaussian filter is implemented as a sequence of forward-direction (causal) filter and back-direction (anti-causal) filter on rows and columns of an input image. To better understand them, let us first define linear time-invariant (LTI) filter as:
\[ \sum_{i=-r}^{r} a_i z[k-i] = \sum_{i=-s}^{s} b_i w[k-i] \]
The \(a_i\) and \(b_i\) are filter design parameters. The \(w[k]\) and \(z[k]\) are input and output signals, respectively. This LTI filter can be decomposed into a convolution pass and a causal and anti-causal combination of recursive filter passes:
\[ x[k] = \sum_{i=-s}^{s} c_i w[k-i] \]
\[ y[k] = x[k] - \sum_{i=1}^{r} d_i y[k-i] \]
\[ z[k] = y[k] - \sum_{i=1}^{r} e_i z[k-i] \]
The convolution has a finite impulse response (FIR) given by the \(c_i\) coefficients, and \(s\) is the convolution kernel support. Moreover, the recursive filters have an infinite impulse response (IIR) given by the \(d_i\) and \(e_i\) coefficients, and \(r\) is the filter order. The \(x[k]\) and \(y[k]\) are intermediary output signals of the FIR and IIR, respectively. This process can be extended from 1D signals to 2D images by independently filtering all columns and then all resulting rows.
Instead of direct convolution, a third-order recursive filter can be used to approximate Gaussian filtering, operating in linear time independent of the standard deviation. They are the best alternative in terms of performance, quality and simplicity, especially for wide support filters. In the example above, a direct convolution kernel of \(101x101\) in support size is needed to accomodate the specified \(sigma=17\) and obtain the same blur effect.
The implementation overlaps causal-anticausal processing with row-column processing. Overlapping works similar as fusion, but in a deeper, intra-stage algorithmic level. For more information, see [1].
For list of limitations, constraints and backends that implements the algorithm, consult reference documentation of the following functions:
Function | Description |
---|---|
vpiCreateRecursiveGaussianFilter | Creates payload for vpiSubmitRecursiveGaussianFilter. |
vpiSubmitRecursiveGaussianFilter | Runs a Recursive Gaussian Filter over an image. |
For more information, see Recursive Gaussian Filter in the "C API Reference" section of VPI - Vision Programming Interface.
For information on how to use the performance table below, see Algorithm Performance Tables.
Before comparing measurements, consult Comparing Algorithm Elapsed Times.
For further information on how performance was benchmarked, see Performance Benchmark.