Contrast enhancement is only intented to improve the visual quality of a displayed image. It is a process generally required for all images because satellite based sensors with global coverage need to image a wide range of scenes , from very low radiance (oceans, low solar elevation angles, high latitudes etc) to very high radiance snow, sand, high solar elevation angles, high latitudes). Any one scene will generally have a radiance range much less than the full range. When such a scene is imaged and converted to 1 byte digital numbers (DN's), it uses less than the full quantization range (usually 0-255). When the image is displayed it will have low contrast, appearing quite dull, making visual interpretation difficult. Contrast stretching involves increasing the range (spreading or stretching) of data values to occupy the available image display range (usually 1 byte or 0-255). The result is displayed image with a greater level of contrast and so easier interpretability.
In this section you will be altering the contrast of the image of Hong Kong. First we will remove the default stretch applied by ENVI, then we will apply a linear stretch to increase the contrast in the terrestrial areas while reduing contrast in marine areas to zero, using saturation.
| The image of Hong Kong we have been using, is linearly contrast stretched by ENVI automatically upon loading. Lets have a look at how it appears without the contrast stretch, just to show you what we mean by low contrast. First, position the scroll indicator box over Kowloon, then click the right button in the Main window to bring up the Functions Menu. Left click the Functions button then select Display Enhancements - Interactive Stretching. Three windows will appear. Each window represents the pixel reflectance values for a specific band (RGB or NIR, Red and Green wavelengths). To the right the window representing the blue band is shown (Figure i.), don't worry if yours is not exactly the same. |
|
| At the top of each window is the name of the band, below this are two plot windows. The plot on the left contains the histogram for the input "raw" (unstretched) band in question. The histogram shows the frequency of pixel DN's within the main image window. The right plot is how the histogram looks following application of the contrast stretching operation that you apply. You will notice above the plots are some text boxes. The two on the right show the minimum and maximum pixel DN values of the input band. The text boxes on the left show the minimum and maximum values which are used in the stretch. These values are represented on the plots by the red (min) and green (max) vertical lines, which we will call range bars. So how do we apply a contrast stretch? |
|
At the moment the dialogs show a 2% linear stretch (the ENVI default) applied to each image band. The bottom and top 2% of image values are excluded by positioning the range bars at the appropriate points. The values between the range bars are then stretched linearly between 0 and 255 resulting in a new image histogram, which is shown in the right plot window (output histogram). We would like to remove the current stretch to see how the original input image appears. To do this simply click and hold the left mouse button over the red range bar and drag it to the far left, release the button and do the same for the green range bar, but move this to the far right. Notice that as you dragged the range bars, numbers are displayed directly above the histogram plot window. In order these represent; the DN at (or below) the range bar position, the number of pixels having that DN in the image, the previous value expressed as a percentage of the total pixels in the image with the final value giving the percent of image pixels to the left of the range bar. To finish click the Apply button. Do this for each of the three dialogs. You now have removed the default stretch displaying the image with the "raw" intensity values. Your main window should appear like that in Figure ii.
Notice that the input and output histograms (for each image band) have the same proportions but are on a different scale - the scale has changed but the relative positions of the DN's has not. The output histogram shows that the DN's are clumped in a relatively small region in the bottom half of the available range. This is why the image appears dark, because brighter intensities (higher DN's) are not been utilized. Next we will apply a piecwise linear stretch to provide an image with terrestrial contrast but minimal contrast in marine regions of the image. Imagine a situation where we have an image dominated by water but we wish to interpret terrestrial features (urban areas etc) only. It makes the task easier if we can remove the reflectance caused by marine areas, thus ignoring it.
| First lets set up the image. Position the scroll indicator window so that
Tsing Yi island is at the top centre of the main window display. Your main image window
should appear like that in Figure iii. Next we want to apply a stretch which provides contrast to the urban areas but little or none to the marine areas. We will accomplish this by saturating pixels that are associated with water, in other words we will set those pixels representing water to very low intensity (DN) values. So how exactly do we know which pixels are water pixels? With a little background knowledge on the reflectance characteristics of water thats how. |
|
So we now know that water tends to have gennerally low reflectance, particularly in wavelengths longer than red. We can use this information to implement our desired contrast stretch. We want to remove from the stretch range, those pixels with low (reflectance) values. Lets double check that low values do indeed represent water. Notice that for each band the input histograms have a sharp peak at low DN values. This means that most of the pixels in the main image window have a low intensity (DN) value. Now look at your main image window. Most of the image contains water. So it is true, the clustering of DN's at the far left of the histogram (peak in the histogram) must be due to the fact that most of the image contains water.
| So all we have to do is move the lower range bar (red bar) just to the right of the peak and the upper range bar (green bar) to a point just before the histogram goes flat. An example of how the dialog should look, in this case the green band (which represents the red wavelength), is shown in Figure iv. Do this for all the dialogs, making sure to click the Apply button on each once you have adjusted the range bars. It may take a bit of trial and error to find the right values, but your image should appear similar to that in Figure iv. All the water pixels are now black and therefore, have no contrast, while on the land cover features are easilly identifiable. |
|
| As well as directly moving the range bars you can position them by
entering minimum and maximum values in the fields next to the Apply button at the
top of the dialog. To the left of each field is a small coloured bar representing the
range bar which that field controls. You can enter either data values (DN values) or
percentages (the percentage of pixels to the left of the range bar). When entering
percentages make sure to type the "%" after the number. What we have done is termed a thresholding operation. That is, all pixel values above and below a certain threshold are essentially ignored by setting them all either the highest or lowest DN's respectively. This process involves saturating the pixels that we are not interested in and stretching the ones we are interested in, to occupy the full range of available intensity values (DN's). |
|
Before going on to the next part of the tutorial try a few of the other stretch types. These can be accessed from the Stretch_Type pulldown menu of each dialog window. In particular try the Piecewise Linear stretch.
Finally, close all the stretch dialog windows and reload the image by selecting RGB=Bands 4,3,2 from the available bands list. Move the scoll indicator window so that your main image window contains the Kowloon area, centred roughly on the old Kai Tak runway. Your now ready to proceed to the next lesson .........