Ask Your Question

Revision history [back]

Short answer: no, afaik there are no out of the box 3D convolution for arbitrary kernel in openCV. Long answer: some convolution kernels are separable i.e. 2d convolution could be presented as a sequence of two 1D-convolution in one direction and then 1D in another direction (see 'sepFilter2D'). The same for 3D -- some 3D kernels could be presented as a sequence of 1D or 2D convolution. For instance Gauss kernel is always separable. 1D convolution is much faster than 2D or 3D that's why one should always try to use separable kernels. If your particular filter is not separable you can try to approximate it as a superposition of separable filters (using SVD etc). But you always should think twice is it really so necessary to use not separable 3D filtering in your case.

Short answer: no, afaik there are no out of the box 3D convolution for arbitrary kernel in openCV. openCV.

Long answer: some convolution kernels are separable i.e. 2d convolution could be presented as a sequence of two 1D-convolution in one direction and then 1D in another direction (see 'sepFilter2D'). sepFilter2D). The same for 3D -- some 3D kernels could be presented as a sequence of 1D or 2D convolution. For instance Gauss kernel is always separable. 1D convolution is much faster than 2D or 3D that's why one should always try to use separable kernels. If your particular filter is not separable you can try to approximate it as a superposition of separable filters (using SVD etc). But you always should think twice is it really so necessary to use not separable 3D filtering in your case.