Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. src = np.float32(
  2. [[280, 700], # Bottom left
  3. [595, 460], # Top left
  4. [725, 460], # Top right
  5. [1125, 700]]) # Bottom right
  6.  
  7. dst = np.float32(
  8. [[250, 720], # Bottom left
  9. [250, 0], # Top left
  10. [1065, 0], # Top right
  11. [1065, 720]]) # Bottom right
  12.  
  13.  
  14. offset =50
  15. def perspective(img):
  16. img_size = (img.shape[1], img.shape[0])
  17. M = cv2.getPerspectiveTransform(src, dst)
  18. warped = cv2.warpPerspective(img, M, img_size)
  19.  
  20. return warped
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement