title: Precisely Compare 2 images for differences using OpenCV
body: <p>I am working on a project to capture images via webcam in a predefined time interval, and continuously compare the images to a template (good image) and give an error if the difference is > tolerance set.</p>
  
  <p>I working out using OpenCV. Would like to have advice how should I do it, e.g. best method, etc.</p>
  
  <p>Appreciate if any one can help me on this. Thanks.</p>