.TH r.thin 1grass "" "GRASS 6.4.2" "Grass User's Manual" .SH NAME \fI\fBr.thin\fR\fR - Thins non-zero cells that denote linear features in a raster map. .SH KEYWORDS raster, thin .SH SYNOPSIS \fBr.thin\fR .br \fBr.thin help\fR .br \fBr.thin input\fR=\fIname\fR \fBoutput\fR=\fIname\fR [\fBiterations\fR=\fIinteger\fR] [--\fBoverwrite\fR] [--\fBverbose\fR] [--\fBquiet\fR] .SS Flags: .IP "\fB--overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB--verbose\fR" 4m .br Verbose module output .IP "\fB--quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIname\fR" 4m .br Name of input raster map .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output raster map .IP "\fBiterations\fR=\fIinteger\fR" 4m .br Maximal number of iterations .br Default: \fI200\fR .PP .SH DESCRIPTION \fIr.thin\fR scans the named \fIinput\fR raster map layer and thins non-zero cells that denote linear features into linear features having a single cell width. .PP \fIr.thin\fR will thin only the non-zero cells of the named \fIinput\fR raster map layer within the current geographic region settings. The cell width of the thinned \fIoutput\fR raster map layer will be equal to the cell resolution of the currently set geographic region. All of the thinned linear features will have the width of a single cell. .PP \fIr.thin\fR will create a new \fIoutput\fR raster data file containing the thinned linear features. \fIr.thin\fR assumes that linear features are encoded with positive values on a background of 0's in the \fIinput\fR raster data file. .SH NOTE \fIr.thin\fR only creates raster map layers. You will need to run \fIr.to.vect\fR on the resultant raster map to create a vector (\fIv.digit\fR) map layer. .PP \fIr.thin\fR may create small spurs or "dangling lines" during the thinning process. These spurs may be removed (after creating a vector map layer) by \fIv.clean\fR. .PP \fIr.thin\fR creates a 0/1 output map. .SH NOTE This code implements the thinning algorithm described in \(dqAnalysis of Thinning Algorithms Using Mathematical Morphology" by Ben-Kwei Jang and Ronlad T. Chin in \fITransactions on Pattern Analysis and Machine Intelligence\fR, vol. 12, No. 6, June 1990. The definition Jang and Chin give of the thinning process is \(dqsuccessive removal of outer layers of pixels from an object while retaining any pixels whose removal would alter the connectivity or shorten the legs of the sceleton." .PP The sceleton is finally thinned when the thinning process converges; i.e., "no further pixels can be removed without altering the connectivity or shortening the sceleton legs" (p. 541). The authors prove that the thinning process described always converges and produces one-pixel thick sceletons. The number of iterations depends on the original thickness of the object. Each iteration peels off the outside pixels from the object. Therefore, if the object is <= n pixels thick, the algorithm should converge in <= iterations. .SH SEE ALSO \fIg.region\fR, \fIr.to.vect\fR, \fIv.clean\fR, \fIv.digit\fR, \fIv.build\fR .SH AUTHOR Olga Waupotitsch, U.S.Army Construction Engineering Research Laboratory .PP The code for finding the bounding box as well as input/output code was written by Mike Baba (DBA Systems, 1990) and Jean Ezell (USACERL, 1988). .PP \fILast changed: $Date: 2008-05-16 21:09:06 +0200 (Fri, 16 May 2008) $\fR .PP Full index .PP © 2003-2011 GRASS Development Team