GEOG 5110/6110

 

Department of Geography, University of Utah


 

Lab 2 – February 14, 2007

 

Laboratory Objectives:

 

  1. Perform a density slice
  2. Perform a linear, piecewise, Gaussian, and a histogram equalization contrast stretch.
  3. Compare and contrast stretching methods.
  4. Perform an image sharpening

 


  • Create a subdirectory named "Lab2" under N:\geog5110\ and copy cbd.img (the one you used in Lab1) to the newly created Lab2 directory.
  • Load cbd.img

 

I. Density Slicing

 

Use density slicing to select data ranges and colors for highlighting areas in your gray scale image.  The data ranges used in the density slice coloring can be from the displayed image or from another image of the same size.

 

Use Interactive Density Slicing

 

  1. From the Display menu bar, select Tools > Color Mapping > Density Slice... The Density Slice Band Choice dialog appears.  It lists all of the bands that have the same spatial size as the image in the display windows.
  2. Select the band to use for the density slice data ranges by clicking on the band name.  The #N Density Slice dialog (where N is the display number used to start the function) appears with eight default ranges listed under Defined Density Slice Ranges.  The ranges are defined using a minimum and maximum data value calculated from the Scroll Window and shown in the Min and Max text boxes.
  3. Select whether the density slice colors are applied to the image window, scroll window, or both windows by selecting the desired check boxes next to Windows at the bottom of the dialog.
  4. Click Apply to apply the default ranges and colors to the image.
    1. To remove a range from the list, select the data range and click Delete Range
    2. To clear the list of density slice ranges, click Clear Ranges.

 

Editing Data Ranges

 

To change the range values or color of a density slice:

 

  1. In the Density Slice dialog, highlight a data range and click Edit Range.  The Edit Density Slice Range dialog appears. 
  2. Select RGB (red, green, blue), HLS (hue, lightness, saturation), or HSV (hue, saturation, value) as your color system from the System button menu.  Use the slider bars or the arrow increment buttons to set your own color definitions.
  3. Click OK to make the changes to the range in the Defined Density Slice Ranges list.
  4. Click Apply to apply the new ranges and colors to the image.

 

Density Slice Options

 

Use the Options menu to add new ranges, set default ranges, and set the number of default ranges to be used.

 

Adding Ranges

 

To add new ranges to the list in the Density Slice dialog:

1.      Select Options > Add New Ranges

2.      When the Add Density Slice Ranges dialog appears, enter the Range Start value, Range End, and Number of Ranges desired in the appropriate text boxes.

3.      Choose the starting color from the Colors menu.  The colors of multiple ranges will follow the lost of graphics colors.

4.      Click OK to return to the Density Slice dialog.  The determined ranges are listed in the dialog and can be edited as desired.

5.      Click Apply to apply the density slicing colors to the image.

 

Changing Bands

 

1.      In the Density Slice dialog, select Options > Change Density Slice Band.  The Density Slice Band Choice dialog appears.

2.      Change the band used for the density slice data ranges by clicking on the band name.

 

The new density slice coloring is automatically applied to the new band selected.

 

Closing the Density Slice Dialog

 

1.      To close the Density Slice dialog and reset the original color table, select File > Cancel.


 

II. Contrast Stretching

 

Contrast stretching is a form of radiometric enhancementRadiometric enhancement deals with the individual values of the pixels in the image.  Whereas spatial enhancement (to be discussed in a future lab) takes into account the values of neighboring pixels. 

 

Contrast stretching enhancements are not applied to the data files (i.e. the data files are not physically changed).  Contrast stretching is applied to adjust the color or gray scale range of a selected image so it fills the computer displayfs dynamic range and improves the contrast in the image.  Available stretching options allows you to do this using both linear and non-linear methods.

 

Interactive Contrast Stretching

 

Interactive Contrast Stretching allows you to stretch your image data by interacting with histograms.  Interactive Contrast Stretching plots a histogram and allows you to interactively control the contrast of the displayed image.  Many different types of stretches can be applied.  By default, a linear 2% stretch is applied to the data when it is first displayed.

 

1.      To access ENVIfs interactive contrast stretching functions, from the Display menu bar, select Enhance > Interactive Stretching.  An Input and an Output histogram appear in the Interactive Contrast Stretching dialog.  They show the current input data and applied stretch respectively.  Initially, the input and output histograms reflect the default stretch applied to the data when the image was displayed. Two vertical dotted lines mark the current minimum and maximum values of the stretch.  For color images, the color of the histogram matches the color of the selected band (the red band is displayed by default). At the bottom of the Interactive Histogram window, the stretch type and the histogram source are listed.

a.       To view the histogram for the green or blue bands (if your image is displayed in RGB), click the G or B toggle button.

 

Applying Different Stretch Types

 

Use the Stretch_Type menu in the Interactive Contrast Stretching Dialog to select from a list of all available types of interactive stretches.  In this lab we will experiment with the following four contrast stretches:

 

1.      Applying Linear Contrast Stretches

 

A 2% linear contrast stretching is the default interactive stretch.  A linear stretch sets the minimum and maximum input value to 0 and 255 respectively and all other values in between are linearly aligned to intermediate output values.

           

a.       From within the Interactive Contrast Stretching dialog, select Stretch_Type > Linear.

b.      To determine the minimum and maximum input value move the minimum and maximum vertical bars (dotted white lines) on the input histogram to the desired location using the left mouse button or enter the minimum and maximum input values by entering the desired DN values or a percentage of the data (e.g. 5% for minimum and 95% for maximum) in the Stretch text boxes.

c.      When clicking Input Histogram, Numbers below the plot display the current data value, the number of pixels and the percentage of pixels that have that value, and the cumulative percentage of pixels with values less than or equal to the current value.

d.      Click Apply to apply the stretch to the displayed data.

 

*To re-display the original stretch select Options > Rest Stretch

 

*For images displayed using RGB, the above can be done for each channel by selecting the appropriate RGB radio button.

 

2.      Applying Piecewise Linear Contrast Stretches

 

A piecewise linear contrast stretch can be interactively defined using the mouse to position points in the input histogram.  Linear segments connect the points to provide linear stretching between them.

a.       Select Stretch_Type > Piecewise Linear. A transfer function is plotted on the input histogram.

b.     Click the middle mouse button (scroll dial) anywhere in the Input Histogram plot to add a node (break point) to the transfer function.  Line segments are plotted to connect the endpoints to the plotted node symbol.

                                                                           i.      To move the position of a point, click the left mouse button on the symbol and drag it to a new position.

                                                                         ii.      To delete points, click on the symbol with the right mouse button.

                                                                        iii.      To enter input and output values manually, select Options > Edit Piecewise Linear.

c.       The resulting histogram is plotted in the output display. The output histogram shows the distribution of the data with the new stretch applied.

d.      Click Apply to apply the stretch to the displayed data.

 

 

3.      Applying Gaussian Stretches

 

The default Gaussian stretch is centered at a mean DN of 127 with the data values 3 standard deviation set to 0 and 255.

a.       Select Stretch_Type > Gaussian

b.      Enter the minimum and maximum values for the stretch.  The output histogram shows the selected Gaussian function as a red curve. The stretched data distribution is shown superimposed in white on the red Gaussian function.

                                                                                                   i.      To enter the desired number of standard deviations manually, select Options > Set Gaussian Stdv... .

c.       Click Apply to apply the stretch to the displayed data.

                                                                                                   i.      If Options > AutoApply is selected, the stretch will automatically be applied. I would suggest turning this option off.

 

4.      Applying Histogram Equalization Contrast Stretches

 

To automatically scale the data to equalize the number of DNs in each histogram bin:

a.       Select Stretch_Type > Equalization.  The input histogram shows the unmodified data distribution.  The output histogram shows the equalization function as a red curve, and the stretched data distribution is shown superimposed in white.

b.      Click Apply to apply the stretch to the displayed data.

                                                               i.      If Options > AutoApply is selected, the stretch will automatically be applied. I would suggest turning this option off.

 


 

III.  Image Sharpening

 

Image sharpening can be explained as a combination of a high-spectral but low-spatial resolution image with a low-spectral but high-spatial resolution one to produce a high-spectral and high-spatial resolution image.  We are going to use one of the image sharpening techniques to see the effects of high spectral and spatial resolution image on identifying geographic features in the visually appealing sharpened image.

 

Navigate to the Data folder under geog5110 on 'Syntax L M Server (geogshare)' drive. Find 4 files named, ETM8subset, ETM8subset.hdr, ETM123subset, and ETM123subset.hdr and copy them into your N:\geog5110\Lab2 folder.

Load the ETM123subset as a true color composite image and the ETM8subset as a gray-scale image.

When you want to open the multiple images (ETM8subset and ETM123subset), choose the images by clicking left mouse button on the file names with CTRL key pressed in the Enter Data Filenames. Click Open. You can see Map Info in the Available Bands List. Click on the + of Map Info, observe information carefully.  Load ETM123subset as a true color composite image into New Display and ETM8subset as a gray scale image into New Display. Click on the + of Map Info, look at information carefully. Compare the two images.

 

Now we are ready to do the image sharpening.

 

The Color Normalized (Brovey) sharpening will be used as an example sharpening technique. This technique uses a mathematical combination of the color image and high resolution data. Each band in the color image is multiplied by a ratio of the high resolution data divided by the sum of the color bands (see text p.168).  The output sharpened RGB images will have the pixel size of the input high-resolution data. Please see the text for details.

  • Click on Transforms of the ENVI pulldown menu and select Image Sharpening > Color Normalized (Brovey).
  • Select Available Bands List in the Select Input RGB. Click OK.
  • When the Select Input RGB Input Bands dialog appears, choose band3 of ETM123subset as R, band2 of ETM123subset as G, and band1 of ETM123subset as B. Click OK.
  • When the High Resolution Input File dialog appears, select the high-resolution input image. ETM8subset: Band 1. Click OK.
  • When the Color Normalized Sharpening Parameters dialog appears, just use default except selecting Memory output and click OK to start the processing. 
  • The output bands appear in the Available Bands List with Map Info.  Load the sharpened image in the New Display window and compare it with the original true color image and high resolution gray-scale image. And Click + of Map Info of sharpenend image [Memory1] to check information.

 

 

 

Importing Images into MS Word

 

A portion of the assignment will ask you to import display or zoom windows images into Microsoft Word.

Here are instructions for doing so....

  1. In ENVI, save the images as, for example, a .jpeg file by selecting the image window...File > Save Image As > Image File or File > Save Zoom As > Image File.
    • Choose an appropriate Resolution.
    • Change Output File Type to JPEG.
    • Output result to File.
  1. In MS Word, import the .jpeg file. . . Insert > Picture > From File