一般而言:
cv.INTER_AREA 用来缩小;
cv.INTER_CUBIC (slow) & cv.INTER_LINEAR 用来放大;
默认就是 cv.INTER_LINEAR,可以在用在 all resizing purposes.
示例代码:
import numpy as np
import cv2 as cv
img = cv.imread('messi5.jpg')
res = cv.resize(img,None,fx=2, fy=2, interpolation = cv.INTER_CUBIC)
#OR
height, width = img.shape[:2]
res = cv.resize(img,(2*width, 2*height), interpolation = cv.INTER_CUBIC)