2020
12-10
12-10
python实现图像高斯金字塔的示例代码
importcv2importnumpyasnpimportmatplotlib.pyplotasplt#GrayscaledefBGR2GRAY(img):#Grayscalegray=0.2126*img[...,2]+0.7152*img[...,1]+0.0722*img[...,0]returngray#Bi-Linearinterpolationdefbl_interpolate(img,ax=1.,ay=1.):iflen(img.shape)>2:H,W,C=img.shapeelse:H,W=img.shapeC=1aH=int(ay*H)aW=int(ax*W)#getpositionofresizedi...
继续阅读 >