title: To use OpenCV/cv2 to compare and mark the difference between 2 images (with pictures)
body: <p>I want to use Python and cv2 to compare 2 images, like below.</p>
  
  <p>(Python 2.7 + Windows)</p>
  
  <p>c:\Original.jpg</p>
  
  <p><img src="https://i.stack.imgur.com/BR9JB.jpg" alt="c:\Original.jpg"></p>
  
  <p>c:\Edited.jpg</p>
  
  <p><img src="https://i.stack.imgur.com/rLDlJ.jpg" alt="Edited.jpg"></p>
  
  <p>Pretty straight forward I can do below and save a picture showing the difference:</p>
  
  <pre><code>import cv2 
  
  Original = cv2.imread("c:\\Original.jpg")
  Edited = cv2.imread("c:\\Edited.jpg")
  
  diff = cv2.subtract(Original, Edited)
  
  cv2.imwrite("c:\\diff.jpg", diff)
  </code></pre>
  
  <p>the result is like:</p>
  
  <p>c:\diff.jpg</p>
  
  <p><img src="https://i.stack.imgur.com/YbDOH.jpg" alt="c:\diff.jpg"></p>
  
  <p>Further, I want the difference to be shown in a picture, based on the files compared. In another word, I want to have a picture circle or mark the difference, based on “Edited.jpg”. is it possible?</p>
  
  <p>(thinking one of the ways could be, to identify the visible area in the "diff.jpg", then draw a circle for the area in the "Edited.jpg"?)</p>