正規化された 2 次元相互相関について

onion = im2gray(imread('onion.png'));
peppers = im2gray(imread('peppers.png'));
montage({peppers,onion})
c = normxcorr2(onion,peppers);
上記プログラムはnormxcorr2の説明ページにあるプログラムです。
画像サイズが
onion:135*198画素
peppers:384*512画素
の画像の場合cの値が518*709画素となるのですが、
cの端の値がどのように計算されているのかわからないです。
中心部であればonionの画像範囲全てがpeppersの中の範囲に収まるが端の部分ではpeppersの範囲外の部分がどのように計算されて処理結果となっているのかわからないです。
足りない部分にはどのような処理が行われているのかなどが分かると助かります。

 Réponse acceptée

Hernia Baby
Hernia Baby le 2 Mar 2022

0 votes

関数の中身を知りたい場合は、
edit normxcorr2 と打つか 関数を右クリックして「"normxcorr2"を開く」を選びます。
normxcorr2.m が開くはずです。
今回は127 ~ 129行目に書かれていますね。
試しに書いてみましょう。
[135 198] + [384 512] - 1
ans = 1×2
518 709
計算内容が結果とリンクしていることがわかりました

Plus de réponses (0)

Catégories

En savoir plus sur Read, Write, and Modify Image dans Centre d'aide et File Exchange

Produits

Version

R2021a

Tags

Community Treasure Hunt

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

Start Hunting!