Skip to content

Better interface for ResetMargin

The current interface of the ResetMargin is not symmetric in X and Y:

  • threshold.x is used to define the margin size for left and right sides
  • threshold.y.start is used to define the top margin size
  • threshold.y.end is used to define the bottom margin size (which is strange because "end" usually refer to an absolute coordinate in OTB world, not a margin size).

Also, the term threshold suggest an operation is performed based on the pixel value, which is not the case.

I propose to replace these parameters by 2 interfaces to set the region:

  • as a ROI, just like in ExtractROI:
    • roi.startx
    • roi.starty
    • roi.sizex
    • roi.sizey
  • as margins for each side
    • margin.top
    • margin.down
    • margin.left
    • margin.right

These parameters should be made consistent by the function ResetMargin::DoUpdateParameters().

To ensure API compatibility, it is possible to deprecate the threshold... parameters, while introducing the new ones roi... and margin....