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)
- new_img1 = cv2.resize(img, None, fx=0.2, fy=0.2, interpolation=cv2.INTER_NEAREST)
- new_img2 = cv2.resize(img, None, fx=0.2, fy=0.2, interpolation=cv2.INTER_LINEAR)
- new_img3 = cv2.resize(img, None, fx=0.2, fy=0.2, interpolation=cv2.INTER_CUBIC)
- new_img4 = cv2.resize(img, None, fx=0.2, fy=0.2, interpolation=cv2.INTER_LANCZOS4)
- cv2.imshow('New image 1', new_img1)
- cv2.imshow('New image 2', new_img2)
- cv2.imshow('New image 3', new_img3)
- cv2.imshow('New image 4', new_img4)
- cv2.waitKey(0)
- cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement