title: Python: Determine co-ordinates of a point after rotation in OpenCV using warpPerspective
body: <p>I have an image <code>img2</code> with two certain co-ordinates <code>point1(x,y)</code> and <code>point2(x,y)</code>. When I rotate the image with an angle <code>anglediff</code> these points shift to new location in new image <code>rotated_image2</code>, which I want to determine using <code>cv2.warpPerspective</code>. For this I supply these points as a numpy array <code>pts</code> to the function.</p>
  <pre><code>  pts = np.array([[point1[0],point1[1]],[point2[0],point2[0]]]) #given points
    M = cv2.getPerspectiveTransform(pts,rotated_image2)
    dst = cv2.warpPerspective(img2,M,(500,400))
  </code></pre>
  <p><strong>Problem:</strong>
  While running the function, script throws</p>
  <pre><code>cv2.error: OpenCV(4.4.0) /tmp/pip-req-build-zeowd5_m/opencv/modules/imgproc/src/imgwarp.cpp:3391: error: (-215:Assertion failed) src.checkVector(2, CV_32F) == 4 &amp;&amp; dst.checkVector(2, CV_32F) == 4 in function 'getPerspectiveTransform'
  </code></pre>
  <p>which after my research points to the fact that either of those variables <code>pts</code> or <code>rotated_image_2</code> is not passed correctly.</p>
  <p><strong>Question:</strong></p>
  <ol>
  <li><p>How do I go about finding the new co-ordinates of P1 and P2 in the new rotated image?</p>
  </li>
  <li><p>If I am on the right way, how do I go about solving this issue?</p>
  </li>
  </ol>