Separable filter

From testwiki
Jump to navigation Jump to search

A separable filter in image processing can be written as product of two more simple filters. Typically a 2-dimensional convolution operation is separated into two 1-dimensional filters. This reduces the computational costs on an N×M image with a m×n filter from 𝒪(MNmn) down to 𝒪(MN(m+n)). [1]

Examples

1. A two-dimensional smoothing filter:

13[111]*13[111]=19[111111111]

2. Another two-dimensional smoothing filter with stronger weight in the middle:

14[121]*14[121]=116[121242121]

3. The Sobel operator, used commonly for edge detection:

[121]*[101]=[101202101]

This works also for the Prewitt operator.

In the examples, there is a cost of 3 multiply–accumulate operations for each vector which gives six total (horizontal and vertical). This is compared to the nine operations for the full 3x3 matrix.

Another notable example of a separable filter is the Gaussian blur whose performance can be greatly improved the bigger the convolution window becomes.

References

Template:Reflist