最近邻:
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)
废话不多说了,直接给大家贴代码了,具体代码如下所述:
单击循环切换图片
[removed]
var i = 1;
function nextImg(){
i++;
//步骤2:获取页面元素
var next = document.getElementById(nImg);
//步骤3:更改元素的src属性
next.src = img/+i+.jpg;
if(i==3){
i=0;
}
}
[re