Function opticalcalibration executed but did not generate any output
Hi,
I work with OTB 6.6.1 in python3, on CentOs 7, to do some pre-processing on Pleiades image. I'm a very beginner.
When I do
# Set all the application parameters:
self.opticalcalibration.SetParameterString("in", input_image)
self.opticalcalibration.SetParameterString("level","toa")
self.opticalcalibration.SetParameterString("acqui.gainbias", gainbias_file)
self.opticalcalibration.SetParameterString("acqui.solarilluminations",solarilluminations_file)
self.opticalcalibration.SetParameterString("out", output_image)
# Execute the application
self.opticalcalibration.ExecuteAndWriteOutput()
The function seems to do the job but does not provide any output. Above there is the trace in my console:
--- Correction --- # Here I'm just using OTB BandMath and ConcatenateImages function to merge B1, B2, B3, B4 in 1 xs
input pan: /.../input_pan.tif
input xs : /.../input_xs.tif
output : /.../corrected_pan.tif
output : /.../corrected_xs_B1.tif
output : /.../corrected_xs_B2.tif
output : /.../corrected_xs_B3.tif
output : /.../corrected_xs_B4.tif
2019-09-13 15:43:55 (INFO): No kwl metadata found in file /.../input_pan.tif
2019-09-13 15:43:55 (INFO): Estimated memory for full processing: 76.2558MB (avail.: 128 MB), optimal image partitioning: 1 blocks
2019-09-13 15:43:55 (INFO): File /.../corrected_pan.tif will be written in 1 blocks of 2000x2000 pixels
2019-09-13 15:43:55 (INFO): No kwl metadata found in file /.../input_xs.tif
2019-09-13 15:43:55 (INFO): Estimated memory for full processing: 167.809MB (avail.: 128 MB), optimal image partitioning: 2 blocks
2019-09-13 15:43:55 (INFO): File /.../corrected_xs_B1.tif will be written in 3 blocks of 2000x667 pixels
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../input_xs.tif
2019-09-13 15:43:56 (INFO): Estimated memory for full processing: 167.809MB (avail.: 128 MB), optimal image partitioning: 2 blocks
2019-09-13 15:43:56 (INFO): File /.../corrected_xs_B2.tif will be written in 3 blocks of 2000x667 pixels
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../input_xs.tif
2019-09-13 15:43:56 (INFO): Estimated memory for full processing: 167.809MB (avail.: 128 MB), optimal image partitioning: 2 blocks
2019-09-13 15:43:56 (INFO): File /.../corrected_xs_B3.tif will be written in 3 blocks of 2000x667 pixels
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../input_xs.tif
2019-09-13 15:43:56 (INFO): Estimated memory for full processing: 167.809MB (avail.: 128 MB), optimal image partitioning: 2 blocks
2019-09-13 15:43:56 (INFO): File /.../corrected_xs_B4.tif will be written in 3 blocks of 2000x667 pixels
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../corrected_xs_B1.tif
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../corrected_xs_B2.tif
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../corrected_xs_B3.tif
2019-09-13 15:43:56 (INFO): No kwl metadata found in file /.../corrected_xs_B4.tif
2019-09-13 15:43:56 (INFO): Estimated memory for full processing: 305.023MB (avail.: 128 MB), optimal image partitioning: 3 blocks
2019-09-13 15:43:56 (INFO): File /.../corrected_xs.tif will be written in 4 blocks of 2000x501 pixels
--- Calibration Pan ---
input : /.../corrected_pan.tif
output : /.../optical_calibration_pan.tif
--- Calibration XS ---
input : /.../corrected_xs.tif
output : /.../optical_calibration_xs.tif
--- Fusion ---
input : /.../optical_calibration_pan.tif
input : /.../optical_calibration_xs.tif
output : /.../fusion.tif
Traceback (most recent call last):
File "main_all_step.py", line 79, in <module>
...
File "/usr/local/lib/otb/python/otbApplication.py", line 2526, in ExecuteAndWriteOutput
return _otbApplication.Application_ExecuteAndWriteOutput(self)
RuntimeError: Cannot open image /...t/optical_calibration_xs.tif. The file does not exist.
When I look at my data :
- input_pan.tif is extracted from a bigger image .jp2 using OTB extractROI (standard) function
- input_xs.tif is extracted from a bigger image .jp2 using OTB extractROI (fit on the pan extracted) function
- corrected_pan.tif seems to be well generated
- corrected_xs.tif seems to be well generated
What I understand : BandMath and ConcatenateImage are doing the job, opticalcalibration does the job but don't save the result. --> Why ?
I tryed the same code on Windows with OTB 6.6.1. This time this part is working well but it fails at the step corresponding to the OTB OrthoRectification function with following error :
Exception thrown in otbApplication Application_ExecuteAndWriteOutput: c:\dashboard\otb\src\modules\core\transform\include\otbImageToGenericRSOutputParameters.txx:54:
itk::ERROR: ImageToGenericRSOutputParameters(000001AEDE62B560): No information in the metadata, please set an image with non empty metadata
Does the step opticalcalibration on CentOs 7 also fails because there are no metadata setted ? If yes how can I set the metadata to avoid this ?
Thanks for help