[gdal-dev] pansharpen subset of multispectral bands

Joe McGlinchy joe at aidash.com
Thu Jan 9 14:01:31 PST 2025


Thanks for that explanation, Even. Is this to say, if i have a panchromatic band that spans coastal-blue-green-red-rededge1-rededge2-rededge2-nir, and I only have blue-green-red-NIR, that pansharpening is invalid? The math works out, but it may not be a spectrally consistent result.

I'm able to calculate the weights for the full band set given a data provider's RSR data. But sometimes we do not get the full multispectral product due to ordering specifics. The pseudo-code suggests that I'd be producing a pseudo-panchromatic value using the bands I provide, regardless of if I have the full multispectral band set or not. This works out math-wise, but in terms of image interpretation, it would be preferable to use the full multispectral band set. In the event that I do not, such as having a 4-band subset that is still within the spectral bandwidth of the panchromatic band, it seems the pansharpening operation should still hold. Or am I misreading something? Please advise.

Thanks for your help!
Joe
________________________________
From: Even Rouault <even.rouault at spatialys.com>
Sent: Thursday, January 9, 2025 14:49
To: Joe McGlinchy <joe at aidash.com>; Barry DeZonia <bdezonia at gmail.com>
Cc: gdal-dev at lists.osgeo.org <gdal-dev at lists.osgeo.org>
Subject: Re: [gdal-dev] pansharpen subset of multispectral bands


EXTERNAL SENDER. DO NOT click links, or open attachments, if the sender is unknown, or the message seems suspicious in any way. DO NOT provide your user ID or Password.





> in the event that we are provided only 4 bands, but from an 8-band system, will this still hold? It is what we have to work with, unfortunately or not.

Yes, obviously, the example generalizes to other number of bands.

So, providing either band_nums=[1,2,3,4] along with weights and extracting bands 1 and 4 after-the-fact, or band_nums=[1,4] and providing the corresponding weights for those bands, in my mind should produce something similar? I haven't tried it just yet.

No.

Let's consider the minimum example:

A = 10, weightA = 0.7

B = 20, weightB = 0.3

P = 30

PseudoPanchro = 10 * 0.7 + 20 * 0.3 = 13

then A_pansharpened = A / PseudoPanchro * Panchro = 10. / 13 * 30 = 23.08

and  B_pansharpened= B / PseudoPanchro * Panchro = 20. / 13 * 30 = 46.15

If you ignore B, than A_pansharpened = 10. / (10 * 0.7) * 30 = 42.85

And, even if you rebalance the reduced set of weights so its sum is still 1, which makes much more sense, that still won't work, because that would in that example just give the value of P.

https://github.com/mapbox/rio-pansharpen/blob/master/docs/pansharpening_methods.rst#brovey : "It assumes that the spectral range spanned by the panchromatic image is the same as that covered by the multispectral channels."   If you ignore multispectral channels in the computation of the pseudo panchro value, then the assumption no longer holds true. Or you need some magic to generate a reference panchromatic image that only takes into account the subset of bands you are interested in.

--
http://www.spatialys.com
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250109/bed7bfba/attachment-0001.htm>


More information about the gdal-dev mailing list