r.texture.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <h2>DESCRIPTION</h2>
  2. <em>r.texture</em> creates raster maps with textural features from a
  3. user-specified raster map layer. The module calculates textural features
  4. based on spatial dependence matrices at 0, 45, 90, and 135
  5. degrees for a <em>distance</em> (default = 1).
  6. <p>
  7. <em>r.texture</em> assumes grey levels ranging from 0 to 255 as input.
  8. The input is automatically rescaled to 0 to 255 if the input map range is outside
  9. of this range.
  10. <p>
  11. In general, several variables constitute texture: differences in grey level values,
  12. coarseness as scale of grey level differences, presence or lack of directionality
  13. and regular patterns. A texture can be characterized by tone (grey level intensity
  14. properties) and structure (spatial relationships). Since textures are highly scale
  15. dependent, hierarchical textures may occur.
  16. <p>
  17. <em>r.texture</em> reads a GRASS raster map as input and calculates textural
  18. features based on spatial
  19. dependence matrices for north-south, east-west, northwest, and southwest
  20. directions using a side by side neighborhood (i.e., a distance of 1). The user
  21. should be sure to carefully set the resolution (using <em>g.region</em>) before
  22. running this program, or the computer may run out of memory.
  23. The output consists into four images for each textural feature, one for every
  24. direction.
  25. <p>
  26. A commonly used texture model is based on the so-called grey level co-occurrence
  27. matrix. This matrix is a two-dimensional histogram of grey levels
  28. for a pair of pixels which are separated by a fixed spatial relationship.
  29. The matrix approximates the joint probability distribution of a pair of pixels.
  30. Several texture measures are directly computed from the grey level co-occurrence
  31. matrix.
  32. <p>
  33. The following part offers brief explanations of texture measures (after
  34. Jensen 1996).
  35. <h3>First-order statistics in the spatial domain</h3>
  36. <ul>
  37. <li> Sum Average (SA)</li>
  38. <li> Entropy (ENT):
  39. This measure analyses the randomness. It is high when the values of the
  40. moving window have similar values. It is low when the values are close
  41. to either 0 or 1 (i.e. when the pixels in the local window are uniform).</li>
  42. <li> Difference Entropy (DE)</li>
  43. <li> Sum Entropy (SE)</li>
  44. <li> Variance (VAR):
  45. A measure of gray tone variance within the moving window (second-order
  46. moment about the mean)</li>
  47. <li> Difference Variance (DV)</li>
  48. <li> Sum Variance (SV)</li>
  49. </ul>
  50. Note that measures "mean", "kurtosis", "range", "skewness", and "standard
  51. deviation" are available in <em>r.neighbors</em>.
  52. <h3>Second-order statistics in the spatial domain</h3>
  53. The second-order statistics texture model is based on the so-called grey
  54. level co-occurrence matrices (GLCM; after Haralick 1979).
  55. <ul>
  56. <li> Angular Second Moment (ASM, also called Uniformity):
  57. This is a measure of local homogeneity and the opposite of Entropy.
  58. High values of ASM occur when the pixels in the moving window are
  59. very similar.
  60. <br>
  61. Note: The square root of the ASM is sometimes used as a texture measure,
  62. and is called Energy.</li>
  63. <li> Inverse Difference Moment (IDM, also called Homogeneity):
  64. This measure relates inversely to the contrast measure. It is a direct measure of the
  65. local homogeneity of a digital image. Low values are associated with low homogeneity
  66. and vice versa.</li>
  67. <li> Contrast (CON):
  68. This measure analyses the image contrast (locally gray-level variations) as
  69. the linear dependency of grey levels of neighboring pixels (similarity). Typically high,
  70. when the scale of local texture is larger than the <em>distance</em>.</li>
  71. <li> Correlation (COR):
  72. This measure analyses the linear dependency of grey levels of neighboring
  73. pixels. Typically high, when the scale of local texture is larger than the
  74. <em>distance</em>.</li>
  75. <li> Information Measures of Correlation (MOC)</li>
  76. <li> Maximal Correlation Coefficient (MCC)</li>
  77. </ul>
  78. <h2>NOTES</h2>
  79. Importantly, the input raster map cannot have more than 255 categories.
  80. <h2>EXAMPLE</h2>
  81. Calculation of Angular Second Moment of B/W orthophoto (North Carolina data set):
  82. <div class="code"><pre>
  83. g.region rast=ortho_2001_t792_1m -p
  84. # set grey level color table 0% black 100% white
  85. r.colors ortho_2001_t792_1m color=grey
  86. # extract grey levels
  87. r.mapcalc "ortho_2001_t792_1m.greylevel = #ortho_2001_t792_1m"
  88. # texture analysis
  89. r.texture ortho_2001_t792_1m.greylevel prefix=ortho_texture measure=asm -s
  90. # display
  91. g.region n=221461 s=221094 w=638279 e=638694
  92. d.shadedmap drape=ortho_texture_ASM_0 rel=ortho_2001_t792_1m
  93. </pre></div>
  94. This calculates four maps (requested texture at four orientations):
  95. ortho_texture_ASM_0, ortho_texture_ASM_45, ortho_texture_ASM_90, ortho_texture_ASM_135.
  96. <h2>BUGS</h2>
  97. The program can run incredibly slow for large raster maps.
  98. <h2>REFERENCES</h2>
  99. The algorithm was implemented after Haralick et al., 1973 and 1979.
  100. <p>
  101. The code was taken by permission from <em>pgmtexture</em>, part of
  102. PBMPLUS (Copyright 1991, Jef Poskanser and Texas Agricultural Experiment
  103. Station, employer for hire of James Darrell McCauley). Manual page
  104. of <a href="http://netpbm.sourceforge.net/doc/pgmtexture.html">pgmtexture</a>.
  105. <ul>
  106. <li>Haralick, R.M., K. Shanmugam, and I. Dinstein (1973). Textural features for
  107. image classification. <em>IEEE Transactions on Systems, Man, and
  108. Cybernetics</em>, SMC-3(6):610-621.</li>
  109. <li>Bouman, C. A., Shapiro, M. (1994). A Multiscale Random Field Model for
  110. Bayesian Image Segmentation, IEEE Trans. on Image Processing, vol. 3, no. 2.</li>
  111. <li>Jensen, J.R. (1996). Introductory digital image processing. Prentice Hall.
  112. ISBN 0-13-205840-5 </li>
  113. <li>Haralick, R. (May 1979). <i>Statistical and structural approaches to texture</i>,
  114. Proceedings of the IEEE, vol. 67, No.5, pp. 786-804</li>
  115. <li>Hall-Beyer, M. (2007). <a href="http://www.fp.ucalgary.ca/mhallbey/tutorial.htm">The GLCM Tutorial Home Page</a>
  116. (Grey-Level Co-occurrence Matrix texture measurements). University of Calgary, Canada
  117. </ul>
  118. <h2>SEE ALSO</h2>
  119. <em>
  120. <a href="i.smap.html">i.smap</a>,
  121. <a href="i.gensigset.html">i.gensigset</a>,
  122. <a href="i.pca.html">i.pca</a>,
  123. <a href="r.neighbors.html">r.neighbors</a>,
  124. <a href="r.rescale.html">r.rescale</a>
  125. </em>
  126. <h2>AUTHORS</h2>
  127. <a href="mailto:antoniol@ieee.org">G. Antoniol</a> - RCOST (Research Centre on Software Technology - Viale Traiano - 82100 Benevento)<br>
  128. C. Basco - RCOST (Research Centre on Software Technology - Viale Traiano - 82100 Benevento)<br>
  129. M. Ceccarelli - Facolta di Scienze, Universita del Sannio, Benevento
  130. <p><i>Last changed: $Date$</i>