title: How to subtract two different size image and grayscale image in opencv
body: <p>I have 3 Images, I try to subtract First and Second image that have same size dimensions and got the result. next, I try to subtract First and Third image, First Image have dimensions(2000x1000) and Third Image have dimensions(1200x1057) and i got an error.</p>
  
  <pre><code>//! [window]
  namedWindow("min", WINDOW_NORMAL);
  resizeWindow("min", 1000, 500);
  namedWindow("plus", WINDOW_NORMAL); 
  resizeWindow("plus", 1000, 500); 
  namedWindow("adf", WINDOW_NORMAL); 
  resizeWindow("adf", 1000, 500);
  
  Mat min,plus,adf;
  
  subtract(im, im2, min);  //error 
  add(im, im2, plus);
  absdiff(im, im2, adf);
  
  imshow("min", min); 
  imshow("plus", plus);
  imshow("adf", adf);
  </code></pre>
  
  <p>and i try to substarct greyscale image with same dimensions and i got an error too. can someone explain to me why i got an error please.</p>
  
  <p>Thank you.</p>