Pansharpening issue with new Pleiades products
Description
With latest Pleiades products, there is a problem in the pansharpening process. If .TIF files for the PAN and MS images are given in input, a runtime error is raised. For example:
2021-02-16 18:49:18 (WARNING) BundleToPerfectSensor: Forcing PHR mode with PHR data. You need to add "-mode default" to force the default mode with PHR images.
2021-02-16 18:49:18 (WARNING) BundleToPerfectSensor: Forcing PHR mode with PHR data. You need to add "-mode default" to force the default mode with PHR images.
2021-02-16 18:49:18 (WARNING) BundleToPerfectSensor: Forcing PHR mode with PHR data. You need to add "-mode default" to force the default mode with PHR images.
Traceback (most recent call last):
File "pxs_fusion.py", line 31, in <module>
extract_app.ExecuteAndWriteOutput()
File "/softs/projets/otb/rh7/7.0-python3.7.2/otb/lib/otb/python/otbApplication.py", line 2852, in ExecuteAndWriteOutput
return _otbApplication.Application_ExecuteAndWriteOutput(self)
RuntimeError: Exception thrown in otbApplication Application_ExecuteAndWriteOutput: /home/mp/pernotg/scratch/otb-7.0/otb/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx:185:
Requested region is (at least partially) outside the largest possible region.
If the DIMAP files are used instead, no error is raised. However, when checking the result, high frequencies (PAN) and low frequencies (MS) do not overimposed. An example of result:
Steps to reproduce
Below, a script to reproduce the problem:
import otbApplication
from glob import glob
with_tif_files = True
# input data
if with_tif_files:
pan_img = "/work/OT/ai4geo/DATA/IN/AIRBUS_TEST_MARSEILLE/5500853101/IMG_PHR1A_P_001/IMG_PHR1A_P_201305201033414_SEN_5500853101-1_R1C1.TIF"
ms_img = "/work/OT/ai4geo/DATA/IN/AIRBUS_TEST_MARSEILLE/5500853101/IMG_PHR1A_MS_003/IMG_PHR1A_MS_201305201033570_SEN_5500853101-2_R1C1.TIF"
else:
pan_img = glob("/work/OT/ai4geo/DATA/IN/AIRBUS_TEST_MARSEILLE/5500853101/IMG_PHR1A_P_001/DIM*")[0]
ms_img = glob("/work/OT/ai4geo/DATA/IN/AIRBUS_TEST_MARSEILLE/5500853101/IMG_PHR1A_MS_003/DIM*")[0]
x, y, w, h = 9000, 1000, 5000, 5000
# build pansharpening pipeline
pansharpening_app = otbApplication.Registry.CreateApplication("BundleToPerfectSensor")
pansharpening_app.SetParameterString("inp", pan_img)
pansharpening_app.SetParameterString("inxs", ms_img)
pansharpening_app.Execute()
# build extractroi
extract_app = otbApplication.Registry.CreateApplication("ExtractROI")
extract_app.SetParameterInputImage("in", pansharpening_app.GetParameterOutputImage("out"))
extract_app.SetParameterInt("startx", x)
extract_app.SetParameterInt("starty", y)
extract_app.SetParameterInt("sizex", w)
extract_app.SetParameterInt("sizey", h)
extract_app.SetParameterString("out", "pxs1.tif")
extract_app.ExecuteAndWriteOutput()`
Configuration information
The version in default is the one used in CARS soft: OTB 7.0.0 Linux64 from https://www.orfeo-toolbox.org/packages/OTB-6aca6c3e-Linux64.run