Equivalent of Matlab filter2(filter, image, 'valid') in python -
i want know equivalent of matlab's filter2(filter, image, 'valid') function in python opencv or scikit-image library. concerned valid argument allows calculate convolution of filter , image without 0 padding image. aware of fact similar question posted on forum equivalent of filter2 function valid argument has not been described properly.
the documentation filter2 says filter2(h, x, shape) equivalent conv2(x,rot90(h,2),shape);
a python equivalent conv2 signal.convolve2d. equivalent you're looking is:
signal.convolve2d(x, np.rot90(h), mode='valid')
Comments
Post a Comment