title: normxcorr2 vs. normxcorr2_general in Matlab
body: <p>There is a file called normxcorr2_general on MathWorks <a href="http://www.mathworks.com/matlabcentral/fileexchange/29005-generalized-normalized-cross-correlation" rel="nofollow">here</a> that the author claims always gives correct answers while Matlab's built-in normxcorr2 gives incorrect answers when the two input matrices are close in size. After doing some testing, it is clear that the two functions do give significantly different outputs when the inputs are the same size.</p>
  
  <p>Is normxcorr2_general actually more accurate? I don't have much experience in Matlab and I'm having trouble figuring that out from reading through the function script.</p>
  
  <p>Edit: To clarify, if I understand it correctly then these functions are both implementing equation number (2) in <a href="http://scribblethink.org/Work/nvisionInterface/nip.pdf" rel="nofollow">this</a> paper about computing normalized cross-correlations.</p>