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:

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值