[GRASS-SVN] r58603 - grass-addons/grass7/raster/r.houghtransform
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 3 20:11:39 PST 2014
Author: wenzeslaus
Date: 2014-01-03 20:11:39 -0800 (Fri, 03 Jan 2014)
New Revision: 58603
Modified:
grass-addons/grass7/raster/r.houghtransform/r.houghtransform.html
Log:
r.houghtransform: add documentation
Modified: grass-addons/grass7/raster/r.houghtransform/r.houghtransform.html
===================================================================
--- grass-addons/grass7/raster/r.houghtransform/r.houghtransform.html 2014-01-04 01:35:48 UTC (rev 58602)
+++ grass-addons/grass7/raster/r.houghtransform/r.houghtransform.html 2014-01-04 04:11:39 UTC (rev 58603)
@@ -1,15 +1,191 @@
<h2>DESCRIPTION</h2>
-<em>r.houghtransform</em> is performing line extraction from edges in
-a raster map using the Hough transform.
+<em>r.houghtransform</em> is performing vector line extraction from edges,
+or generally any raster lines, in a raster map using the Hough transform.
+An edge is considered as potential line feature previously detected by
+some other algorithm represented by value 1 in the raster map.
+<h3>Algorithm</h3>
+
+<p>
+In general, the Hough transform is a method for finding geometry structures in
+images. This module uses the Hough transform for straight line detection.
+Extracted line segments can be used to construct rectangles or generally
+any other polygons.
+The transformation itself creates a raster image which is then
+used for finding line segments. The input of Hough transform is an image which
+contains only edges, or generally any lines, represented as raster map.
+It is not necessary but for practical reasons, these edges or lines should
+be thin e.g., those produced <em><a href="r.thin.html">r.thin</a></em> module
+or by <em><a href="i.edge.html">i.edge</a></em> module (Canny edge detector).
+
+<p>
+Lines can be mathematically represented in many ways. For this module,
+the following representation was chosen. Line is represented in polar
+coordinates where <i>r</i> is the distance between the line and the origin
+and <i>Θ</i> is the angle of the vector from the origin to the closest
+point. The equation follows.
+
+<p>
+<i>r</i> = <i>x</i> cos(Θ) + <i>y</i> sin(Θ)
+
+<p>
+When applying Hough transformation for streight lines,
+the point in the original image leads to a sinusoidal curve in the transformed
+image. Points in the original image belonging to one line result in sinusoids
+intersecting in one point in the transformed image (Hough space).
+The coordinates of this point describe the parameters <i>r</i>, <i>Θ</i>
+of the line and its value represents the number of points of the line.
+
+<p>
+In other words, points from the original image with <i>x</i> and <i>y</i>
+axes are transformed into the Hough space with <i>r</i> and <i>Θ</i>
+axes. We can say that the resulting (transformed) image is the
+Hough image. One point (pixel) in the original image is represented by a curve
+in the Hough image and one point in the Hough image defines a line in
+the original image by <i>r</i> and <i>Θ</i> parameters. One line in
+the original image is represented by an intersection of curves.
+More points (pixels) in one line lead to higher value of the curves’ intersection
+point.
+
+<p>
+For further evaluation, it is necessary to extract local maximum values from
+the Hough image which correspond to significant lines of the original image.
+This way we obtain the desired lines in form of <i>r</i>, <i>Θ</i>
+coordinate pairs. However, we do not obtain the end coordinates of the
+original line segment (<i>r</i>, <i>Θ</i> are line parameters).
+
+<p>
+To extract significant lines from Hough image, <em>r.houghtransform</em>
+module uses the <em>identify and remove</em> Hough transform method described
+in [Fiala2003].
+As mentioned above, it is needed to extract the local maxima representing
+the lines from the result of the Hough image. This task is compliated by
+the because presence of noise in the original image.
+The <em>identify and remove</em> Hough transform method provides
+not just the line parameters but also the actual coordinates of points as
+a byproduct. It is based on the idea of sequential removing peaks
+from the transformation result and eliminating the effect caused by
+the points of original image belonging to the removed peak.
+
+<p>
+Lines obtained by <em>identify and remove</em> Hough transform method
+had to be processed in order to get the actual line segments from the
+original image. Due to the noise in the original image, certain points
+can be included in the detected line although they do not belong to it.
+The subsequent step — extraction of line segments — has to
+ignore the outlying pixels. However, the main goal is to find separate
+line segments (pixels belonging to one line segment), so that the line
+segment is not interrupted. The method needs to tolerate also small gaps
+because some line segments can actually be interrupted, e.g. by vegetation.
+On the other hand, these gaps cannot be too frequent because many
+interruptions would indicate line segments which are probably not part of
+the feature. The serious line interruption means that there are two segments
+on one line in the image. As a result, the produced output can be more
+than one line segment for one detected line.
+
+
+<p>
+The Hough transform can be optimized by providing directions of
+edges [Galambos2000] (possible result of the Canny edge detector or other
+ edge detection algorithm).
+These angles are used to search only pixels which are in the direction
+of the particular line.
+The <em>r.houghtransform</em> module uses exactly this approach.
+
+<p>
+It must be noted that line segment reconstruction does not have to be
+considered as a part of Hough transformation. The basic result of
+Hough transformation is the transformed image (Hough image). Thus,
+<em>r.houghtransform</em> module provides the posibilty to export also
+this image.
+
+<p>
+However, for implementation of the <em>identify and remove</em>
+Hough transform method, it is necessary and also very advantageous to create
+data structures instead of an image because of the need for backtracking
+the lines to the original image. As a result, <em>r.houghtransform</em> module
+combines Hough transformation and its <em>identify and remove</em> extension,
+so that the primary result are the line segments.
+
+
+<p>
+From the transformed image (Hough image), we can infer certain rules and
+symmetries, e.g. four peeks at certain positions may denote a rectangle.
+So possibly, some algorithms can use the Hough image to detect features in
+different ways than <em>identify and remove</em> Hough transform method.
+However, these algorithms are not part of <em>r.houghtransform</em> module,
+just the Hough image is provided.
+
+
+<h3>Inputs and outputs</h3>
+
+<p>
+The main purpose of the module is to detect line segments, so the output
+is a vector map which contains line segments found in the input raster
+edge map. The level of details is controlled by several parameters.
+The continuous straight series of pixels are interpreted as a part of
+a line when they are not too scattered (thus possible line width or
+line inaccuracy is limited). The algorithm tolerates small and not too
+often repeated gaps. As a result, the <em>r.houghtransform</em> module
+can produce more than one line segment for one detected line when the gap
+is too long. All the limits mentioned above as well as the minimum length
+of line segment can also be controlled by the user as well as the approximate
+number of all resulting lines.
+
+<p>
+The edge directions (e.g. the optional output of
+<em><a href="i.edge.html">i.edge</a></em>) can serve as an addritional input to
+<em>r.houghtransform</em> module. The availability of edge directions
+reduces significantly the time needed for the computation without
+any negative effect on the result.
+
+<p>
+The optional output of <em>r.houghtransform</em> module is the image
+transformed into the Hough space (Hough image), i.e. the original output
+of the Hough transformation. It can be used for further processing and
+analysis if desired. The image is outputted as a raster map at
+coordinates (0,0). One image pixel is represented as one cell
+but the image does not have any geographical meaning (it is in Hough space).
+Note that Hough image does not contain all the information which is
+used to construct line segments (namely, the backtracking information).
+The color table of this image is set to gray scale with the black
+representing a zero. Note that the number of curves in this image is
+significantly reduced when you provide angle map as an optional input.
+So, if you want to get nicely looking image, you shall not provide angle
+map to <em>r.houghtransform</em> module.
+
+
+
+
<h2>SEE ALSO</h2>
-<em>
-<a href="r.thin.html">r.thin</a>
-</em>
+<em><a href="r.thin.html">r.thin</a></em>,
+<em><a href="i.edge.html">i.edge</a></em> (in GRASS Addons)
+
+
+<h2>REFERENCES</h2>
+
+<ul>
+
+<li>
+M. Fiala. <i>Identify and Remove Hough Transform Method</i>. In: Proc. Vision
+Interface. 2003, pp. 184-187. url:
+<a href="http://www.cipprs.org/papers/VI/VI2003/papers/S5/S5_fiala_28.pdf">
+http://www.cipprs.org/papers/VI/VI2003/papers/S5/S5_fiala_28.pdf</a>.
+</li>
+
+<li>
+C. Galambos, J. Kittler, and J. Matas. <i>Using gradient information to
+enhance the progressive probabilistic Hough transform</i>. In: Pattern
+Recognition, 2000. Proceedings. 15th International Conference on. Vol. 3.
+IEEE. 2000, pp. 560-563.
+</li>
+
+</ul>
+
<h2>AUTHORS</h2>
Anna Kratochvilova,
More information about the grass-commit
mailing list