normalized cross-correlation for analytic signals
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!