最近邻:
import cv2
import numpy as np
def function(img):
height,width,channels =img.shape
emptyImage=np.zeros((2048,2048,channels),np.uint8)
sh=2048/height
sw=2048/width
for i in range(2048):
for j in range(2048):
x=int(i/sh)
y=int(j/sw)
emptyImage[i,j]=img[x,y]
return emptyImage\nimg=
1