Image Processing Toolbox    

Separability

If a filter has separability, meaning that it can be separated into two one-dimensional filters (one column vector and one row vector), the computation speed for the filter can be greatly enhanced. Before calling conv2 to perform two-dimensional convolution, filter2 first checks whether the filter is separable. If the filter is separable, filter2 uses singular value decomposition to find the two vectors. filter2 then calls conv2 with this syntax.

where kcol and krow are the column and row vectors that the two-dimensional convolution kernel k separates into (that is, k = kcol*krow).

conv2 filters the columns with the column vector, and then, using the output of this operation, filters the rows using the row vector. The result is equivalent to two-dimensional convolution but is faster because it requires fewer computations.

Determining Separability

A filter is separable if its rank is 1. For example, this filter is separable.

If k is separable (that is, it has rank 1), then you can determine the corresponding column and row vectors with

Perform array multiplication on the separated vectors to verify your results.


 The filter2 Function Higher-Dimensional Convolution