title: Python: opencv warpPerspective accepts neither 2 nor 3 parameters
body: <p>I found the Homography matrix following the <a href="https://docs.opencv.org/3.4.1/d1/de0/tutorial_py_feature_homography.html" rel="nofollow noreferrer">Feature Matching + Homography tutorial</a> using</p>
  
  <pre><code>M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC,5.0)
  </code></pre>
  
  <p>and now I need to warp the second image (rotated one) to match the keypoints of the first one, so I tried to do with <code>warpPerspective</code> directly on <code>img2</code> since we have the Homography matrix already. (They did not use warpPersective in the tutorial)</p>
  
  <pre><code>dst = cv2.warpPerspective(img2, M)
  </code></pre>
  
  <p>and it complains that I'm missing the third argument</p>
  
  <pre><code>TypeError: Required argument 'dsize' (pos 3) not found
  </code></pre>
  
  <p>Fair enough, I checked what <code>dsize</code> is in the <a href="https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#warpperspective" rel="nofollow noreferrer">docs</a>, and it seems it's the destination image size. Well, it could be inferred if not given, but opencv is expecting it, (grrr... fine opencv, I'll give you that). I tried again</p>
  
  <pre><code>dst = cv2.warpPerspective(img2, M, img2.shape)
  </code></pre>
  
  <p>and it throws</p>
  
  <pre><code>TypeError: function takes exactly 2 arguments (3 given)
  </code></pre>
  
  <p>Wait, didn't I try it with 2 arguments just a minute ago?</p>
  
  <p><strong>What's wrong?</strong></p>