PixelValue - Pixel Value

Get the value of a pixel.

Detailed description

This application gives the value of a selected pixel. There are three ways to designate a pixel, with its index, its physical coordinate (in the physical space attached to the image), and with geographical coordinate system. Coordinates will be interpreted differently depending on which mode is chosen.

Parameters

This section describes in details the parameters available for this application. Table [1] presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is PixelValue .

[1]Table: Parameters table for Pixel Value.
Parameter Key Parameter Name Parameter Type
in Input Image Input image
coordx X coordinate Float
coordy Y coordinate Float
mode Coordinate system used to designate the pixel Choices
mode index Index Choice
mode physical Image physical space Choice
mode epsg EPSG coordinates Choice
mode.epsg.code EPSG code Int
cl Channels List
value Pixel Value String
inxml Load otb application from xml file XML input parameters file
outxml Save otb application to xml file XML output parameters file

Input Image: Input image.

X coordinate: This will be the X coordinate interpreted depending on the chosen mode.

Y coordinate: This will be the Y coordinate interpreted depending on the chosen mode.

Coordinate system used to designate the pixel: Different modes can be selected, default mode is Index. Available choices are:

  • 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 code: This code is used to define a geographical coordinate system. If no system is specified, WGS84 (EPSG : 4326) is used by default.

Channels: Displayed channels.

Pixel Value: Pixel radiometric value.

Load otb application from xml file: Load otb application from xml file.

Save otb application to xml file: Save otb application to xml file.

Example

To run this example in command-line, use the following:

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

To run this example from Python, use the following code snippet:

#!/usr/bin/python

# Import the otb applications package
import otbApplication

# The following line creates an instance of the PixelValue application
PixelValue = otbApplication.Registry.CreateApplication("PixelValue")

# The following lines set all the application parameters:
PixelValue.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif")

PixelValue.SetParameterFloat("coordx", 50)

PixelValue.SetParameterFloat("coordy", 100)

# The following line execute the application
PixelValue.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.