title: Why does cv2.addweighted() give an error that the operation is neither 'array op array', nor 'array op scalar', nor ' scalar op array'?
body: <p>This is my code for image blending but there is something wrong with the cv2.addweighted() function:</p>
  
  <pre><code>import cv2
  import numpy as np
  
  img1 = cv2.imread('1.png')
  img2 = cv2.imread('messi.jpg')
  dst= cv2.addWeighted(img1,0.5,img2,0.5,0)
  
  cv2.imshow('dst',dst)
  cv2.waitKey(0)
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>The error is :</p>
  
  <pre><code>Traceback (most recent call last):
      dst= cv2.addWeighted(img1,0.5,img2,0.5,0)
  cv2.error: C:\projects\opencv-python\opencv\modules\core\src\arithm.cpp:659: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function cv::arithm_op
  </code></pre>
  
  <p>What is the problem? I searched the function and I'm sure that the function is correct. I didn't understand the error! </p>