Opened 11 years ago
Closed 8 years ago
#2325 closed defect (fixed)
Normalization for the probability matrices in r.texture.
Reported by: | DmitryKolesov | Owned by: | |
---|---|---|---|
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 , 9 years ago
Milestone: | 6.4.4 → 6.4.6 |
---|
comment:2 by , 8 years ago
Milestone: | 6.4.6 → 7.0.6 |
---|
comment:4 by , 8 years ago
Component: | Default → Raster |
---|---|
Keywords: | r.texture added |
Version: | unspecified → svn-releasebranch70 |
comment:5 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.