title: Image comparison algorithm
body: <p>I'm trying to compare images to each other to find out whether they are different. First I tried to make a Pearson correleation of the RGB values, which works also quite good unless the pictures are a litte bit shifted. So if a have a 100% identical images but one is a little bit moved, I get a bad correlation value.</p>
  
  <p>Any suggestions for a better algorithm? </p>
  
  <p>BTW, I'm talking about to compare thousand of imgages...</p>
  
  <p>Edit:
  Here is an example of my pictures (microscopic):</p>
  
  <p>im1: </p>
  
  <p><img src="https://i.stack.imgur.com/C8Wbt.jpg" alt="enter image description here"></p>
  
  <p>im2: </p>
  
  <p><img src="https://i.stack.imgur.com/vGlW4.jpg" alt="enter image description here"></p>
  
  <p>im3: </p>
  
  <p><img src="https://i.stack.imgur.com/ev4a4.jpg" alt="enter image description here"></p>
  
  <p>im1 and im2 are the same but a little bit shifted/cutted, im3 should be recognized as completly different...</p>
  
  <p><strong>Edit:</strong>
  <strong>Problem is solved with the suggestions of Peter Hansen! Works very well! Thanks to all answers! Some results can be found here
  <a href="http://labtools.ipk-gatersleben.de/image%20comparison/image%20comparision.pdf" rel="noreferrer">http://labtools.ipk-gatersleben.de/image%20comparison/image%20comparision.pdf</a></strong></p>