Labklass Digital Image Analysis
Labklass Digital Image Analysis
Image processing
Introduction
Go to your directory by typing the unix command cd gr* in the terminal window, where * is replaced
by your group number. If you type ls on the command line you will get a list of the files stored on your
directory. The file you will work with in this exercise is called savlamar.pix.
If you have several windows on the display, click on the one you want to use and it will be activated.
ImageWorks
We will begin with opening ImageWorks.
1. On Xpace upper menu bar you will find Image Display Windows under Utilities.
Activate it and in a new window you will see a list of Image Windows. Choose the first Image
Window on the list with a mouse click on that line. Click on Modify and change the number of
image planes to seven (7C), if that is not already the case. To start click on Start ImageWorks.
Two windows will be created, a display window and a control window. Move the windows so that
you see both.
2. On the display menu bar there is a File option. Under this you will find Load Image....
In the next appearing window, choose savlamar.pix. A new window appears were you select the
channels and the part of the image you want to load to the display. Select all the channels with
Default and the entire image with Overview. Press Load&Close. After a while a dark image will
appear in the display window.
Help gives more information about the control panel and ImageWorks.
Enhancements
3. Explain why the image is so dark on the display by looking at the grey level histogram for the
unstretched image under View → Histograms....
To make the image more agreeable to look at, we use the enhancement capabilities in the ImageWorks
control window. There are 5 types to choose from: None, Infreq, Linear, Equal, and Root. Try
Linear, Equal, and Root. Look at the differences of the different techniques.
If you open the Look Up Table, LUT... under Edit, you will be able to see the effect on the data
in the histogram for the different enhancement techniques. Describe them. Which method do
you prefer? Why?
4. Also try to zoom in the image after making a stretch on the whole image, and then use the same
stretch again. To zoom in to a specific area, first place the cursor in the image at the point you
want, and then zoom.
Centre for Image Analysis March 14, 2005 2
Is there a difference between the result of the enhancement compared to when you did
not zoom? If so, describe the differences, and why there is a difference.
The image. . .
7. The image you are looking at is a Landsat TM image showing the coastal zone of southern Jamaica.
The spatial resolution of this image is 28 meters. What is meant by spatial resolution?
To see the image coordinate for each pixel, move the cursor over the image and look at the numbers
in the upper part of the control panel. How many pixels does one image line/column consist
of ? How many kilometers does that correspond to? Do you think the image you are
looking at is a complete scene recorded by the sensor or just a part of it?
8. How many bands does the TM (Thematic mapper) sensor record the reflected light in?
To know more about the spectral characteristics of the bands in this image, look at Image Info...
under View. How many image bands does this image have? How many of them are in
the visible part of the spectrum?
Look at the different bands by displaying them in black and white one by one.
Filtering
9. Open Filter... under Tools. Two windows will appear; a small filter pre-view window and a
control panel.
Start to select Input Image as, e.g., 3 and Output Image as 6 (band number 6 is empty and can
be used for results). Mask should be Entire Image. In the ImageWorks control panel you should
select one band to show in BW (preferably the one you choose as input image). You are now free
to try different filters and filter sizes. As soon as you change, e.g., the filter type, the result will be
seen in the Filter Preview window.
If you press Apply, the result for all of the image will be seen in the output image (6).
Two problems to look at:
(a) In the water, you can see that the images are striped. The striping varies a bit between the
channels. This is a result of a defect in the satellite sensors, and the calibration. Try to reduce
the striping in channel 3 or 4 with, e.g., Average, Gaussian and Median filters of different sizes.
You can read more about each filter if you press Help.
Which filter gave the best result? How and why?
(b) In the top left part of the image you can see roads between the fields. Try to enhance the roads
with some of the edge detection filters.
Which filter gave the best result? Use Help and try to figure out how that filter
works.
Centre for Image Analysis March 14, 2005 3
Classification
The programs that will be used in this part of the exercise, called classification, are included in the Xpace
software or written in EASI/PACE macro language. The procedures consist of many programs that can
be used in a step by step image classification. The macros that you will use are in most cases self instruc-
tive.
The dataset used for the exercise called landsatTM.pix contains the following items:
• 7 Channels with Landsat TM band 1,2,3,4,5,6 and 7 data TM 1 and 6 will not be used in the
classification.
• 2 Channels to use for results.
All this information can be found in the PCIDSK File Browser... under Utilities in the Xpace win-
dow. Click on New file... and choose landsatTM.pix, to see the information abou that file.
On Xpace upper menu bar you will under Utilities find Image Display Windows.... Activate it
and in a new window you will see a list of Image Windows. Choose the first Image Window on the list
with a mouse click on that line. Click on Modify and change the number of image planes to nine (9C), if
that that is not already the case and the size to 512 × 512 lines and columns. Then, to start the window
click on Start ImageWorks. Two windows will be created; a display window and a control window. Move
the windows so that you see both.
On the display menu bar there is a File option. Under this you will find Load Image.... In the
next appearing window, choose landsatTM.pix and press Ok. A new window appears where you select
the channels and the part of the image you want to load to the display. Select all the channels with
Default and the entire image with Overview. Press Load & Close.
Centre for Image Analysis March 14, 2005 4
RGB settings
Graphics on/off
Graphics shown on display
Vectors on/off
Vectors shown on display
Enhancements
Image zooming
The image displayed contains 7 channels. The image can be stretched by clicking on one of the
Enhancements button in the image control window. Look at the seven channels separately by choosing
Imagery BW and then on each channel. Different enhancements can be applied either by using the zoom
option in the handler and zoom the area to enhance or by using Edit → LUT... option on the display
menu.
3. Examine different band combinations by selecting which band to apply to each colour.
TM 3,2,1 means TM3 in red, TM2 in green and TM1 in blue, corresponds well to the visual colours,
a true colour composite. Compare this band combination with TM4 in red, TM3 in green and TM2
in blue. Can you give any comments on the advantage and disadvantage of using TM4
(infrared)...?
4. The combination TM 5,4,3 is used quite often, can you see any differences or advantage
compared to the usual IR aerial film combination like TM 4,3,2 ?
5. TM6 is very different from the other bands. How and why?
Two-dimensional classification
The scattergram
By plotting image grey level values against each other we get a 2D-graph called a scatterplot. Each
scatterplot is a combination of the histogram of two channels showing the correlation between these his-
tograms. The brightness of each scatterplot pixel is determined by the number of pixels in the image
with the corresponding grey level values. Thus, bright areas indicate common combinations and black
areas indicate combinations that virtually never occur. Use the topographic map and image plot Upp-
sala NV in scale 1:50 000 to find training areas and to identify features. “Gröna kartan” will be handed out.
There are 4 buttons under the CLASS2D program. RUN, ABORT, FILE and DBIC.
DBIC is used to select which channel to use for the scattergram.
FILE is used to select the file to use in the classification.
Use Landsat TM3 and TM4 for scatterplot by entering 3,4 in DBIC or by clicking on the rows showing
those channels. When two channels are chosen you can run the program by pressing RUN. The HELP
button will give you more information. Wait. . . . . .
Select the I option in the menu that is shown. In the ImageWorks display menu bar there is a graphics
editing option (Edit → Graphics...). Activate this option and it will give you a menu for drawing and
editing graphic overlays.
Outline a training area in the image by using the graphic editing function Trace & Close. (There
are other options that you are free to try.) Fill with the Flood Fill option. Use Help if you need an
explanation of the different tools.
When you are ready with your training area, move back to the CLASS2D menu in the terminal window
and press return to continue.
The training area will now be plotted in the scatter plot in magenta. The magenta coloured pixels repre-
sent the training area in the scatter plot. You can now run the classification by using the training area
cluster to mark out all pixels that match the grey level value set of TM3 and TM4.
Enter y to run a quick classification. Wait. . . . . .
Now you can edit the training area in graph 1 (red) in the graphic editing menu. Remove pixels far away
Centre for Image Analysis March 14, 2005 6
from cluster center and fill out holes. The zoom function can be used as usual.
Enter return in the CLASS2D menu when you are satisfied with your editing.
Classification will be shown in green. You can compare the image and the classification by entering B and
save it with G.
To enter a new training area make the same procedure again but start with deleting the old one. This can
be done by pressing the button number three in the Graphic Clear part of the graphic editing window.
Examine the other options and answer the following questions:
6. Is it possible to separate different lakes (Ekoln and Funbosjön) and in that case why?
Is it possible to outline those in the scattergram with the S option ?
By visual inspection, what other classes is possible to separate.
Built up areas?
Coniferous dense forest?
Different kinds of crops?
Clear cuts?
Print the classified image. First Print under File to a .ps-file from the image window. Then use
UNIX command: lpr -Pclc700 filnamn.ps.