Opened 9 years ago

Closed 7 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


I think there is an issue with the normalization procedure in h_measure.c (lines 156--168):

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, 7 years ago


comment:2 by mmetz, 7 years ago


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, 7 years ago

Is this ticket "done" or still anything left?

comment:4 by neteler, 7 years ago

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

in reply to:  3 comment:5 by mlennert, 7 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.