Support GDAL statitistics into OTB

What changes will be made and why they would make a better Orfeo ToolBox?

This issue is about computing full-image statistics (min, max, mean, standard-deviation) and histogram on all bands as a Monteverdi-driven background task.

Currently, since it takes considerable time to process full image-data, Monteverdi approximates this calculation by doing it synchronously on a reduced pixel-data set which is the 512x512 best-fit overview. However, GDAL allows to compute full image-data statistics and store them in its meta-data file. This feature could be used by Monteverdi and OTB in order to process full image-data statistics and histogram in a background task and store it for future use.

High level description

GDAL

At the lowest level, the GDAL API provides some statistics and histogram functions on full or resampled image-data. The following ones could be used:

Also, a statistics editor QWidget could be implemented and added as a QDockWidget tabbed with the histogram one.

Similarly to the histogram-view, the statistics computation could be done asynchronously and ordered from a QToolButton which could be added to the statistics QDockWidget.

Risks and benefits

OTB would benefit from an API allowing to drive cached statistics and histogram computation on full image-data directly from otb::ImageFileReader and otb::ImageFileWriter. Moreover, the implementation of a otb::HistogramDataObject and some statistics and histogram filters based on the above-mentioned API could be considered (or, maybe the refactoring of existing filters) in order to use statistics and histogram as input and output in OTB pipelines.

However, the use of the No-Data value is not stated in the documentation of statistics and histogram functions of the GDAL API and should be checked (source code and/or experimentaly). Moreover, since the user can edit and enable/disable the use of the No-Data value which should be taken into acount in the statistics and histograms computations, the statistics and histogram might be inconsistent with image-data setup. Thus, a guarding or identifying mechanism should be discussed (e.g. adding the No-Data value of the last computation in the GDAL meta-data and/or popping-up a warning/failure dialog in Monteverdi).

Alternatives for implementations

Not Applicable.

Who will be developing the proposed changes?

(TBD) :

Developer who has strong knowledge of OTB and ITK core IO and pipeline.