ClassificationMapRegularization¶
使用球状邻域中的多数投票对输入标注图像进行过滤
描述¶
这个应用程序使用多数投票过滤输入标记的图像(最大类标签=65535)。多数投票采用由球形结构元素标识的所有像素中更具代表性的值,然后将中心像素设置为该多数标签值。
- NoData是输入图像中未分类像素的标签。这些输入像素在输出图像中保留其NoData标签。
- 如果参数‘ip.suvbool==true’,则具有一个以上多数类的像素被标记为未决定,否则将保留其原始标签。
参数¶
输入和输出图像¶
这组参数允许通过多数投票设置分类图正则化的输入和输出图像。
Input classification image -io.in image
Mandatory
The input labeled image to regularize.
Output regularized image -io.out image [dtype]
Mandatory
The output regularized labeled image.
正则化参数¶
此组允许通过多数票设置分类图正则化的参数。
Structuring element radius (in pixels) -ip.radius int
Default value: 1
The radius of the ball shaped structuring element (in pixels).
Set tie pixels to undecided -ip.suvbool bool
Default value: false
If true, set pixels with more than one majority class to an undecided value. If false, keep their original labels.
Label for the NoData class -ip.nodatalabel int
Default value: 0
Label for the NoData class. Such input pixels keep their NoData label in the output image.
Label for the Undecided class -ip.undecidedlabel int
Default value: 0
Label for the Undecided class.
Process isolated pixels only -ip.onlyisolatedpixels bool
Default value: false
Only pixels whose label is unique in the neighbordhood will be processed.
Threshold for isolated pixels -ip.isolatedthreshold int
Default value: 1
Maximum number of neighbours with the same label as the center pixel to consider that it is an isolated pixel.
Available RAM (MB) -ram int
Default value: 256
Available memory for processing (in MB).
实例¶
从命令行执行以下操作:
otbcli_ClassificationMapRegularization -io.in clLabeledImageQB123_1.tif -io.out clLabeledImageQB123_1_CMR_r2_nodl_10_undl_7.tif -ip.radius 2 -ip.suvbool true -ip.onlyisolatedpixels true -ip.nodatalabel 10 -ip.undecidedlabel 7
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("ClassificationMapRegularization")
app.SetParameterString("io.in", "clLabeledImageQB123_1.tif")
app.SetParameterString("io.out", "clLabeledImageQB123_1_CMR_r2_nodl_10_undl_7.tif")
app.SetParameterInt("ip.radius", 2)
app.SetParameterString("ip.suvbool","true")
app.SetParameterString("ip.onlyisolatedpixels","true")
app.SetParameterInt("ip.nodatalabel", 10)
app.SetParameterInt("ip.undecidedlabel", 7)
app.ExecuteAndWriteOutput()
局限性¶
输入图像必须是单波段标签图像(最大类别标签=65535)。结构元素半径必须具有等于1像素的最小值。请注意,未确定的值必须与输入标签图像中的现有标签不同。