码迷,mamicode.com
首页 > 其他好文 > 详细

【转】MATLAB conv2函数的理解

时间:2017-04-14 00:56:15      阅读:425      评论:0      收藏:0      [点我收藏+]

标签:例子   模板   计算方法   with   matlab   sha   compute   art   取值   

另附:http://blog.csdn.net/anan1205/article/details/12313593

 

原文:http://blog.csdn.net/andrewseu/article/details/51783181

 

在图像处理的过程中,经常会看到矩阵卷积的概念,比如说用一个模板去和一张图片进行卷积,因此很有必要了解矩阵卷积到了做了什么,具体又是怎么计算的。 
在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).

用一幅图可以很好的理解这三个参数代码的具体含义: 
技术分享

矩阵卷积计算方法

技术分享 
技术分享 
举一个简单的例子, 
技术分享 
matlab 的计算结果如下: 
技术分享

【转】MATLAB conv2函数的理解

标签:例子   模板   计算方法   with   matlab   sha   compute   art   取值   

原文地址:http://www.cnblogs.com/qrlozte/p/6706937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!