Tag:Bilinear

  • Python opencv bilinear interpolation example

    Time:2020-9-25

    I will not say much nonsense, directly on the code! #coding=utf-8 import cv2 import numpy as np Bilinear interpolation img = cv2.imread(‘timg.jpeg’, cv2.CV_LOAD_IMAGE_GRAYSCALE) # load the gray image cv2.imwrite(‘img.jpg’, img) h, w = img.shape[:2] # shrink to half of the original a1 = np.array([[0.5, 0, 0], [0, 0.5, 0]], np.float32) d1 = cv2.warpAffine(img, a1, (w, […]