Winter 2016 GEOG457/657: Lab 2 – Image Fusion
With increasing volumes of image data, it is becoming common to merge or fuse multispectral data using a panchromatic higher resolution image to create a multispectral (MS) image with the resolution of the ‘intensity’ image. Ideally these are from the same dataset – captured simultaneously. This is undergone both for a ‘sharper display’ and potentially a better classification (and other image processing steps).
In PCI, these options are mostly under Tools -> Algorithm Librarian-> Image Processing -> Data fusion Options: FUSE FUSEPCT PCTFUS RGBFUS
But there is also IMGFUSE in there (somewhere – you can search for it to locate it under the all algorithms folder) and the PANSHARP algorithms.
The Idea of fusing data
Much of the fusing of lower resolution multi spectral data (able to combine different wavelengths – bands- into colourful images) with higher resolution panchromatic data (higher level of detail) is to get nicer looking images:
“They give us those nice bright colors
They give us the greens of summers ”
This does not necessarily provide any better utilization of the data however – i.e for improving classification of remotely sourced imagery. In this lab we will go through several processes of fusion (different techniques), as well as paying attention to the benefits of fusing data.
Procedures in the lab
a. Keep subsets moderate creating fuse images within a screen display (<1000 pixels):
With our newer machines, you are not limited by processing or visualizing of your results, but things do often go faster if you can run and view the data quickly. Scott will talk about why he and Roger often stick to older ways of working (testing) with data.
b. Run all operations to RGB viewer first until you get the results you want:
By now, you have already habitulated yourself to loading the data into the viewer prior to saving data. There is nothing wrong with saving to files as well, but you also need to keep your workspace clean and organized.
c. Capture all good images as indicated for a report document (7-8 are listed):
A benefit of PCI files (datasets as Scott likes to call them), is the ability to keep all your raster and vector results in one location. Results should be organized in a fashion to make use of this ability.
1. Us a subset of Landsat 8 and MS to create RGB higher resolution image. We are using the Georgia dataset today in the lab, but you can download an image of wherever you wish.
2. FUSE and then IMGFUSE on the subset window
3. Use sample from 1999 ETM+ scene to fuse pseudocolor thermal layer with PAN
We have data in /home/labs/geog457 that can be used for the lab.
a.LS8 15m PAN and 30m MS from the same Image will be used for the different fusing procedures. Again you are welcome to try any data with the lab.
- we are using a subset from the Georgia dataset we reviewed last week
- The subset is the middle part in the scene (Scott made sure we have the alien space landing site in the scene as well)
- The subset is 5000 x 5000 pixels in size, but you can resize it to 1000 x 1000 to fit the screen each time. (or use the 1:1 zone level button to review)
Optional data to try
b. Ikonos 2002 – Cranbrook Hill 1m PAN: pgikon1m.pix and the 4m MS: pgikon4m.pix
- Data are 11-bit (Range 0- 2047)
c. ETM+ images from 12 Sept 1999:
- Pan (channel 8) – 15m res MS bands 1-5, 7 – 30m res
- Thermal channel 6 (low gain) tm61 (60 m res)
- Thermal channel 6 (high gain) tm62 (60 m res)
1. SUBSET Landsat 8 IMAGES
Scott has done one for our use in the lab. He did not have to perform any re-projections on these data but he should have decided on a nice clean extent for the subset (pixel boundaries). Below are the screen shots of the subset steps taken:
- Why do we decide this for the first subset – the first TIF file from the compressed dataset)?
– Why do we only need one subset?
– Which image should you subset first?
HINT: If you keep the subset extent (X or Y) to no more than 5000 pixels (MS) or 2000 (PAN) .. [~15km] – you always need to zoom to see the effect of fusing.
– What is the projection ?
– How did we determine this?
– How did you get the exact number of pixels – were the extents nice and clean?
2A. FUSE Input bands (using the FUSE command)
Try a couple of FUSE examples, one using visible colour and one with SWIR, NIR, and visible red (the old 5,4,3 combo for LS4,5 and 7 – remember band 6 of LS8 is similar to band 5 of the old LS sensors.
- What band is the intensity value (how is it easy to determine, even if you did not read the help on FUSE)?
Run just to display first to test, then to a new file when happy.
– How do we save this new file?
– What should we name it?
– We should add some information for channel descriptions – how to we do this?
– How can we add other metadata?
2B. Using fused images in classification
The FUSE algorithm creates a sharper image, but can we use it in image processing? Briefly try an unsupervised classification (input bands fused from the SWIR,NIR, Visible red FUSE). For specific classes e.g. small lakes. Compare the classifications for before and after fusing.
- Do you remember how to perform an unsupervised classification?
– Is the higher res useful ?
– Did the fuse benefits the SWIR,NIR and Visuble combination?
– Would a classification using only the visible bands be very useful (hence is FUSE useful for classification?
Like FUSE this includes the HIS and RGB transformations, but IMGFUSE appears to preserve the initial radiometric values (DNs), so it should be better for classification and other processes. Run it on the same subset and visually compare with the FUSE results. (save the new channels to the same file you used in FUSE above) It seems parameters InputLock and TransfText can be defaulted as the TM data are cleanly co-registered (they are from the same initial download of a Landsat 8 scene).
The help suggests that if both images are geo-rectified, there is no need for InputLock and TransfText. As mentioned our images are not only geo-rectified, but they are also have their pixels lining up properly. IMPORTANT – YOU CAN ONLY RUN IMGFUSE ON 8 BIT DATA This is not a problem for the other Landsat sensors – (TM, ETM 4,5,7), but the data in Landsat 8 is 12 bit data – stored in tif files with 16 bit channels. This can be solved by taking the data from the 16 bit channels and putting them into a new file as 8 bit channels. This is done using the SCALE function.
Scott has created the files necessary for IMGFUSE to work by using the following command in the terminal:
gdal_translate -a_nodata 0 -of GTiff -scale 5575 65535 0 255 -ot Byte /home/emmons/geog457/lab_2_fuse/georgia_subset_pan_5k_5k.pix /home/emmons/geog457/lab_2_fuse/georgia_subset_pan_5k_5k_8_bit.tif
You can achieve the same results by using the SCALE algorithm to create the same scaled files in your home directory.
Start with parameter defaults: maxgain = 3, kernel length=7. The help suggests reducing gain if there is noise in the water, and max value should not exceed 7.
Also run this using 7 and 3 instead of 3 and 7 and check the differences. Save the better one.
- What are InputLock and TransfText input ports – see Roger’s notes below – LOOK AT THE HELP
– What is an input port?
– How did we save the channels created in the IMFUSE to new channels in the FUSE file?
– How many channels should there be in this file?
– What should we do, once we have all the channels we want in the file – and how?
– Were the results as you expected – especially for the infrared channels (bands)?
- Which algorithm is more useful for classifications?
- Can you think of other inputs you could use in the IMGFUSE procedure?
- What would you need to do if you used different sensors for fusing – see the notes from Roger below?
3B. Using imgfused images in classification
Try the unsupervised classification again for the SWIR,NIR, Visible red IMGFUSE
You can also try:
– input bands 4-3-2 and 6-5-4 Compare DNs for features such as water, cutblock and forest with the original bands, and the FUSE result. Remember, you have the original classification from the pre-classification channel in the 16 bit ms file.
Roger’s notes on IMFUSE and locking the images
Normally the IMGFUSE procedure is run after running IMGLOCK to lock the low, and high resolution images. The result of the IMGLOCK process is a precision corrected low resolution copy of the high resolution image; the image also contains transformation information in a text layer (TransfText) indicating the resolution between the low and high resolution images. If the low resolution (InputIma) and high resolution (InputRef) images are already geocoded products, the image locking process (IMGLOCK) can be omitted, and IMGFUSE can be run directly. In this case the InputLock and TransfText input layers can be defaulted, and the required information will be derived from the geocoded images. For this process to work, the geocoded images must be in the same georeferencing system; they cannot be in different projections.
3 Pansharp or pansharp2
Using the data from the Landsat 8 scene as we have done for FUSE and IMGFUSE, perform a PANSHARP and/or PANSHARP2 on the same data and produce unsupervised classifications for after the sharpening (you still have the before from the initial 16 bit pre-classification).
In pansharp, you need to choose a set of reference channels (see details in the help). We would need to find the channels that resemble the span in wavelengths for the pan data, and add them in as reference channels. This is a bit of trial and error. With pansharp2, the algorithm calculates the best reference channel to use. Once you run pansharp2 – you can see what the software decided to use for reference channels – then re-run pansharp with those values.
Pansharp with PCA
You cannot get away with the lab being that easy. You need to remember something else for increasing the value of pan sharpened data. There are many that use a combination of Principal Component Analysis results with pansharp to better maintain the digital signatures of of the MS data. For more information try reading through:
Computer Engineering & Systems, 2009. ICCES 2009. International Conference on , Issue Date: 14-16 Dec. 2009 , Written by:
In order to do this, we need to match the histogram of the pan data to that of the first principal component from PCA analysis and then apply this match to create a new matched channel that will substitute for the pan input for pansharp. See the flow diagram in the above paper to see the steps that we will be taking.
1). Run PCA for bands 2-7 in the Landsat 8 scene
2). Run the match algorithm to create a lookup table (LUT) that matches the pan (image layer) to the fist principal component (master image).
3). Run LUT algorithm to create a new altered pan/PCA(1) channel
4.) Run pansharp2 with the channel created in step 3 as the panchromatic channel
5.) Check out the results
Write Up of the lab assignment
Document the steps you took above to create a set of fused layers from the different algorithms as well as the required unsupervised classification comparisons.
You do not have to answer the questions directly in the assignment, but you should address them somehow in your write up. Some questions are more for your benefit (i.e. looking up metadata) in using the software, but most are to direct you in your understanding of the fusing procedures. There is no correct answer as to how well fusing techniques for visualization and for improvements for classification, so let us know what you think about the results from fusion processes.
Include your exports from Focus in your writeup as well as letting Roger and Scott know which files and channels your results are in.