Link to the UNESCO-IOC website
Link to the Bilko website
Earth from space
Annual sea surface temperature

3.1   Creating and modifying a manual stretch

What is contrast stretching?     Opening a stretch     Modifying the stretch

TUTORIAL

3. Stretches

to bottom of page next page

Image used:

Description of mer_20040201 _algal1.dat

Download mer_20040201 _algal1.dat
(83 K)

Useful information:

Numerical data formats

Null values and missing data

In the previous chapter you finished by using a histogram to improve the Redisplay of 16-bit data. In this section you will be using a histogram of 8-bit data to prepare for adjustments to a manual stretch document, which you open and modify to improve the contrast of the image display, and later to help you interpret the data.

  1. Open the image mer_rr_20040201_082314_algal1.dat
  2. Right-click to open Redisplay set the null-value to 0, and note how this changes the display of the ocean in the image.
  3. Create a histogram document derived from selecting the whole image ( [CTRL+A] ), making sure the Apply stretches box in the New dialog is unchecked.

Question 1
What is the range of pixel values associated with most of the pixels in the image?

What is contrast stretching?

The range data values in the histogram you just examined represents only about half of the possible values in the full range of 0-255. A display that uses the actual data values as the display values will make very limited use of the dark grey tones corresponding to data values below 50, and virtually no use of the pale grey to white tones corresponding to values of 181 or more. The result would be a low contrast image where the sea is shown mainly of mid-grey tones.

The purpose of contrast stretching is to spread the important range of pixel values more effectively through the available range of grey tones in the display. This is done by imposing a change whenever the computer takes a value from the image document to display it. The change is based on a look-up table which is defined in a Stretch Document.

Opening a stretch

To open a stretch document for this image, first make sure it is active by clicking on it. Then you can open a Stretch in one of several ways:

From the menu bar:
  - open the Stretch menu and select Manual from the drop down.
Toolbar :
  - Click on New file icon, and select STRETCH, leaving the Apply stretches box unchecked.
Keyboard shortcuts:
  - either type [ALT + S] together, followed by [[M],
  - or type [CTRL + N] together, followed by [[S].

The stretch document appears on the screen as a graph with a line drawn between [0,0] and [255,255]. This depicts the look-up table which determines the new value with which a pixel should be displayed. The abscissa (x-axis) corresponds to the value in the original Image Document (the input) and the ordinate (y-axis) is the new value to be assigned when the image is displayed (the output).

Activity / Question 2
a)

In this case there is a bend in the line, marked by a small square. This is known as a knee. Click your mouse on the knee and read its [x,y] position from the Bilko status bar. What is it?

b)

What grey-scale value does the image window display give to pixels with a data value of 30 or less?

c)

Can you think of a reason why this bend is there? (Hint: Think back to what happened to the appearance of the image display when you set the null value to 0.)

Modifying the stretch

From the examination of the histogram we choose 50 to 181 as the range of input values which should be spread over the full scale of the output values. The simplest modification that can be made to the stretch is to keep it linear over that range. Inputs values above 181 will be output as 255, input values below 55 will be output as 0.

To achieve this, the end points of the stretch should not be touched. As you can see there is already one knee (or tie-point) - a small square at a bend in the line currently found at the [x,y] position of [30,0]. Another knee is needed, and can be created by placing the mouse pointer anywhere on the diagonal line of the stretch and double-clicking the left mouse-button.
 

Answers:
(Resizable
pop-ups)

Answer 1

Answer 2

Answer 3

Back up to:
Q1   Q2  

Once created the tie-points in the stretch can be moved to any [x,y] position in the stretch document. Simply place the mouse pointer on the knee, and holding down the left mouse-button, drag the square to a suitable position in the graph. While you are doing this, the Bilko status bar will continually reveal the [x,y] position of the tie-point, and the display will change to reflect the changes in the stretch. .

Activity / Question 3

Create a second knee in the stretch so that you have two knees on the line between the end points at [0,0] and [255,255]. Drag each knee to a position suitable for displaying 99% of the ocean pixels in the full range of grey tones.

a)

At what positions would you place the two knees?

b)

Watch the display as you make these changes.
What is the effect of moving the first knee? And the second knee?

 
to top of page next page

 
Next: Setting the stretch options

  Link to ESA's Envisat website   Link to NOC's website