[GRASS-SVN] r69927 - grass/branches/releasebranch_7_0/raster/r.texture

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 27 07:00:30 PST 2016


Author: mlennert
Date: 2016-11-27 07:00:30 -0800 (Sun, 27 Nov 2016)
New Revision: 69927

Modified:
   grass/branches/releasebranch_7_0/raster/r.texture/r.texture.html
Log:
r.texture: manual update, sync to trunk (r69882,r69894, r69896-9, r69922)


Modified: grass/branches/releasebranch_7_0/raster/r.texture/r.texture.html
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.texture/r.texture.html	2016-11-27 14:59:49 UTC (rev 69926)
+++ grass/branches/releasebranch_7_0/raster/r.texture/r.texture.html	2016-11-27 15:00:30 UTC (rev 69927)
@@ -3,19 +3,60 @@
 <em>r.texture</em> creates raster maps with textural features from a
 user-specified raster map layer. The module calculates textural features 
 based on spatial dependence matrices at 0, 45, 90, and 135 
-degrees for a <em>distance</em> (default = 1).
+degrees.
+
 <p>
-<em>r.texture</em> assumes grey levels ranging from 0 to 255 as input. 
-The input is automatically rescaled to 0 to 255 if the input map range is outside
-of this range.
+In order to take into account the scale of the texture to be measured,
+<em>r.texture</em> allows the user to define the <em>size</em> of the moving
+window and the <em>distance</em> at which to compare pixel grey values.  By
+default the module averages the results over the 4 orientations, but the user
+can also request output of the texture variables in 4 different orientations
+(flag <em>-s</em>). Please note that angles are defined in degrees of east and
+they increase counterclockwise, so 0 is East - West, 45 is North-East -
+South-West, 90 is North - South, 135 is North-West - South-East.
 
 <p>
-In order to reduce noise in the input data, and to speed up processing, 
-the input map can be recoded using equal-probability quantization. 
-Quantization rules for <em>r.recode</em> can be generated with 
-<em>r.quantile -r</em> using e.g 16 or 32 quantiles (see example below). 
+The user can either chose one or several texture measures (see below for their
+description) using the <em>method</em> parameter, or can request the creating
+of maps for all available methods with the <em>-a</em>.
 
 <p>
+<em>r.texture</em> assumes grey levels ranging from 0 to 255 as input.  The
+input is automatically rescaled to 0 to 255 if the input map range is outside of
+this range.  In order to reduce noise in the input data (thus generally
+reinforcing the textural features), and to speed up processing, it is
+recommended that the user recode the data using equal-probability quantization.
+Quantization rules for <em>r.recode</em> can be generated with <em>r.quantile
+-r</em> using e.g 16 or 32 quantiles (see example below).
+
+
+<h2>NOTES</h2>
+
+<p>
+Texture is a feature of specific land cover classes in satellite imagery.
+It is particularly useful in situations where spectral differences between
+classes are small, but classes are distinguishable by their organisation on the 
+ground, often opposing natural to human-made spaces: cultivated fields vs meadows
+or golf courses, palm tree plantations vs natural rain forest, but texture can
+also be a natural phenomen: dune fields, different canopies due to different
+tree species. The usefulness and use of texture is highly dependend on the 
+resolution of satellite imagery and on the scale of the human intervention or 
+the phenomenon that created the texture (also see the discussion of scale 
+dependency below). The user should observe the phenomenon visually in order to
+determine an adequat setting of the <em>size</em> parameter.
+
+<p>
+The output of <em>r.texture</em> can constitute very useful additional variables 
+as input for image classification or image segmentation (object recognition). 
+It can be used in supervised classification algorithms such as 
+<a href="i.maxlik.html">i.maxlik</a> or <a href="i.smap.html">i.smap</a>,
+or for the identification of objects in <a href="i.segment.html">i.segment</a>,
+and/or for the characterization of these objects and thus, for example, as one 
+of the raster inputs of the 
+<a href="https://grass.osgeo.org/grass70/manuals/addons/i.segment.stats.html">
+	i.segment.stats</a> addon.
+
+<p>
 In general, several variables constitute texture: differences in grey level values,
 coarseness as scale of grey level differences, presence or lack of directionality
 and regular patterns. A texture can be characterized by tone (grey level intensity
@@ -23,29 +64,17 @@
 dependent, hierarchical textures may occur.
 
 <p>
-<em>r.texture</em> reads a GRASS raster map as input and calculates
-textural features based on spatial dependence matrices for north-south,
-east-west, northwest, and southwest directions using a side by side
-neighborhood (i.e., a distance of 1), and writes out by default the average
-over all angles for each measure. Optionally, using flag <b>-s</b> the output
-consists of four images for each textural feature, one for every direction
-(0, 45, 90, 135).
+<em>r.texture</em> uses the common texture model based on the so-called grey 
+level co-occurrence matrix as described by Haralick et al (1973). This matrix 
+is a two-dimensional histogram of grey levels for a pair of pixels which are 
+separated by a fixed spatial relationship. The matrix approximates the joint 
+probability distribution of a pair of pixels. Several texture measures are 
+directly computed from the grey level co-occurrence matrix. 
 
 <p>
-The user must carefully set the resolution (using <em>g.region</em>) before
-running this program, or the computer may run out of memory.
+The following part offers brief explanations of the Haralick et al texture 
+measures (after Jensen 1996).
 
-<p>
-A commonly used texture model is based on the so-called grey level co-occurrence
-matrix. This matrix is a two-dimensional histogram of grey levels
-for a pair of pixels which are separated by a fixed spatial relationship. 
-The matrix approximates the joint probability distribution of a pair of pixels.
-Several texture measures are directly computed from the grey level co-occurrence
-matrix. 
-<p>
-The following part offers brief explanations of texture measures (after
-Jensen 1996).
-
 <h3>First-order statistics in the spatial domain</h3>
 <ul>
 <li> Sum Average (SA)</li>
@@ -104,9 +133,20 @@
 
 <li> Maximal Correlation Coefficient (MCC)</li>
 </ul>
-   
-<h2>NOTES</h2>
 
+<p>
+The computational region should be set to the input map with 
+<b>g.region rast=<input map></b>, or aligned to the input map 
+with <b>g.region align=<input map></b> if only a subregion 
+should be analyzed.
+
+<p>
+Note that the output of <em>r.texture</em> will always be smaller than 
+the current region as only cells for which there are no null cells and 
+for which all cells of the moving window are within the current region 
+will contain a value. The output will thus appear cropped at the margins.
+
+<p>
 Importantly, the input raster map cannot have more than 255 categories.
 
 <h2>EXAMPLE</h2>
@@ -138,8 +178,55 @@
 
 The recoded raster map can then be used as input for r.texture as before.
 
+<p>
+Second example: analysis of IDM (homogeneity) on a simple raster with 
+North-South line pattern.
+
+<div class="code"><pre>
+# import raster
+r.in.ascii in=- output=lines << EOF
+north: 9
+south: 0
+east: 9
+west: 0
+rows: 9
+cols: 9
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+0 0 0 1 0 0 0 1 0
+EOF
+
+# adjust region to raster
+g.region rast=lines
+
+# calculate IDM (homogeneity) in all directions
+r.texture -s lines method=idm out=text_lines
+</pre></div>
+
+<p>
+The following image shows the original map, the result in East-West direction
+and the result in North-South direction, showing how texture can depend on
+direction, with texture perfectly homogeneous (value=1) in the North-South 
+direction, but quite heterogeneous in East-West direction, except for those 
+areas where there are three columns of equal values (as size=3). 
+The overlayed grid highlights that the texture measures output maps
+are cropped at the margins.
+
+<center>
+	<img src="r_texture_directions_example.png" border=1><br>
+	<i>IDM textures according to direction</i>
+</center>
+
+
 <h2>KNOWN ISSUES</h2>
-The program can run incredibly slow for large raster maps.
+The program can run incredibly slow for large raster maps and large 
+moving windows (<em>size</em> option).
 
 <h2>REFERENCES</h2>
 
@@ -168,8 +255,12 @@
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="i.maxlik.html">i.maxlik</a>,
+<a href="i.gensig.html">i.gensig</a>,
 <a href="i.smap.html">i.smap</a>,
 <a href="i.gensigset.html">i.gensigset</a>,
+<a href="https://grass.osgeo.org/grass70/manuals/addons/i.segment.stats.html">
+	        i.segment.stats</a>,
 <a href="i.pca.html">i.pca</a>,
 <a href="r.neighbors.html">r.neighbors</a>,
 <a href="r.rescale.html">r.rescale</a>
@@ -179,6 +270,7 @@
 <a href="mailto:antoniol at ieee.org">G. Antoniol</a> - RCOST (Research Centre on Software Technology - Viale Traiano - 82100 Benevento)<br>
 C. Basco -  RCOST (Research Centre on Software Technology - Viale Traiano - 82100 Benevento)<br>
 M. Ceccarelli - Facolta di Scienze, Universita del Sannio, Benevento<br>
-Markus Metz
+Markus Metz (correction and optimization of the initial version)<br>
+Moritz Lennert (documentation)
 
 <p><i>Last changed: $Date$</i>



More information about the grass-commit mailing list