title: Explaining corr2 function in Matlab
body: <p>Can someone explain to me the correlation function <code>corr2</code> in MATLAB? I know that it is for 2D comparing similarities of objects, but in the equation <a href="https://i.stack.imgur.com/csmdQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/csmdQ.png" alt="enter image description here"></a> I have doubts what it is <code>A</code> and <code>B</code> (probably matrices for comparison), and also <code>Amn</code> and <code>Bmn</code>.</p>
  
  <p>I'm not sure how MATLAB executes this function, because I have found in several cases that the correlation is not executed for the entire image (matrix) but instead it divides the image into blocks and then compares blocks of one picture with blocks of another picture.</p>
  
  <p>In MATLAB's documentation, the <code>corr2</code> equation is not put as referral point to the way the equation itself is calculated, like in other functions in MATLAB's documentation, such as referring to what book it is taken from and where it is explained.</p>