matlab中卷积运算conv2的三种形式

matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2

conv2 Two dimensional convolution.

    C = conv2(A, B) performs the 2-D convolution of matrices A and B.
    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then
    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
 
    C = conv2(H1, H2, A) first convolves each column of A with the vector
    H1 and then convolves each row of the result with the vector H2.  If
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then
    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).
    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to
    round-off.
 
    C = conv2(..., SHAPE) returns a subsection of the 2-D
    convolution with size specified by SHAPE:
      'full'  - (default) returns the full 2-D convolution,
      'same'  - returns the central part of the convolution
                that is the same size as A.
      'valid' - returns only those parts of the convolution
                that are computed without the zero-padded edges.

                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).


关于full, same以及valid三种参数的区别,如下面的实例所示:

full



same



valid



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值