LUT

Image enhancement using lookup table


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Algorithm :: Related

Back to top

Description


LUT adjusts pixel values of a raster by passing it through a lookup table (LUT), and then writes the resulting imagery to disk. This allows bulk-radiometric enhancement of image data.
Back to top

Parameters


Name Type Caption Length Value range
FILI* String Input file name 1 - 192  
DBIC* Integer Input raster layers 1 -    
LUTFILE String Input file name containing the LUT 0 - 192  
DBLUT Integer Input LUT segments 0 -    
MASKFILE String Area mask file 0 - 192  
MASK Integer Area mask 0 - 4  
FILO* String Output file name 1 - 192  
DBOC Integer Output raster channels 0 -    
DATATYPE String 0 - 3 8U|16S|16U|32R
Default: 8U
FTYPE String Output file type 0 - 4 Default: PIX
FOPTIONS String Output file options 0 - 64  
MONITOR String Monitor mode 0 - 3 ON, OFF
Default: ON

* Required parameter
Back to top

Parameter descriptions

FILI

The name of the GDB-raster file to be enhanced with a LUT.

DBIC

The channels to be enhanced with LUTs. Each input channel requires a corresponding LUT to be specified and will result in one output channel.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

LUTFILE

The name of the PCIDSK image file containing the LUTs. If not specified, the LUT is retrieved from the value of the FILI parameter.

DBLUT

The input segments that contain the LUTs to use for image enhancement. Both basic LUT (type 170) and break-point BLUT (type 172) segment types are supported. If not specified explicitly, the default LUT of the input channel will be used automatically when it is identified by the DEFAULT_LUT_REF metadata tag. If an input channel does not have a default LUT defined (and no LUT was specified), an error will occur.

The elements of this parameter correspond to input channels by position. Unless relying on default-LUT metadata, one LUT must be specified for each input channel.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

MASKFILE

The name of the file containing the mask. If you specify a value for MASK, but not MASKFILE, the mask from the input file, the value of FILI, is used.

This parameter is optional.

MASK

The areas of the data to be processed. When no mask is specified, all pixels are processed by default. However, when a mask is provided, only pixels within the mask area are altered. When writing to a new output channel, the unmasked pixels are assigned NoData values. When writing to an existing channel, the unmasked pixels are not processed, and the values in the output channel are preserved.

You can define these areas using three types of mask boundaries: window, bitmap, or polygon vectors.

A window mask is specified as: MASK=Xoffset, Yoffset, Xsize, Ysize. Xoffset, Yoffset define the coordinates of the upper-left starting pixel of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

With a bitmap mask, you specify the number of the bitmap segment you want to use. All of the pixels in the specified segment having a pixel value of 1 define the area where input data must exist to be processed.

With a vector mask, you specify the number of the polygon segment you want to use as a mask. The masked pixels will be the ones in the polygons provided.

Note: A bitmap segment is chosen over a vector segment to define the mask area, if both segments share the same segment number.

If you specify a value for MASK, but not MASKFILE, the MASK is obtained from the input file, FILI.

FILO

The name of the file to which the processed raster data will be written. If no value is specified for this parameter, a new file is created using the value of FTYPE and FOPTIONS. In such a case, the file will have the same number of channels as specified for the DBIC parameter, and have the same geocoding information and metadata as the value of FILI.

If an output file already exists, it must be a format that can be updated. Also, the updatable file must already contain suitable channels to which to write the resulting data, and those channels must be specified with the DBOC parameter. When writing to an existing file, you need not specify values for the FTYPE and FOPTIONS parameters. Doing so will cause an error, unless they are supoprted by the existing file. The FILO and FILI parameters can share the same values, provided the value of FILI meets the criteria described herein.

DBOC

The output channels to receive the enhanced raster.

If FILO specifies creating a new file, you need not specifiy a value for DBOC; that is, the default value applies. The results will be written to the channels in the new file.

When the value of FILO is an existing file, the value of DBOC must specify the existing channels to be updated. If the value of FILO and FILI are the same, and the output channels (DBOC) equal the input channels (DBIC), those channels will be modified in place.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

DATATYPE

The data type of all output channels to be created. By default, LUT will create 8U output, which is sufficient in most circumstances; however, you can specify a higher bit depth with the DATATYPE parameter, if necessary.

Note: When outputting to existing channels, this parameter is ignored.
Supported data types are:

When outputting to 8U, the LUT is applied to the input data, and the resulting value is written as an integer to the output channel. When outputting to 16U or 16S, the LUT is applied to the input data. The derived values are then stretched linearly over the full range of the output channel. When outputting to 32R, the LUT is applied to the input data, and the resulting value is written as a real number to the output channel.

FTYPE

The format of the output file. The format must be a GDB-recognized file type. If an existing file was specified for FILO, FTYPE should not be specified, because the existing file will be updated and its type will not be changed.

Supported file formats are: The default value is PIX.

For more information on GDB-recognized file types, see the topic GDB file formats in the CATALYST Professional Help under Technical Reference.

This parameter is optional.

FOPTIONS

The available options to apply on creation of the output file. The available options are specific to the file format; however, you need not necessarily specify any options.

For more information on GDB-recognized file types, including the available options for each, see the topic GDB file formats in the CATALYST Professional Help under Technical Reference.

This parameter is optional.

MONITOR

The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.

Available options are:

Back to top

Details

With remote-sensing applications, the intensity values of the original raw data are typically left unchanged. Enhancements (to aid in making visual interpretations) are applied using LUTs on the display system.

At times, however, it becomes necessary to permanently enhance the data by physically passing it through the LUT and writing it to disk. This removes the need for the LUT. Typically, this is done when preparing to export the data to another system, or to create a finished product that will be printed.

LUT transforms a set of image channels using a set of LUTs stored in LUT segments (LUT segment type 170 or BLU segment type 172). The transformed image data is stored in a set of output image channels. This allows bulk-radiometric enhancement of image data.

The MASK parameter specifies the area in the input channel that will be processed. Only the area under the mask will be processed; the rest of the image will be set to NoData when outputting to new channels or simply unaltered when writing to existing output channels.

Any pixel that is nodata in the input will be NoData in the output. Also, any pixel that is outside of a specified mask will be set to NoData when creating new output channels. When NoData is required for a new output channel, it will be the minimum of the bit depth of the output channel. The other pixel values will be increased so legitimate pixels are not mapped to NoData. When writing to an existing output channel, if that channel has NoData defined, that value will be used for the output NoData, and only when NoData is not defined will the minimum value be used.

Back to top

Example

Perform LUT enhancement of a single channel to permanently transform the pixel values and output to a new file.

EASI>fili     = "irvine.pix"	 ! input image file
EASI>dbic     = 1	         ! input channel 1
EASI>lutfile  =               ! default, use fili
EASI>dblut    =	2            ! use LUT segment 2
EASI>maskfile =               ! process entire image
EASI>mask     =               ! process entire image
EASI>filo     = "lut.pix"     ! output file to be created
EASI>dboc     =               ! output channel 
EASI>datatype =               ! default, use 8U
EASI>ftype    =               ! default, use PIX
EASI>foptions =               ! default, no options
EASI>RUN LUT
Back to top

Algorithm

The following is an example of the actual operation performed by LUT:

                         level  Output
    1   3   1   1          0      9            6   0   6   6
    3   3   3   0          1      6            0   0   0   9
    0   1   0   0          2      1            9   6   9   9
    3   3   0 255          3      0            0   0   9   0
                           :      :
                         255      0             
        Input                LUT                  Output
			

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.