First, a grid of empty dots is created with a dot per pixel.
x, y = N.meshgrid(N.arange(img.shape[1]), N.arange(img.shape[0]))
Real image pixels are placed in a variable ptsthat will be needed later.
pts = N.column_stack((x.ravel(), y.ravel()))
; 200x400, colscale, 4 rowscale, 2, (200 * 4) x (400 * 2) 800x800 .
xx, yy = N.mgrid[0.:float(img.shape[1]):1/float(colscale),
0.:float(img.shape[0]):1/float(rowscale)]
scipy, pts . - , .
large = scipy.interpolate.griddata(pts, img.flatten(), (xx, yy), method).T
100%, , , griddata. , , .
large[-1,:] = large[-2,:]
large[:,-1] = large[:,-2]
return large