本文主要是介绍matlab filter2和imfilter有什么区别,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
imfilter 可进行多维图像(RGB等)进行空间滤波,且可选参数较多filter2 只能对二维图像(灰度图)进行空间滤波
两个函数结果类型不一样,只需要在I1=filter2(h,I)后面加上I1=uint8(I1)进行类型转换,结果就是一样的。
imfilter N-D filtering of multidimensional images.
B = imfilter(A,H) filters the multidimensional array A with the
multidimensional filter H. A can be logical or it can be a
nonsparse numeric array of any class and dimension. The result,
Each element of the output, B, is computed using double-precision
floating point. If A is an integer or logical array, then output
elements that exceed the range of the given type are truncated,
and fractional values are rounded. B, has the same size and class as A.
filter2 Two-dimensional digital filter.
Y = filter2(B,X) filters the data in X with the 2-D FIR
filter in the matrix B. The result, Y, is computed
using 2-D correlation and is the same size as X.
Y = filter2(B,X,SHAPE) returns Y computed via 2-D
correlation with size specified by SHAPE:
这篇关于matlab filter2和imfilter有什么区别的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!