exercise #6 - change detection · objective: in this exercise you will learn a little bit about...

12
Exercise #6 - Change Detection 6.1 Introduction to Change Detection 6.2 Histogram Matching 6.3 Introduction to Spatial Modeler 6.4 Single Band Difference Image 6.5 Combining the single band difference images 6.6 Visual Combinations to Look at Change 6.7 Using satellite imagery and change detection to look at forest conditions Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to use Imagine's Spatial Modeler tool. You will also build upon what you have learned in Exercise 5, so instructions for operations learned in those will not be explicitly given here. 6.1 Introduction to Change Detection One of the major applications for moderate-resolution remote sensing data such as Landsat TM is to detect landcover changes between two different dates of images. In forestry, disturbances due to forest operations such as clearfelling, thinning, soil preparation, and road construction are often visible in images from two different dates. This is because these changes may occur over areas that cover at least several pixels, and because these disturbances can cause large differences in spectral reflectance of the surfaces. There are many remote sensor system and environmental parameters that should be considered when performing change detection. Failure to understand the impact of these factors can lead to errors in the change detection analysis. Ideally, the remotely sensed data should be acquired by a system that holds spatial (pixel size), spectral (wavelengths recorded by sensor), and radiometric resolutions the same between the two images used. The temporal (date of acquisition, time of day) factor is also important in change detection. All four of these factors should also be appropriate to the application. The date of image acquisition when doing change detection is important for several reasons. It is often best to have "anniversary dates", or two images acquired at nearly the same date as possible (for example June 11, 1995 and June 13, 1997). One should also consider the optimal time between the image years for the application. Perhaps there is also an optimal time of the year (for example, peak of vegetation growth in early summer, or perhaps autumn when certain tree species are senescing/turning color) depending on the climate and vegetation in your study area.

Upload: others

Post on 20-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Exercise #6 - Change Detection

• 6.1 Introduction to Change Detection

• 6.2 Histogram Matching

• 6.3 Introduction to Spatial Modeler

• 6.4 Single Band Difference Image

• 6.5 Combining the single band difference images

• 6.6 Visual Combinations to Look at Change

• 6.7 Using satellite imagery and change detection to look at forest conditions

Objective: In this exercise you will learn a little bit about change detection, how to do three

different methods of change detection, and how to use Imagine's Spatial Modeler tool. You

will also build upon what you have learned in Exercise 5, so instructions for operations

learned in those will not be explicitly given here.

6.1 Introduction to Change Detection

One of the major applications for moderate-resolution remote sensing data such

as Landsat TM is to detect landcover changes between two different dates of images. In

forestry, disturbances due to forest operations such as clearfelling, thinning, soil preparation,

and road construction are often visible in images from two different dates. This is because

these changes may occur over areas that cover at least several pixels, and because these

disturbances can cause large differences in spectral reflectance of the surfaces.

There are many remote sensor system and environmental parameters that should be

considered when performing change detection. Failure to understand the impact of these

factors can lead to errors in the change detection analysis. Ideally, the remotely sensed data

should be acquired by a system that holds spatial (pixel size), spectral (wavelengths recorded

by sensor), and radiometric resolutions the same between the two images used. The temporal

(date of acquisition, time of day) factor is also important in change detection. All four of these

factors should also be appropriate to the application.

The date of image acquisition when doing change detection is important for several reasons. It

is often best to have "anniversary dates", or two images acquired at nearly the same date as

possible (for example June 11, 1995 and June 13, 1997). One should also consider the optimal

time between the image years for the application. Perhaps there is also an optimal time of the

year (for example, peak of vegetation growth in early summer, or perhaps autumn when

certain tree species are senescing/turning color) depending on the climate and vegetation in

your study area.

Page 2: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

However, even though you may have an "anniversary date" pair of images, the two images

will most likely have different atmospheric conditions as well as different reflectance from the

vegetation depending on the moisture or environmental conditions for that particular year.

If the images have been poorly geometrically registered, this will also pose a large problem

for your change analysis, as "changes" that really aren't changes will appear as a result of the

images not aligning well with each other.

This is a very brief introduction to change detection. For a more complete discussion on

change detection, you will need to refer to the course textbook, course material, and other

references in Image Processing.

Change detection methods

There are many different methods for doing change detection. Some have

advantages over other methods. Some change detection methods include:

Comparison of independent classifications (post-classification comparison)

Classification of multi-temporal datasets

Image differencing

Image rationing

Change vector analysis

Principal Components Analysis

In this exercise you will do:

1. single band difference image using the near-IR bands

2. single band difference image using red and mid-infrared bands and combining these

together

3. visual display of a multitemporal dataset.

Images you will be using

File name: tm03_sub.img

Path/Row: subset of 185/026

Sensor: Landsat 5 TM

Pixel size: 30m x 30m

Acquisition Date:

Bands: TM Bands 3, 4, 5

Correction level: Precision corrected to UTM zone 34 coordinate system

Geographic area: South Ivano-Frankovsk

File name: tm07_sub.img

Path/Row: subset of 185/026

Sensor: Landsat 5 TM

Pixel size: 30m x 30m

Page 3: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Acquisition Date:

Bands: TM Bands 3, 4, 5

Correction level: Precision corrected to UTM zone 34 coordinate system

Geographic area: South Ivano-Frankovsk

Viewing the data and Image Info

Open both tm03_sub.img and tm07_sub.img in one viewer, (remember to click off

the clear image option). Change the band combination to TM Band 4, TM Band 5, TM Band

3 (RGB).

REMEMBER THAT THESE IMAGES HAVE ONLY 3 BANDS, AND THAT LAYER 1 =

TM BAND 3 (RED), LAYER 2 = TM BAND 4 (NEAR-IR) AND LAYER 3 = TM BAND 5

(MID-IR). IMAGINE WILL REFER TO THESE LAYERS AS "BANDS" DURING THE

FOLLOWING OPERATIONS.

1= TM BAND 3

2= TM BAND 4

3= TM BAND 5

Using the Swipe function, check the geometric co-registration of these two images. Are they

co-registered (registered to each other) well enough to do a change detection?

Check the Image Info for this Viewer. Note which image this Image Information is for. To

check the Image Info of the other image in the Viewer, go to View in the Viewer Menu items,

then Arrange layers. This shows you all the layers displayed in that viewer. You can right

click on the bottom layer, and select "Raise to Top", then Apply. (Note that you can also

Delete, or make layers "Invisible" this way.)

What information is important to have the same in both images? In the Image information, do

you see the date the image was actually taken? If not, go to your Windows Explorer, and look

in your Exc6 data directory. Open the tm03_sub.txt and tm07_sub.txt files. These are text

files that usually come with the satellite data. Under "ACQUISITION DATE", you see the

date the image was taken.

#1 What are the Imaging Dates for tm03_sub.img and tm07_sub.img?

6.2 Histogram Matching

Because these two images were taken at different times, and because the atmospheric

conditions were likely different, a histogram matching is often used to try to minimize some

of the differences between the radiometric qualities of the scene.

Page 4: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

On Imagine's Main Menu, press the Help button, then Imagine Online

Documentation, then go to the Index button. Press the "Show" button in the upper right. This

brings up a window on the left. Choose the "Index" tab. Type in "Histogram Match", then

"Display". Read the first paragraph. A little further down, under the Access in the help, it tells

how you should start up Histogram Matching using the Image Interpreter.

Do this from the Image Interpreter (Not the Spatial Modeler). Once you've started Histogram

Match, you should give tm03_sub.img for the input image, and the image to match is

tm07_sub.img. You will make a separate output file for each band. Choose 1 for the Band to

be Matched number below each input file. The output file should be named

tm03_hist_bandl.img. Now, all other parameters should be ok, so run the Histogram Matching

by hitting the OK button. You need to then repeat this for band 2 and band 3, naming them

tm03_hist_band2.img, and tm03_hist_band3 .img, accordingly.

To put the bands together into one image, use Layerstack under the

Interpreter/Utilities/LayerStack button. This opens the dialog which you see below. Your first

input file will be tm03 hist_bandl.img. Choose Layer 1, and then choose the Add button. Go

back up to you Input File window, and choose the tm03_hist_band2.img, and add. Do the

same for band 3. Give the output file the name tm94_histm.img. It should look like the box

below (except the file names...). Accept the other defaults, and press OK.

Page 5: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

In one of the viewers you should have the tm03_sub.img image. In that Viewer also open the

new tm03_histm.img without clearing the viewer. Use the Swipe function to look at the

difference between these two images.

Look at the histogram for the bands of the matched and unmatched images. What difference

do you see between them?

When you are done with this, Go to Session on the Main Menu Items, and Close All Viewers.

6.3 Introduction to Spatial Modeler

There are many different ways to do change detection and there are a few

different buttons you can use in Imagine. One such button is on the Main Icon Panel, under

Interpreter/Utilities/Change Detection. Take a minute to look at this option. The intuitive

dialog helps to produce “difference” and “change” images that looks very much like change

detection in ArcGIS.

Page 6: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

There is another way to do the same change detection by using the Spatial Modeler, which is

Imagine's graphical model maker. You can create functions using the icons provided in the

tool palette. Imagine then translates the graphical model into a program in text format. For

those unfamiliar with programming, it is an easier way to manipulate data.

Press the Modeler button on the Main Icon Panel. This brings up a window with 2

buttons. Choose the Model Maker. This brings up a large blank window and a tool palette.

The main buttons used in this exercise are pointed out below.

6.4 Single band difference Image

The first model we will make is a difference image of a single band of data from each scene.

We will use the near-infrared band, since it is indicative of vegetation.

Input raster data: Near-IR (TM Band 4) of 2003 TM scene, Near-IR (TM Band 4) of

2007 TM scene

Function: Subtract Near-IR band (2003) from Near-IR band (2007) and add value of

128

Output data: Single band difference image^

Page 7: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Making a Model in Spatial Modeler

The model, after you follow the steps provided on the next page, should look like this (except

for the file names):

To make the model, select the raster object icon in the tool palette and then left

mouse click in the blank Spatial Modeler window. A raster shape appears --double click on

the raster in the Spatial Modeler window. A window will open where you will select the input

raster data you want. In the File Name box, choose the image tm03_sub.img, accept the

defaults, and click OK.

Put another raster graphic into the Spatial Modeler window, double click on it, choose the

tm07_sub.img, accept the defaults, and click OK.

If you place an object in the window by mistake, just click on the graphic in the Spatial

Modeler window to highlight it in gray, and then choose the Delete button on your keyboard,

or

Page 8: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Choose the Function Definition icon in the Spatial Modeler tool palette. Click into the Spatial

Modeler window, to place a Function circle there. Now you're going to give input information

to the function. To do this, you need to connect the input rasters to the function. Go back to

the tool palette, and choose the Lock. Then choose the Connector Tool. Go into the Spatial

Modeler window, and left click and hold your mouse over the raster graphic for the 2003 TM

data. Drag the cursor over to the Function circle, and release the mouse. There should now be

an arrow connecting them. Do the same thing for the tm07_sub.img image.

Double click on the Function circle. The Function Definition window appears. Here is where

you tell the program what you want to do with the input data.

In the Available Inputs window, you will see all of the raster data you can use. It only shows

the input data you have connected to the Function by using the Connectors. Note that it not

only tells you that the whole image file is available, but it also automatically makes each layer

of the raster input data available to use as a single band.

To create a function in the Equation Window, do the following: Left click on the option in the

Available Inputs for the Near-Infrared band of the 2007 (tm07_sub.img) image. Then choose

the subtraction from the calculator, then the Near-Infrared band of the 2003 (tm03_sub.img)

image. Then add 128 to the equation.

The reason the value 128 is added is that negative numbers will instead be from 0 to +128,

and what would have been positive numbers will now be greater than + 128 to 255. (You can

look at the histogram to see this later). Press OK on the function window.

Now you need to add a raster graphic to the Spatial Modeler window as your output raster

file. Place the raster graphic in there, and connect the Function circle to the Raster graphic.

Double click on the raster graphic, and call this image diffhir07-03.img. Check the box Delete

If Exists. (This is handy when you are first starting to run your model, as you might make

mistakes in the process, and need to refine the model. Although be careful that you don't write

over something you don't want to write over!) Accept the other defaults, and press OK.

Page 9: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Now you're ready to save your model. Go to File/Save and call this diffimg.gmd.

Now click on the Run button. This executes your model. If your model works, a

process window tells you when the output is finished. If your model doesn't work, you will

get an error message, and it will tell you what line number the error is in. Note this line

number.

To find the error you can do two things:

1) Go back into the Spatial Modeler Window, and in your graphical model, double

click on the Function, and look again at the equation in your Function, as well as what

you have for input data.

Tip, Sometimes the model might not have accepted previous edits you have done. In

this case, press the clear button to clear the equation window, and retype in your

equation, and Save the model

2) You can look at the text script of the model. To look at the text, choose the Model

Librarian button from the menu brought up by the Main Icon panel for Modeler. Open

up the .mdl file for your model. Under Library Functions, choose Edit. Use the

View/Current Line Number menu item to go to the line number where the error

occurred.

Looking at the model result

Once your model runs, and has made an output file, look at the result. Open a new

viewer to look at diffnir00-94.img. Compare this with the original imagery. Do this by

opening the tm07_sub.img in the same viewer, so that you can view both images (do not clear

the viewer). Go to View/Arrange Layers, and move the diffhir07-03.img to the top layer.

Choose the Swipe function.

Also open another viewer, and display tm03_sub.img. Geolink this viewer with the one with

the difference image in it. Look at areas where differences are indicated.

Page 10: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Making Difference Images Of The Red And Mid-Infrared Bands

Open the same model you had for the difference of the Near-IR bands, and change

the input files so that you create a separate difference image for the Red band (call it

diffred07-03.img). Save this model as diffred.gmd. Do the same thing for the Mid-IR band

and call the output file diffmir07-03.img.

#2 How do these two change images differ from the difference image of the Near-

IR band?

6.5 Combining the single band difference images

You can view all of these files together in one file. This may give you even more information.

Using the Layer stack function, put the files diffred07-03.img, diffnir07-03.img and

diffmir07-03.img together into one file and call it Diffall07-03.img.

Look at this file and compare whether you get more information from putting all the bands

together than looking at a single band change image.

Try to concentrate looking at the forested areas, since there will of course be a lot of change in

the agricultural areas.

Some particular areas you could look at are:

Area #1: around X: 300990, Y: 5387580

Area #2: around X: 302941, Y: 5381128

Area #3: around X: 305568, Y: 5376459

When you look at all the different images, think of using the different tools you have learned

about, such as Opening multiple rasters in one viewer, Swipe, Geo Link, Inquire Cursor, and

even Breakpoints, when you are looking at these change images.

#3 Describe what kind of land cover changes you think have happened in the areas

1, 2 and 3 above. You will want to look at the change image as well as the original files (you

may need to use Inquire Cursor to figure out the DN values).

6.6 Visual combinations to look at change

Page 11: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

Another way to look at change can be to combine different bands of the images

and look at them visually. You can do this in a different way, other than LayerStack.

In a new Viewer, open the image tm03_sub.img. Then, under Raster/Band Combinations,

change the Red display to Band 4 of tm03_sub.img, the Green display to be Band 4 from the

tm07_sub.img image, and the Blue display to Band 4 of tm07_sub.img again. Look at the

same 3 areas described above to note how different changes appear using this method.

Try also looking at the red and mid-infrared bands in this way. You can also reach the

"change band combinations", by going to the Raster menu item on the Viewer, and then

Tools. This brings up the Raster Tool Palette. There is an icon here which changes band

combinations. You can find it by placing your cursor over the icons, and seeing in the Viewer

Message window, what the icon does.

6.7 Using satellite imagery and change detection to look at forest conditions

This part of the lab is a little more informal look at some real applications that are taking

place using Remote Sensing data and the potential of change detection. It has to do with areas

in Czech republic which have had problems with insects or air pollution which affect the

health and condition of the forests. Also, forest tree phaenology can be analysed in order to

obtain thematic maps of coniferous/ broadleaved forest in the Carpathian Mountains:

Look at the two Landsat TM images tm06_sep.img and tm06_nov.img, which

were acquired during two moth period in autumn 2006. Focus at the areas of broadleaved

(Beech) forest and check the local differences using Swipe, Geo Link, Inquire Cursor, and

other tools you learned to use in the exercises.

Lab Exercise 6 - Change Detection

Page 12: Exercise #6 - Change Detection · Objective: In this exercise you will learn a little bit about change detection, how to do three different methods of change detection, and how to

#1 What are the Imaging Dates for tm03_sub.img and tm07_sub.img?

#2 How do these two change images differ from the difference image of the Near-IR

band?

#3 Describe what kind of land cover changes you think have happened in the areas 1,

2 and 3.

#4 Do you think the satellite imagery you looked at here would be useful for these

applications?