I'm translating Matlab code into Python code and I need your help to know how to translate this line in Matlab.
Matrix = convn(Matrix2, ones(x,x,x)/x^3, 'same');
I'm asking, because conv2 in Matlab, doesn't have a direct equivalent in Python and I had to use the solution proposed here : Is there a Python equivalent of MATLAB's conv2 function?
where they rotate the image :
def conv2(x, y, mode='same')
return np.rot90(convolve2d(np.rot90(x, 2), np.rot90(y, 2), mode=mode),
I thus assume that we must do something like this too, but in 3D, hence why I'm asking for your help!
Thanks!