Request for changes-117: Merge Convert and Rescale applications

From OTBWiki
Jump to: navigation, search

[Request for changes - 117] Merge Convert and Rescale applications

Status

Summary

Merge the applications Convert and Rescale into new application : DynamicConvert.

Its name, DynamicConvert, is a suggestion.

Rationale

These two applications (Convert and Rescale) convert the image dynamics, and thus, are very similar.

In order to remove duplicates, these two applications merge.

Implementation details

classes and files

M       Modules/Applications/AppImageUtils/app/otbConvert.cxx
M       Modules/Applications/AppImageUtils/app/otbRescale.cxx
M       Modules/Wrappers/ApplicationEngine/include/otbWrapperTags.h

The Rescale and Convert applications are deprecated and the "Deprecated" tag is added.

Applications

M       Modules/Applications/AppImageUtils/app/CMakeLists.txt
A       Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx

This new application allows to :

  • write the output image in the specified format (pixel type at uint8 by default)
  • apply an input dynamic : histrogram cutting [quantile.high and quantile.low]
  • apply an output dynamic : min and max values [outmin and outmax]
  • choice the rescale type [linear, log2], linear default
  • apply a gamma correction (with the linear rescale mode)
  • mask pixels
  • select channels
  • remove the nodata value in the histogram

Tests

M       Modules/Applications/AppImageUtils/test/CMakeLists.txt

Add 3 tests:

  • apTvUtDynamicConvertBasic
  • apTvUtDynamicConvertLog2
  • apTvUtDynamicConvertFloat


Documentation

Additional notes

Parameters: 
        -progress                   <boolean>        Report progress 
        -help                       <string list>    Display long help (empty list), or help for given parameters keys
        -in                         <string>         Input image  (mandatory)
        -out                        <string> [pixel] Output Image  [pixel=uint8/uint16/int16/uint32/int32/float/double] (default value is uint8) (mandatory)
        -type                       <string>         Rescale type [linear/log2] (mandatory, default value is linear)
        -type.linear.gamma          <float>          Gamma correction factor  (optional, on by default, default value is 1)
        -mask                       <string>         Input mask  (optional, off by default)
        -quantile.high              <float>          High cut quantile  (optional, off by default, default value is 2)
        -quantile.low               <float>          Low cut quantile  (optional, off by default, default value is 2)
        -channels                   <string>         Channels selection [all/grayscale/rgb] (mandatory, default value is all)
        -channels.grayscale.channel <int32>          Grayscale channel  (mandatory, default value is 1)
        -channels.rgb.red           <int32>          Red Channel  (mandatory)
        -channels.rgb.green         <int32>          Green Channel  (mandatory)
        -channels.rgb.blue          <int32>          Blue Channel  (mandatory)
        -outmin                     <float>          Output min value  (optional, on by default, default value is 0)
        -outmax                     <float>          Output max value  (optional, on by default, default value is 255)
        -ram                        <int32>          Available RAM (Mb)  (optional, off by default, default value is 128)
        -inxml                      <string>         Load otb application from xml file  (optional, off by default)