Friday 23 March 2018

How to color-balance false-composites of pan-sharpened Landsat images in GRASS?


Whenever I try to pan-sharpen composites of some Landsat images in GRASS using i.pansharpen, i.fusion.brovey or the IHS sharpening method, the output will have some or all of the following characteristics:



  • the composite color is in a different hue compared to the un-sharpened composite

  • the brightness level is messed up

  • the entire composite went all-white/all-black (when using images pre-processed to top-of-atmosphere reflectance or surface reflectance corrections in i.landsat.toar)



I've also tried all of the following; but the colors/brightness remained the same or turned even worse:



  • Applied i.landsat.rgb, before-and-after the pan-sharpening process

  • Played with the -f or -p flag in i.landsat.rgb

  • Tried r.colors to edit the color table to grey/grey255/grey.eq

  • Tried i.pansharpen using all Brovey/IHS/PCA methods

  • Played with the -l flag in i.pansharpen to rebalance the blue-channel


The GRASS GIS manual did explained on how to perform pan-sharpening and color-balancing, but I can't figure out how to combine both processes in a concurrent workflow. I suspected that this is due to my poor understanding of color-tables, color-histogram, etc. in GRASS..


So, can someone explain to me - how do you tackle color-balancing problems when dealing with Landsat images after image-processing in GRASS? Can you share with me your favorite workflow/methods?



Many thanks for any feedback!



Answer



Overview


One working approach inside GRASS-GIS version 7 to get an acceptable color-balanced composite image after Pan-sharpening is



  1. check if input data are 8-bit ranging inside [0, 255]

  2. if the data are inside [0, 255] proceed then to pan-sharpening (i.pansharpen)

  3. if the data are not inside [0, 255], rescale them to this range (r.rescale)

  4. pan-sharpen with any of the featured methods (Brovey, IHS, PCA)

  5. color-balance automatically by using the i.landsat.rgb module or manually adjusting the color tables of the bands of interest



Details and example instructions


Pan-Sharpening / Fusion


GRASS 7 holds a dedicated pan-sharpening module, i.pansharpen which features three techniques for sharpening, namely the Brovey transformation, the classical IHS method and one that is based on PCA.


i.pansharpen works fine with 8-bit raster maps as an input. If the data to be processed are out of this range, that is out of [0, 255], they can be rescaled to fit into this range by using GRASS' r.rescale module.


Given a set of 11-bit spectral bands (for example Blue, Green, Red, NIR and Pan) ranging between [0, 2047], querying the Blue band for example would return


r.info Blue_DNs -r
min=0
max=2047


Rescaling the Blue band to range between [0, 255]


r.rescale in=Blue_DNs out=Blue_DNs_255 from=0,2047 to=0,255

The same step applies to both the rest of the multi-spectral bands and the Panchromatic band of interest.


As usual when working with GRASS, it is required to set the region of interest, i.e. g.regionrast=Blue_DNs_255 to match the extent of the band(s) or else. The resolution itself is taken care in this particular case by the module and the resulting pan-sharpened raster maps will be of the same high(er) resolution as the Panchromatic band.


An example command for an IHS-based Pan-Sharpening action might look like


i.pansharpen pan=Pan_DNs_255 ms1=Blue_DNs_255 ms2=Green_DNs_255 ms3=Red_DNs_255 output=sharptest255 sharpen=ihs

Color Balancing


After the process completion, the module outputs



...
The following pan-sharpened output maps have been generated:
sharptest255_red
sharptest255_green
sharptest255_blue

To visualize output, run: g.region -p rast=sharptest255.red
d.rgb r=sharptest255_red g=sharptest255_green b=sharptest255_blue

Normally it should be enough to re-balance the colors after the pan-sharpening by using for example the i.landsat.rgb module or manual adjustment of each of the three bands that would compose an RGB image.



Screenshots


...to be added


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...