Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import cv2
- # Load the image
- img = cv2.imread('peter.jpg',0)
- # Display the original image
- cv2.imshow('Original image',img)
- # Reduce the image size by 50%
- Reduced_img = cv2.resize(img,(0,0),fx=0.5,fy=0.5)
- cv2.imshow('Reduced image',Reduced_img)
- # Upscale the image by 150%
- Upscaled_img = cv2.resize(img,(0,0),fx=1.5,fy=1.5)
- cv2.imshow('Upscaled image',Upscaled_img)
- # Wait for the user to close the windows
- cv2.waitKey(0)
- cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement