4

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,

nmtoken
  • 13,355
  • 5
  • 38
  • 87
ArcAngel
  • 71
  • 1
  • 6

1 Answers1

1

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.

Ivan
  • 233
  • 2
  • 13