title: Problems with OpenCV warpPerspective with transparent images
body: <p>I'm trying to change the perspective of a fake glasses image with OpenCV, but the transparent parts and opacity get lost. Resulting image has no transparencies.
  I want to change the perspective in order to stamp the resulting image over another image.</p>
  
  <p>Can I do this with OpenCV?</p>
  
  <pre><code>#!/usr/bin/python
  import numpy as np
  import cv2
  
  glasses = cv2.imread('fake_glasses.png')
  
  RES_SIZE = (500,640)
  
  pts1 = np.float32([[  0,  0], [599,  0],
                     [  0,208], [599,208]])
  pts2 = np.float32([[ 94,231], [354,181],
                     [115,316], [375,281]])
  
  M = cv2.getPerspectiveTransform(pts1,pts2)
  
  rotated = cv2.warpPerspective(glasses, M, RES_SIZE)
  cv2.imwrite("rotated_glasses.png", rotated)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/BnwcT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BnwcT.png" alt="fake_glasses.png (with transparent parts"></a></p>
  
  <p><a href="https://i.stack.imgur.com/PFkbW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PFkbW.png" alt="mask.png"></a></p>