PixelValue

获取像素的值。

描述

这个应用程序给出了所选像素的值。有三种方法来指定像素,使用它的索引、它的物理坐标(在附加到图像的物理空间中)和使用地理坐标系。根据选择的模式,坐标的解释会有所不同。

参数

Input Image -in image Mandatory
Input image

X coordinate -coordx float Mandatory
This will be the X coordinate interpreted depending on the chosen mode

Y coordinate -coordy float Mandatory
This will be the Y coordinate interpreted depending on the chosen mode

Coordinate system used to designate the pixel -mode [index|physical|epsg] Default value: index
Different modes can be selected, default mode is Index.

  • Index
    This mode uses the given coordinates as index to locate the pixel.
  • Image physical space
    This mode interprets the given coordinates in the image physical space.
  • EPSG coordinates
    This mode interprets the given coordinates in the specified geographical coordinate system by the EPSG code.

EPSG坐标选项

EPSG code -mode.epsg.code int
This code is used to define a geographical coordinate system. If no system is specified, WGS84 (EPSG: 4326) is used by default.


Channels -cl string1 string2...
Displayed channels

Pixel Value -value string Mandatory
Pixel radiometric value

实例

从命令行执行以下操作:

otbcli_PixelValue -in QB_Toulouse_Ortho_XS.tif -coordx 50 -coordy 100 -cl Channel1

来自Python的评论:

import otbApplication

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

app.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif")
app.SetParameterFloat("coordx", 50)
app.SetParameterFloat("coordy", 100)
app.SetParameterStringList("cl", ['Channel1'])

app.ExecuteAndWriteOutput()