Xcorr2 function

13 ビュー (過去 30 日間)
Padma
Padma 2011 年 9 月 11 日
コメント済み: RITIKA MALIK 2022 年 6 月 30 日
hello,can anybody help me how to go about using the xcorr2 function to find the cross correlation between 2 images? i need a single value of correlation between a query image and an image in the database. i have used the followin: crosscorr1=max(abs(xcorr2(double(x(:,:,1)),double(y(:,:,1))))); where x and y are d 2 images. i get a single row matrix as the output.

採用された回答

Wayne King
Wayne King 2011 年 9 月 11 日
Hi, That's because you are using max() on a matrix, which returns by default the maximum values for each column. One thing you can do is to call max() on the initial max() output.
x = randn(10,10);
y = randn(10,10);
max(max(abs(xcorr2(x,y))))
Note however that xcorr2 is not a normalized cross correlation.
Wayne
  2 件のコメント
Padma
Padma 2011 年 9 月 11 日
thanks!!!
but how is it different from normxcorr2??? will make a difference if i use just xcorr2?
RITIKA MALIK
RITIKA MALIK 2022 年 6 月 30 日
https://in.mathworks.com/matlabcentral/answers/95436-why-are-my-results-different-in-xcorr2-and-normxcorr2-in-matlab-7-7-r2008b#answer_104789

サインインしてコメントする。

その他の回答 (1 件)

Wayne King
Wayne King 2011 年 9 月 11 日
The difference is that xcorr2 depends on the scale of the values in the input matrices, while normxcorr2 normalizes the cross correlation values to lie in the interval [-1,1]. Consequently, you can interpret the output of normxcorr2 more easily. If I tell the maximum value of the cross correlation between two matrices using xcorr2 is 200, you have no way of saying whether that indicates a strong linear association or not. All you know is that the correlation is in a certain direction. On the other hand if I tell you the maximum normalized cross correlation is 0.9. That gives you information about the strength of the cross correlation.
  1 件のコメント
Padma
Padma 2011 年 9 月 14 日
hey,thank u!!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by