Normalized Correlation

I have a vector A 1x512 and a matrix M 512 x 512. I need to value the normalized correlation between A and the ith row of the matrix M.
I think:
corr_rows = zeros(1,512);
for i=1:512
Row = A(i,:);
corr_rows(i) = corr2(A,Row);
end
Is It correct? And the normalization?
Thanks!!!

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 10월 25일

0 개 추천

Looks almost right to me, does it look right to you?
Hint: you need to change A to M in the assignment to row. Okay, that was a really nice hint.

댓글 수: 1

Bruno Bertini
Bruno Bertini 2011년 10월 25일
Row = M(i,:);
Just a write error, sorry. :-)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2011년 10월 25일

0 개 추천

If you want normalized, then you'll have to use normxcorr2() instead of xcorr2.

댓글 수: 1

Bruno Bertini
Bruno Bertini 2011년 10월 26일
But normxcorr2 creates a vector, corr2 a number. And corr_rows must be a vector, not a matrix.

댓글을 달려면 로그인하십시오.

카테고리

Community Treasure Hunt

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

Start Hunting!

Translated by