Skip to content

Simplify binary morpho app

Rémi Cresson requested to merge simplify_binary_morpho_app into develop

Summary

Simplify the BinaryMorphologicalOperation.

Before:

Parameters: 
MISSING -in                     <string>         Input 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)
        -channel                <int32>          Selected Channel  (mandatory, default value is 1)
        -structype              <string>         Type of structuring element [box/ball/cross] (mandatory, default value is box)
        -xradius                <int32>          Structuring element X radius  (mandatory, default value is 5)
        -yradius                <int32>          Structuring element Y radius  (mandatory, default value is 5)
        -filter                 <string>         Morphological Operation [dilate/erode/opening/closing] (mandatory, default value is dilate)
        -filter.dilate.foreval  <float>          Foreground value  (mandatory, default value is 1)
        -filter.dilate.backval  <float>          Background value  (mandatory, default value is 0)
        -filter.erode.foreval   <float>          Foreground value  (mandatory, default value is 1)
        -filter.erode.backval   <float>          Background value  (mandatory, default value is 0)
        -filter.opening.foreval <float>          Foreground value  (mandatory, default value is 1)
        -filter.opening.backval <float>          Background value  (mandatory, default value is 0)
        -filter.closing.foreval <float>          Foreground value  (mandatory, default value is 1)
        -ram                    <int32>          Available RAM (MB)  (optional, off by default, default value is 256)
        -progress               <boolean>        Report progress 
        -help                   <string list>    Display long help (empty list), or help for given parameters keys

After:

Parameters: 
MISSING -in        <string>         Input 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)
        -channel   <int32>          Selected Channel  (mandatory, default value is 1)
        -structype <string>         Type of structuring element [box/ball/cross] (mandatory, default value is box)
        -xradius   <int32>          Structuring element X radius  (mandatory, default value is 5)
        -yradius   <int32>          Structuring element Y radius  (mandatory, default value is 5)
        -foreval   <float>          Foreground value  (mandatory, default value is 1)
        -backval   <float>          Background value  (mandatory, default value is 0)
        -filter    <string>         Morphological Operation [dilate/erode/opening/closing] (mandatory, default value is dilate)
        -ram       <int32>          Available RAM (MB)  (optional, off by default, default value is 256)
        -progress  <boolean>        Report progress 
        -help      <string list>    Display long help (empty list), or help for given parameters keys

Rationale

Simpler is better!

Implementation Details

Classes and files
  • Documentation/Cookbook/rst/recipes/featextract.rst
  • Modules/Applications/AppMorphology/app/otbBinaryMorphologicalOperation.cxx
  • Modules/Applications/AppMorphology/test/CMakeLists.txt
Applications
  • Modules/Applications/AppMorphology/app/otbBinaryMorphologicalOperation.cxx: remove the following parameters; filter.erode.foreval, filter.erode.backval, filter.dilate.foreval, filter.dilate.backval, filter.opening.foreval, filter.opening.backval, filter.closing.foreval with foreval and backval
Tests
  • Modules/Applications/AppMorphology/test/CMakeLists.txt: update application parameters in test
Documentation
  • Documentation/Cookbook/rst/recipes/featextract.rst: update the doc wrt the changes (btw I've updated some old stuff regarding the new xradius and yradius)

Copyright

The copyright owner is Rémi Cresson (IRSTEA) and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit

Merge request reports

Loading