The Separable Convolution algorithm performs a 2D convolution operation, but takes advantage of the fact that the 2D kernel is separable. The user passes one horizontal and one vertical 1D kernel. This usually leads to better performance, especially for kernels larger than 5x5. For smaller kernels, it's preferable to use Convolution algorithm with a 2D kernel directly.
\(I'\) is the temporary image with convolution along the rows.
\(I''\) is the final result.
\(K_{row}\) is the row convolution kernel.
\(K_{col}\) is the column convolution kernel.
\(k_w,k_h\) are the kernel's width and height, respectively.
Note
Most computer vision libraries expect the kernel to be reversed before calling their convolution functions. Not so with VPI, we implement a actual convolution, not cross-correlation. Naturally, this is irrelevant if the kernel is symmetric.
Usage
Initialization phase
Include the header that defines the needed functions and structures.