[GRASS-dev] Landsat 5TM pre-processing - histogram matching - problem

Nikos Alexandris nik at nikosalexandris.net
Mon May 4 12:14:41 PDT 2015


joanna mardas wrote:
> > Hello,

Hi Joanna,

> > I'm totally new user of GRASS and of course I have some problems. I want
> > to do the pre-processing of Landsat (5TM) images (for further band
> > composite, classification and NDVI) and I was using the tips from
> > http://grasswiki.osgeo.org/wiki/LANDSAT#Pre-Processing I did the
> > *i.landsat.toar* I wanted to do the i.atcorr as well but I have no idea
> > how to do this, the manual was not helpful for me, so I gave up. I did
> > not do i.topo.corr because the land I'm working on is flat.

I need some time to fix a python script which does that automatically
(see: <https://github.com/NikosAlexandris/i.landsat.atcorr>, currently
broken :-().


> > And I really want to do "/radiometrically normalise → one approach
> > via*i.histo.match* (in grass 7), also known as relative radiometric
> > normalisation -- one approach is the histogram matching technique of two
> > or more raster maps/".

Another, simple approach, is described in:

"Radiometric Use of QuickBird Imagery, Technical Note." 2005-11-07, by
Keith Krause.

It is in section 6 in the above mentioned document. I have a
half-written script for this... :-(


> > I have fragments of original landsat images
> > imported to GRASS and i.histo.match works with them without any
> > problems.

That is so because i.histo.match, as Moritz notes below, support for
8-bit raster data.


> > But there is a problem when I want to do this on images which
> > I got after i.landsat.toar. The output images are monochromatic-one
> > colour.

Each band is one single image. No matter its bitness, it is "normal" to
appear "mono-chromatic" -- its "normal" to apply a grey scale.


> > I've used command i.histo.match
> > input=_toar2 at konfa,86_toar2 at konfa (the input files are those which I got
> > after i.landsat.toar) and then r.colors map=86_toar2.match at konfa
> > color=grey. I thought that those steps from grasswiki should be done
> > "step by step", so first i.landsat.toar, and then on the output files
> > i.histo.match.
> >
> > Does anyone know how to do this in a proper/correct way?

I wrote this steps some time ago. And I still insist that the correct
way is to not use the Digital Numbers directly. Rather, convert to
reflectance, then do whatever you have to.


Moritz Lennert:

> ISTR that i.histo.match works with integer imagerie, i.e. recoded to 
> 0-255. Recode your toar images to that range with r.recode and try to 
> run the result through i.histo.match to see if that helps.


What I have done in the past,

# if Reflectance > 1, set to 1000, else round and multiply by 1000
r.mapcalc --o "TopoCorr_B_Trimmed_DOS1_ToCR_${Band_No}_${SCENE} = if( TopoCorr.B.Trimmed.DOS1.ToCR.${Band_No}@${SCENE} > 1, 1000, round( 1000 * TopoCorr.B.Trimmed.DOS1.ToCR.${Band_No}@${SCENE} ) )"

# histogram matching
...

# convert histo-matched images back to floating point: rescale to 0-1.0
r.mapcalc --o "${HistoMatchedMap} = ${HistoMatchedMap} / 1000.0"

This came out after Markus Metz' advice, if I recall correctly. I would
add another advice (this one was from Yann Chemin): filter out water. I
think too, now, that i.histo.match will perform better.

Nikos


More information about the grass-dev mailing list