[gdal-dev] pansharpen subset of multispectral bands

Even Rouault even.rouault at spatialys.com
Thu Jan 9 13:49:18 PST 2025


 > 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/7cf0b159/attachment.htm>


More information about the gdal-dev mailing list