ht - Hough transform algorithm for detecting straight lines in images.

ht [-v][-O][-pt][-n int][-r float][-p float][-kr float][-kt float][-rh float][-th float][-o file][-rofi float float float float][-x int][-P][-h] file

DESCRIPTION

ht is a Hough transform routine using a two dimensional hypothesis testing kernel for finding straight lines in images. The method is described in detail in A Hough Transform Algorithm with a 2D Hypothesis Testing Kernel , CVGIP, Image Understanding, 58, pp. 221-234, 1993. The method is further enhanced by the inclusion of parameter optimisation (the -O option) which is fully described in An Optimising Line Finder Using a Hough Transform Algorithm , CVGIP, Image Understanding, 1994 (submitted).

The routine takes as input a set of edge pixels found from an edge detector , and an estimate of the orientation of the edge through that edge pixel. This data must be input in gf format . The output of this routine is also produced in gf format, so that the lines and associated pixels can be displayed using the xgf package. The output contains, for each line, the rho and theta parameters of the line, the x and y co-ordinates of the start and end of the line segment, the number of pixels that were found by the edge detector and associated with the line segment and finally a measure of the confidence in the existence of the line based on the total accumulator vote.

The output of ht can be added to a postscript form of the original image for printing purposes using ht2ps .

OPTIONS

A detailed description of the options for this program are listed below. There is quite a large list, but the defaults have been set so that none of them should need changing for most applications.

-v verbose mode. Gives the version number of the routine and the option values used. If no input file is specified, this option displays the default values.

-O switch on line parameter optimisation. This produces much more accurate line parameters and better output at little extra cost in time. (Strongly recommended)

-n integer threshold for Hough transform. Minimum number of pixels in an allowed line segment.

-r real real threshold for Hough transform accumulator for bone fide lines.

-p real proximity between pixels in order to be considered as part of the same line segment.

-kr real width of voting kernel in rho, in units of the bin width.

-kt real width of voting kernel in theta, in units of the bin width.

-rh real resolution of accumulator in rho, in units of pixel distance. (Default 1)

-th real resolution of accumulator in theta, in units of degrees. (Default 1.5)

-o file name of output file. If not specified, output will go to a file called ht.gf .

-pt option switch to print out pointsets associated with each line segment found. These appear in the same output file and can be displayed with xgf. With this option you can see the edge points associated with each line segment.

-rofi startx endx starty endy region of interest as a subimage. The four values determine the range of x and y co-ordinates to use.

-x integer number of pixels to extend each line segment by. This option is NOT recommended, but was included to help with junction finding. Since the algorithm uses edge orientation, these orientations are poor close to junctions.

-P option switch to switch off projection of first and last pixels onto the model line. In this case the start and end co-ordinates of the segment are the edge pixels found from the edge detector. Xgf will draw a straight line between these values, but it will not correspond to the rho and theta parameters of the line. This option is not recommended.

-h option to read gf files produces by edged and canny for backward compatibility.

P.Palmer@ee.surrey.ac.uk
August 1994