[GRASS-dev] [GRASS GIS] #2325: Normalization for the probability matrices in r.texture.

GRASS GIS trac at osgeo.org
Tue Jun 3 02:46:56 PDT 2014


#2325: Normalization for the probability matrices in r.texture.
---------------------------+------------------------------------------------
 Reporter:  DmitryKolesov  |       Owner:  grass-dev@…              
     Type:  defect         |      Status:  new                      
 Priority:  normal         |   Milestone:  6.4.4                    
Component:  Default        |     Version:  unspecified              
 Keywords:                 |    Platform:  Unspecified              
      Cpu:  Unspecified    |  
---------------------------+------------------------------------------------
 I think there is an issue with the normalization procedure in h_measure.c
 (lines 156--168):
 http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/raster/r.texture/h_measure.c#L156

 The goal of the normalization is to calculate the probability matrices
 (see Haralick, R.M., K. Shanmugam, and I. Dinstein (1973). Textural
 features for image classification. IEEE Transactions on Systems, Man, and
 Cybernetics, SMC-3(6), page 613). So the normalizing constants are the
 sums of the matrix elements (see matrix P_matrix0, P_matrix45, P_matrix90,
 P_matrix135).

 The normalizing constants R0, R45, R90 are good for the default distance
 parameter (d==1), but if d>1 then the constants are wrong.

 I think the next code for lines 157--159
 {{{
     R0 = 2 * rows * (cols - d);
     R45 = 2 * (rows - d) * (cols - d);
     R90 = 2 * (rows - d) * cols;
 }}}
 will fix the issue.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2325>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list