Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. width = 480
  2. original_width = image.shape[1]
  3.  
  4. if original_width != width:
  5. ratio_resize = int(width / original_width)
  6. height = (image.shape[0] * ratio_resize) #get the height respecting the ratio
  7. dim = (width, height) #new dimensions
  8. resized = cv2.resize(image, dim)
  9. print("resized dimenson:", resized.shape)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement