KB1 = conv2(b,Ksigma,'same')

1 回表示 (過去 30 日間)
Pooja
Pooja 2012 年 7 月 26 日
COULD YOU PLEASE EXPLAIN THIS MATLAB CODE...ESPECIALLY THE USE OF 'same'
KB1 = conv2(b,Ksigma,'same')

回答 (1 件)

Wayne King
Wayne King 2012 年 7 月 26 日
編集済み: Wayne King 2012 年 7 月 26 日
When you convolve two matrices (images) of different sizes you get an output image that has row dimension equal to the sum of the two input matrices' row dimensions - 1. The same is true for the column dimension. The column dimension (size) of the output matrix is the sum of the column dimensions of the two input matrices - -1.
In your case, b and Ksigma are your two input matrices.
For example:
X = randn(3,3);
Y = randn(3,2);
Z = conv2(X,Y);
The output has row size 3+3-1 and column size 3+2-1
Using the 'same' option says only return the "central" part of Z in the above that matches the size of the first input image.
Z1 = conv2(X,Y,'same');
The output has the same size as X. If you compare Z1 and Z, you'll see what is in common.

カテゴリ

Help Center および File ExchangeFeature Detection and Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by