Hi Alobo,
Unfortunately your images are indeed not in the same physical space. In the case of PanSharpening you only need to have the same origin, which you do not have. Gdal is saying that you have the same origin because you have the same upper left corner (physical). For OTB, the origin is the center of the upper left pixel…
According to gdal, both have the same upper left pixel:
Upper Left ( 0.0000000, 0.0000000) ( 1d29’19.48"W, 0d 0’ 0.01"N)
Obviously, if the images have different resolution (as it must be the case for any pansharpening…) the center of the upper-left pixel is never going to be the same!
Pansharpening does not handle up-sampling of XS channels. It expects perefctly registered pan and xs images (same origin, spacing and size). If you want that you need to use BundleToPerfectSensor, which will perform upsampling first and then pan-sharpening.
ok, the link explains everything, thanks. But then, as far as I understand it, the current otbcli_Pansharpening should actually not exist (or be renamed consistently with whatever it does) and otbcli_BundleToPerfectSensor should be renamed to otbcli_Pansharpening, because that’s what the user is going to use it for.
The current situation is:
An otbcli_Pansharpening that performs P+XS pansharpening but that, in fact, cannot work
An otbcli_BundleToPerfectSensor that is actually doing pansharpening but hides under an inextricable name.
And, in both cases, the doc states This application performs P+XS pansharpening …
Not really. In the litterature I think pan-sharpening per se is the family of algorithm that mixes pan and up-sampled xs channels. You may want ot use that only and handle your resampling somewhere else.
We might have to briefly review the literature, but from the term, “pan”-“sharp” implies increasing the resolution of an image using a panchromatic image of higher resolution. It’s ok keeping 2 steps,
but I think that the whole chain should be called “Pansharpening” and each step should get an appropriate name.
Also, I note that the 3 options available in the current otbcli_Pansharpening application are not available in otbcli_BundleToPerfectSensor, why?
Complete documentation: https://www.orfeo-toolbox.org/CookBook/Applications/app_Pansharpening.html or -help
Parameters:
MISSING -inp <string> Input PAN Image (mandatory)
MISSING -inxs <string> Input XS Image (mandatory)
MISSING -out <string> [pixel] Output image [pixel=uint8/uint16/int16/uint32/int32/float/double/cint16/cint32/cfloat/cdouble] (default value is float) (mandatory)
-method <string> Algorithm [rcs/lmvm/bayes] (mandatory, default value is rcs)
-method.lmvm.radiusx <int32> X radius (mandatory, default value is 3)
-method.lmvm.radiusy <int32> Y radius (mandatory, default value is 3)
-method.bayes.lambda <float> Weight (mandatory, default value is 0.9999)
-method.bayes.s <float> S coefficient (mandatory, default value is 1)
-ram <int32> Available RAM (MB) (optional, off by default, default value is 128)
-inxml <string> Load parameters from XML (optional, off by default)
-progress <boolean> Report progress
-help <string list> Display long help (empty list), or help for given parameters keys
BundleToPerfectSensor
Complete documentation: https://www.orfeo-toolbox.org/CookBook/Applications/app_BundleToPerfectSensor.html or -help
Parameters:
MISSING -inp <string> Input PAN Image (mandatory)
MISSING -inxs <string> Input XS Image (mandatory)
MISSING -out <string> [pixel] Output image [pixel=uint8/uint16/int16/uint32/int32/float/double/cint16/cint32/cfloat/cdouble] (default value is float) (mandatory)
-elev <group> Elevation management
-elev.dem <string> DEM directory (optional, off by default)
-elev.geoid <string> Geoid File (optional, off by default)
-elev.default <float> Default elevation (mandatory, default value is 0)
-mode <string> Mode [default/phr] (mandatory, default value is default)
-method <string> Algorithm [rcs/lmvm/bayes] (mandatory, default value is rcs)
-method.lmvm.radiusx <int32> X radius (mandatory, default value is 3)
-method.lmvm.radiusy <int32> Y radius (mandatory, default value is 3)
-method.bayes.lambda <float> Weight (mandatory, default value is 0.9999)
-method.bayes.s <float> S coefficient (mandatory, default value is 1)
-lms <float> Spacing of the deformation field (optional, off by default, default value is 4)
-interpolator <string> Interpolation [bco/nn/linear] (mandatory, default value is bco)
-interpolator.bco.radius <int32> Radius for bicubic interpolation (mandatory, default value is 2)
-fv <float> Fill Value (optional, off by default, default value is 0)
-ram <int32> Available RAM (MB) (optional, off by default, default value is 128)
-inxml <string> Load parameters from XML (optional, off by default)
-progress <boolean> Report progress
-help <string list> Display long help (empty list), or help for given parameters keys
Can you be more specific? It seems that the 3 options Simple RCS, Local Mean and Variance Matching and Bayesian Fusion are available in the two applications!
I agree with the author of the topic. It is very strange to use a function called “BundleToPerfectSensor” to perform pan-sharpening. In addition, the input parameters in QGIS OTB plugin have different names than in the documentation: