Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import cv2
- img = cv2.imread('peter.jpg',0)
- cv2.imshow('Original image',img)
- print(img.shape)
- new_width = 600
- dim_size = (new_width, img.shape[0])
- horizonStretchedImg = cv2.resize(img, dim_size, interpolation = cv2.INTER_AREA)
- cv2.imshow('Horizon stretched image',horizonStretchedImg)
- cv2.waitKey(0)
- cv2.destroyAllWindows()
- import numpy as np
- import cv2
- img = cv2.imread('peter.jpg',0)
- cv2.imshow('Original image',img)
- print(img.shape)
- new_height = 600
- dim_size = (img.shape[1], new_height)
- verticallyStretchedImg = cv2.resize(img, dim_size, interpolation = cv2.INTER_AREA)
- cv2.imshow('Vertically stretched image',verticallyStretchedImg)
- cv2.waitKey(0)
- cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement