1. 程式人生 > >矩陣卷積理解

矩陣卷積理解

在影象處理的過程中,經常會看到矩陣卷積的概念,比如說用一個模板去和一張圖片進行卷積,因此很有必要了解矩陣卷積到了做了什麼,具體又是怎麼計算的。 
在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 
版權宣告:本文為博主原創文章,轉載請附上博文連結!