[GIS] Pan sharpening Quickbird images in Python

python

I'm attempting to pan sharpen four band images in Python with a higher resolution panchromatic band image.

I have imported them using GDAL and converted them to numpy arrays for the purpose of classification. While I'm not looking to classify the images that are pan-sharpened, I am looking to use them for comparison and display purposes.

Is there a way to re-sample the band arrays using the panchromatic array,

Best Answer

May be this is what you are looking for:

Using opencv library

height, width = img_ms.shape[:2]

img_resize=cv2.resize(img_ms ,None,  fx=img_p.shape[1]/width, fy=img_p.shape[0]/height, interpolation=cv2.INTER_LINEAR)

img_p is the panchromatic image img_ms is the multispectral image This will resize the multispectral image to the exact dimensions of the panchromatic.