Lab exercise 6, due right before the class on Mar. 4, 2005
ES6973: Remote Sensing Image Processing and Analysis, UTSA
http://www.utsa.edu/eps/programs/EnvSci/HXie.htm
Student name: ______________
Spatial filtering and principle components analysis (PCAs)
Purpose
This lab is to practice two types of image enhancement techniques: spatial filtering and PCAs.
Step 1. Preparation
One data you will use is your ETM+ reflectivity image (UTM and WGS84, not the one you got from lab5). the other one is to download an noised image (p33r36sep14_2000) for step 3 from http://spatialdata.ees.utsa.edu/ClassWebSites/ES5053/texas/. this image is a subset of Path33/Row 36, acquired on September 14, 2000 in central New Mexico.
Step 2. Spatial filtering: convolution based
Open and load the ETM+ image. from the ENVI main menu, click Filter -> Convolution and Morphology. a new window looks like below.

Figure 1
Actually, we even do not talk about the Morphology in the lecture, so we only use the Convolutions. If you put you mouse to the Convolutions of the above window, you will see a lot of methods we did talked about in the lecture such as: High pass, low pass, Laplacian, directional, Sobel, and Roberts. Click any of the first 4, you will see a Editable Kernel (3 x 3), which is also called convolution mask in our lecture or moving window sometime. This kernel, mask, or window is editable (values can be changed) and size can be changed to 5 x 5, 7 x 7, 9 x 9, 11 x 11, ... through the Kernel Size. In our lecture, we use the 3 x 3 as example, but you will practice other sizes in this lab. You can first use the default kernels in the above window. Click the Apply to File, it will lead you to select your image. In this exercise, you can only select one band of the 6 bands image using the Spectral Subset (from the input file window as below Figure 2), remembering you even can select your Spatial Subset from this window. This two buttons (Spectral Subset and Spatial Subset) are very useful, I am sure most of you already used them in previous labs.

Figure 2
Click OK in the window, and output result to memory. then you will have your first high pass image (or high frequency image). Open it in a new window. Link and compare with the original image (the same band) to see the high frequency areas have been captured in the frequency image. Now change your Kernel size to 5 x 5, click the Quick Apply in figure 1. you will get a Quick-Apply Input Band window (figure 3). In this image, you can directly select the original band you did for the 3 x 3 high pass. You also have the choice to do a Spatial Subset. Click OK, you will have a new high pass new window opened. This window even does not output to a memory file (I do not know where it is stored). Change Kernel Size to 7 x 7, or 9 x 9, ... click the Quick Apply, what happen? you can keep increase the Kernel size to see how the high frequency will change compare with the 3 x 3 window.

Figure 3
You can practice the low pass, Laplacian, Directional in the same way and even replace the default Kernel values using the ones we talked in the lecture. Please refer to the Help to learn more about how to use them and refer to the book or lecture slides for the principles and algorithms of them.
If you click Sobel and Roberts edge detector filters. they does not allow you to see the Kernel and edit them since they used the standard Kernels as you learned from the Lectures. I want you to run these two methods to the same band that you used for the previous works. do a quick comparison and evaluation of these two methods for edge detection.
Step 3. Spatial filtering: FFT transform
Before you do this step, I suggest you to close all opened windows and delete all memory files. Under the FFT filtering of the Filter menu, you will see Forward FFT, Filter Definition, and Inverse FFT. the Forward FFT converts the spatial domain image to frequency domain image, Filter Definition is used to define a filter to remove some noises you can see in the frequency image created from the Forward FFT. Some noises is difficult to be identified or removed from spatial domain but easy to do so in the frequency domain. Inverse FFT will convert the frequency domain image back to spatial domain after some noises removed through Filter Definition step.
Now, open the image you download from the class website in step 1, make a 321 as RGB image. You will see the image looks like figure 4 below: obviously these noises are from different bands. I want to you open each band individually to check which bands contribute noises. then you will do a Forward FFT, and then you will check to see how the frequency images response these noises on band by band basis. You may do an analysis on how and where these noises may come from based on the Lecture 4.

Figure 4
Now, if you click the Filter Definition, you will open the Filter Definition window (Figure 5). Click the Filter_Type, you will see several filters to be used to define a filter to remove the noises. "Pass" is passing the low-frequency, removing the high frequency, "Cut" is cutting the low-frequency and keeping the high frequency. In this case, I am not sure which one will work, it maybe none of them will work except the User Defined Cut might work. Once you defined your filter to remove the noise from the frequency domain, then you will use the Inverse FFT to convert back to spatial domain, then the noises should be removed. However, this work got to be complicated, you might need to do a programming or learn yourself how to make a annotation file required for the User Defined Cut. So this part of work is not required for you to finish, however, if you did and show a map like figure 4 without noises, you will get 20 points extra credit. to develop a algorithm using IDL and ENVI to easily remove it could be a good class project, even a master thesis.
Figure 5
Step 4. Principle components analysis
Now click Transform (ENVI main menu) -> Principle Components -> Forward PC Rotation -> Compute New Statistics and Rotate. Select your ETM image or the image with noises (you looked in step 3) as input. You will see a window like below, select the Covariance Matrix (unstandardized PCA) or Correlation Matrix (standardized PCA) for the Eigenvalues and Eigenvector calculation, and then create PC images in just one click. to open and see the statistics file by clicking Basic Tools -> Statistics -> View Statistics File. actually the statistics in this file (Covariance Matrix based PCA) is exactly the same as the one when you only do the statistics without do PCA. While it is slightly different from the statistics of the standardized PCA. In any statistic file, you will see the Eigenvalues are actually listed as the same way as the univariates: min, max, mean, stdev. This is not right. they did not do this in old version of ENVI, but it did in this EMVI 4.1. Please tell why this is not right?

Figure 6
Write a report about the procedure, answer some questions brought out in the lab, and do necessary analysis to your results. if you use the noised image for the PCA, report which band or bands have the noises.