ManageNoData

管理无数据

描述

这个应用程序有两种模式。第一种方法允许根据从图像文件读取的无数据标志构建无数据像素的掩码。第二个允许更新更改图像的无数据值(像素值和元数据)。最后一种模式还允许用适当的无数据值替换映像中的NaN。为此,应激活NaN is no-data选项。

参数

Input image -in image Mandatory
Input image

Output Image -out image [dtype] Mandatory
Output image

Consider NaN as no-data -usenan bool Default value: false
If active, the application will consider NaN as no-data values as well

No-data handling mode -mode [buildmask|changevalue|apply] Default value: buildmask
Allows choosing between different no-data handling options

  • Build a no-data Mask
  • Change the no-data value
  • Apply a mask as no-data
    Apply an external mask to an image using the no-data value of the input image

构建无数据掩码选项

Inside Value -mode.buildmask.inv float Default value: 1
Value given in the output mask to pixels that are not no data pixels

Outside Value -mode.buildmask.outv float Default value: 0
Value given in the output mask to pixels that are no data pixels

更改无数据值选项

The new no-data value -mode.changevalue.newv float Default value: 0
The new no-data value

将蒙版作为无数据选项应用

Mask image -mode.apply.mask image Mandatory
Mask to be applied on input image (valid pixels have non null values)

Nodata value used -mode.apply.ndval float Default value: 0
No Data value used according to the mask image


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

实例

从命令行执行以下操作:

otbcli_ManageNoData -in QB_Toulouse_Ortho_XS.tif -out QB_Toulouse_Ortho_XS_nodatamask.tif uint8 -mode.buildmask.inv 255 -mode.buildmask.outv 0

来自Python的评论:

import otbApplication

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

app.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif")
app.SetParameterString("out", "QB_Toulouse_Ortho_XS_nodatamask.tif")
app.SetParameterOutputImagePixelType("out", 1)
app.SetParameterFloat("mode.buildmask.inv", 255)
app.SetParameterFloat("mode.buildmask.outv", 0)

app.ExecuteAndWriteOutput()

另请参阅