[GRASS-dev] Re: [GRASS GIS] #336: r.colors -e flag does not use full color range if map values are between 0. and 1.

GRASS GIS trac at osgeo.org
Wed Oct 15 06:55:10 EDT 2008


#336: r.colors -e flag does not use full color range if map values are between 0.
and 1.
----------------------+-----------------------------------------------------
  Reporter:  neteler  |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect   |      Status:  new                      
  Priority:  major    |   Milestone:  6.4.0                    
 Component:  Raster   |     Version:  svn-trunk                
Resolution:           |    Keywords:                           
  Platform:  All      |         Cpu:  All                      
----------------------+-----------------------------------------------------
Comment (by glynn):

 Replying to [ticket:336 neteler]:
 > Using r.colors -e on normalized maps show a color problem leading to low
 contrast maps. See attachment for illustration (histogram maps).

 Histogram equalisation depends upon categories, which in turn depends upon
 quantisation. If you have a 0-1 map with "round" quantisation, you only
 get two categories, 0 (covering 0-0.5) and 1 (covering 0.5-1). If the map
 uses "truncate" quantisation, you get one category, 0 (covering 0-1).

 The equalisation code takes the colour corresponding to the category's
 median value and maps it to the category's nominal value. See
 G_histogram_eq_colors() in lib/gis/color_xform.c for the actual code.

 I suppose that I could change it to map the colour for the lower bound to
 cat and the colour for the upper bound to cat+1. However, I'm not sure
 there is really much point, given that histogram equalisation on one or
 two categories doesn't seem to be of much practical use.

 Ultimately, decent histogram equalisation for FP data will require
 replacing the use of the Cell_stats code with something else (i.e. binning
 the data into arbitrary FP ranges, rather than one bin per integer
 category). Also, it will need to use logarithmic (geometrically-spaced)
 bins in order to work well with -g (log scaling).

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/336#comment:3>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list