.TH r.thin .SH NAME \fIr.thin\fR \- Thins non-zero cells that denote linear features in a raster map layer. .br .I "(GRASS Raster Program)" .SH SYNOPSIS .B r.thin .br \fBr.thin help\fR .br \fBr.thin input\*=\fIname \fBoutput\*=\fIname\fR .SH DESCRIPTION .I r.thin 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. .I r.thin 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. .I r.thin will create a new \fIoutput\fR raster data file containing the thinned linear features. .I r.thin assumes that linear features are encoded with positive values on a background of 0's in the \fIinput\fR raster data file. .LP .LP \fBParameters:\fR .IP \fBinput\*=\fIname\fR 18 Name of a raster map layer containing data to be thinned. .IP \fBoutput\*=\fIname\fR 18 Name of the new raster map layer to hold thinned program output. .LP .LP The user can run this program either non-interactively or interactively. The program will be run non-interactively if the user specifies program arguments on the command line, using the form: .LP .RS \fBr.thin input\*=\fIname \fBoutput\*=\fIname\fR .RE .LP Alternately, the user can simply type: .LP .RS \fBr.thin\fR .RE .LP on the command line, without program arguments. In this case, the user will be prompted for needed parameter values using the standard GRASS parser interface described in the manual entry for \fIparser\fR. .SH NOTE .I r.thin only creates raster map layers. You will need to run .I r.line on the resultant raster file to create a vector (\fIv.digit\fR) map layer. .LP .I r.thin may create small spurs or "dangling lines" during the thinning process. These spurs may be removed (after creating a vector map layer) by \fIv.trim\fR. .LP \fIr.thin\fR creates a 0/1 output map. .SH NOTE This code implements the thinning algorithm described in "Analysis 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 "successive 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." .LP 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" .I g.region, .I r.line, .I v.digit, .I v.support, .I v.trim, and .I parser .SH "AUTHOR" .nf Olga Waupotitsch, U. S. Army Construction Engineering Research Laboratory .br 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).