Given an image, I'm trying to apply convolution with a (3 x 3 x 3 x 64) kernel:
cv2.filter2D(img, -1, np.random.rand(3,3,3,64))
Gives:
error: /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/filterengine.hpp:363: error: (-215) anchor.inside(Rect(0, 0, ksize.width, ksize.height)) in function normalizeAnchor
In fact in the documentation it says:
kernel – convolution kernel (or rather a correlation kernel), a single-channel floating point matrix; if you want to apply different kernels to different channels, split the image into separate color planes using split() and process them individually.
Is there any other opencv function that can convolve a > 2D kernel? Or do I have to do two for loops applying filter2d?