title: Trying to find/understand correct implementation of Harris Corners
body: <p>I'm trying to understand how to compute the Harris Corner M, as defined in
  <a href="https://courses.cs.washington.edu/courses/cse455/07wi/homework/hw3/" rel="nofollow">https://courses.cs.washington.edu/courses/cse455/07wi/homework/hw3/</a></p>
  
  <p>It seems that you need to sum over a bunch of patches. </p>
  
  <p>However, I've seen lots of implementations that do something like this:</p>
  
  <pre><code>  R = (Ix2.*Iy2 - Ixy.^2) - k*(Ix2 + Iy2).^2; 
  </code></pre>
  
  <p>from: <a href="http://web.engr.illinois.edu/~slazebni/spring14/harris.m" rel="nofollow">http://web.engr.illinois.edu/~slazebni/spring14/harris.m</a></p>
  
  <p>There is no summing and you never look at a patch. </p>
  
  <p>These don't look equivalent to me. For example, the "R" value for pixel 5,5 is just Ix2, Iy2, and Ixy value squared just for that pixel. However, the math seems to suggest you sum over a patch over, say, pixel 5,5. Which implementation is correct? Both? Are they equivalent?</p>
  
  <p>Note: Ix2 = squared gradient of Image I in x direction
  Iy2 is the same except in y direction
  Ixy = Ix.*Iy</p>
  
  <p>Also, the .* or .^ is matlab notation indicating point-wise multiplication or exponentiation. </p>