ResetMargin

这是ResetMargin应用程序

描述

此应用程序类似于 提取ROI 从这个意义上说,它提取了一个感兴趣的区域。但是,ROI之外的区域不会被修剪,而是设置为0。

过滤器将索引和索引>=阈值.y的行设置为0。过滤器将索引的列和索引>=阈值的列设置为0

参数

Input image -in image Mandatory
Scalar Input image

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

阈值组

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组

包含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)

页边距组

包含用于定义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).

实例

从命令行执行以下操作:

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

来自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()

局限性

此应用程序仅适用于标量(和复杂)图像。

另请参阅