title: How can I remap a point after an image rotation?
body: <p>I have a mathematical question: let's suppose I rotate an image around its center by an angle of 30°, using the opencv with the following commands:</p>
  
  <pre><code>M = cv2.getRotationMatrix2D((cols/2,rows/2),30,1)
  img_rotate = cv2.warpAffine(img,M,(cols,rows))
  </code></pre>
  
  <p>If a take the pixel (40,40) of the img_rotate, how can I know which is the corresponding pixel in the original image?</p>
  
  <p>EDIT: in other words, when I apply the rotation to an image I obtain the transformed image. Is there the possibility to obtain the mapping between points? For example the (x,y) point of the new image corresponds to (x',y') point of the original image.</p>