Stretch Data
Use Stretch Data to perform file-to-file contrast stretching. The data stretching function is a flexible method for changing the data range of a given input file. You have full control over both the input and output histograms and the output data type (byte, integer, floating-point, and so forth).
- From the Toolbox, select Raster Management > Stretch Data.
- Select an input file and perform optional spatial and spectral subsetting, then click OK. The Data Stretching dialog appears.
- To calculate the statistics based on a statistics subset or the area under an ROI, click Stats Subset.
- Select the Stretch Type (Linear, Equalize (histogram equalized), Gaussian, and Square Root) from the appropriate radio button.
- Select a Stretch Range value of By Percent or By Value from the appropriate radio buttons.
- Enter the minimum and maximum values in the Min and Max fields, respectively, to control the input data range.
- Set the Output Data Range in the Min and Max fields. The values must match the ranges of the data type selected from the Data Type drop-down list (see next). If out-of-range values are entered, low values are automatically corrected to the minimum and high values are automatically corrected to the maximum of the selected data type.
- From the Data Type drop-down list, select the appropriate data type (byte, integer, unsigned integer, long integer, unsigned long integer, 64-bit integer and unsigned 64-bit integer, floating-point, double precision, complex, or double complex).
- Select output to File or Memory.
- Click OK. If no statistics file exists for the selected input file, ENVI calculates the image statistics before data stretching and an Image Statistics window shows the percent processing complete as a slider that moves from 0 to 100%. If a statistics file already exists (or when the image statistics are calculated) a Data Stretching window shows the percentage of data stretching completed. When complete, ENVI adds the resulting file to the Layer Manager.
If you select Gaussian, enter a standard deviation in the Stdv field.
Applying Stretches Using the ENVI API
The following tasks are available for ENVI programmers: