normalized cross-correlation for analytic signals

조회 수: 2 (최근 30일)
BLP
BLP 2011년 12월 2일
I am trying to write a function for template matching using normalized cross-correlation. The normxcorr2 function seems to be an ideal solution but it does not accept non-real template and it returns only double result:
??? Error using ==> iptcheckinput Function NORMXCORR2 expected its first input, T, to be real.
Error in ==> normxcorr2>ParseInputs at 242 iptcheckinput(T,{'logical','numeric'},{'real','nonsparse','2d','finite'},mfilename,'T',1)
Error in ==> normxcorr2 at 61 [T, A] = ParseInputs(varargin{:});
Unfortunately my data are 2D analytic signals and to find the best match for the template I should use the zero crossing of the normalized cross-correlation (complex) phase in the vicinity of the maximum of the normalized cross-correlation (complex) magnitude.
Is it possible to slightly modify the normxcorr2 function so that it will accept complex images? Or the best solution is to use the xcorr2 function, however then abs(xcorr2) will not be normalized.

답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 12월 2일
You could perhaps normalize xcorr2 by dividing by the product of the standard deviations. I'd recommend against trying to modify normxcorr2.
  댓글 수: 1
BLP
BLP 2011년 12월 2일
Thanks for the fast response. I do have one more question. As far I understand when normxcorr2 function do the calculations in the space domain the corss-correlation is calculated using not xcorr2 but conv2 function which works well for complex numbers. I guess, what is calculated further is the normalization. In what is conv2 better xcorr2?

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

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by