矩阵卷积理解

在图像处理的过程中,经常会看到矩阵卷积的概念,比如说用一个模板去和一张图片进行卷积,因此很有必要了解矩阵卷积到了做了什么,具体又是怎么计算的。 
在matlab中有conv2函数对矩阵进行卷积运算,其中有一个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).
1
2
3
4
5
6
用一幅图可以很好的理解这三个参数代码的具体含义: 


矩阵卷积计算方法
 
 
举一个简单的例子, 
 
matlab 的计算结果如下: 

--------------------- 
作者:andrewseu 
来源:CSDN 
原文:https://blog.csdn.net/andrewseu/article/details/51783181 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/cys119/article/details/84308249