ResetMargin

This is the ResetMargin application

Description

This application is similar to ExtractROI in the sense it extracts a Region of Interest. However, the region outside of the ROI isn’t trimmed, but set to 0.

The filter set lines of index < threshold.y, and of index >= threshold.y to 0 The filter set columns of index < threshold.x, and of index >= threshold.x to 0

Parameters

Input image -in image Mandatory
Scalar Input image

Output Image -out image [dtype] Mandatory
Scalar Output image

threshold group

Top line index threshold -threshold.y.start int Default value: 0
Top line index threshold

Bottom line index threshold -threshold.y.end int Default value: 0
Bottom line index threshold


Column index threshold -threshold.x int Default value: 0
Column index threshold

ROI group

Contains index and size of ROI

X start index -roi.startx int Default value: 0
X position of ROI start (in pixels)

Y start index -roi.starty int Default value: 0
Y position of ROI start (in pixels)

X size -roi.sizex int Default value: 0
X size of ROI (in pixels)

Y size -roi.sizey int Default value: 0
Y size of ROI (in pixels)

Margins group

Contains margins to define the ROI

Top margin -margin.top int Default value: 0
Top margin for ROI (in pixels)

Bottom margin -margin.bottom int Default value: 0
Bottom margin for ROI (in pixels)

Left margin -margin.left int Default value: 0
Left margin for ROI (in pixels)

Right margin -margin.right int Default value: 0
Right margin for ROI (in pixels)


Region mode -mode [roi|margin|threshold] Default value: roi

  • Pixel region with start and size
  • Pixel region with top / bottom / left / right.
  • Threshold for X, Y top and bottom (DEPRECATED)

Padding fill value -fillval float Default value: 0
Value to insert in margins

Available RAM (MB) -ram int Default value: 256
Available memory for processing (in MB).

Examples

From the command-line:

otbcli_ResetMargin -in ResetMarginInput100x100.tiff -mode roi -roi.startx 10 -roi.starty 10 -roi.sizex 50 -roi.sizey 25 -out ResetMargin.tiff

From Python:

import otbApplication

app = otbApplication.Registry.CreateApplication("ResetMargin")

app.SetParameterString("in", "ResetMarginInput100x100.tiff")
app.SetParameterString("mode","roi")
app.SetParameterInt("roi.startx", 10)
app.SetParameterInt("roi.starty", 10)
app.SetParameterInt("roi.sizex", 50)
app.SetParameterInt("roi.sizey", 25)
app.SetParameterString("out", "ResetMargin.tiff")

app.ExecuteAndWriteOutput()

Limitations

This application only works on scalar (and complex) images.