Opened 10 years ago

Closed 8 years ago

#2325 closed defect (fixed)

Normalization for the probability matrices in r.texture.

Reported by: DmitryKolesov Owned by: grass-dev@…
Priority: normal Milestone: 7.0.6
Component: Raster Version: svn-releasebranch70
Keywords: r.texture Cc:
CPU: Unspecified Platform: Unspecified

Description

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.

Change History (5)

comment:1 by neteler, 9 years ago

Milestone: 6.4.46.4.6

comment:2 by mmetz, 8 years ago

Milestone: 6.4.67.0.6

Fixed in trunk, relbr72, relbr70 with r69838-40. The suggested change has not been applied, instead the actual number of co-occurrences is counted. This change accounts for NULL cells and prepares r.texture for non-rectangular moving windows.

comment:3 by neteler, 8 years ago

Is this ticket "done" or still anything left?

comment:4 by neteler, 8 years ago

Component: DefaultRaster
Keywords: r.texture added
Version: unspecifiedsvn-releasebranch70

in reply to:  3 comment:5 by mlennert, 8 years ago

Resolution: fixed
Status: newclosed

Replying to neteler:

Is this ticket "done" or still anything left?

Fixed by r69838-40. Closing.

Note: See TracTickets for help on using tickets.