The operator applies separable linear filters to the image, decomposing the filtering of a two-dimensional image into a horizontal one-dimensional filter and a vertical one-dimensional filter. Each row is convolved with a one-dimensional filter kernelX, and then each column of the result is convolved with a one-dimensional filter kernelY. Decomposable filter kernels include, but are not limited to, Sobel derivative kernel, Gaussian filter kernel, box filter kernel, median filter kernel, and so on.
| Input Image | Parameter | Output Image |
|---|---|---|
![]() | kernel=[0.0833333,0.0833333,0.66666,0.0833333,0.0833333] | ![]() |
The computational efficiency can be improved by splitting a 2D filter kernel into two separable 1D filter kernels. The specific principle is that a decomposable filtering kernel can be understood as two one-dimensional kernels. The x-filtering kernel is called first and then the y-filtering kernel is called during convolution. The consumption incurred by the convolution of two matrices can be estimated as the product of the areas of the two matrices, such that the time required to convolve an image of area A with an n×n convolution kernel is A*n^2, but if it is decomposed into two kernels of n×1 and 1×n, then the cost is A*n + A*n = 2A*n,. Thus decomposing the convolution kernel improves the efficiency of convolution computation.
This calculation is efficient as long as n is not less than 3, and the benefit becomes more apparent as n increases.
For detailed interface information, please refer to hbVPSepFilter2D.