Where m is the line slope and c is the intercept with y-axis. This equation can be rearranged as:
.Since each of A and B defines a line in the Cartesianspace, each x and y coordinates for a point in a line definea line in in the parametric space of A and B. And all linesin the (A,B) parametric space which came from all thepoints of a line in the (x,y) Cartesian space should be in-tersected in the point which correspond to the slope andintercept of this line .However, practically its more convenient to use thepolar parameters (
) instead of the Cartesian parame-ters (
) because of many reasons like the infinity valueof m in case of vertical lines and the huge range of valueswhich c is may come within .In this case the line equation is written as:
is the normal distance to the line from the originand
is the angle of this normal.
Fig. 1. Polar form of a line.
In this case we can guarantee that
value is between 0and 180 degrees and
value is between 0 and
is the width of input image width and
is theheight of input image.(a)(b)
Fig. 2. Polar Hough transform (b) for an image with two lines (a).
ARDWARE SPECIFICATIONS AND PROGRAMMINGSTEPS
5.1 Hardware specifications
The platform is Windows 7 based. The CPU used is AMDPhenom™ 9850 Processor 2.51 GHz. The GPGPU used isNVIDIA GeForce 9400 GT which was available by theprice of less than 40$ at the date of this work. The Com-pute Capability of this GPGPU is 1.1 which representsalmost the minimum compute capability a GPU can pro-vide (but better than the GPUs with Compute Capability1.0 that it supports Integer atomic functions operating on32-bit words in global memory).All the baseline methods used on the CPU are sequential.
5.2 CPU based functions5.2.1 Matlab function
For calculating polar Hough Transform for lines we haveused the next function in Matlab:
Fig. 3. Matlab function to calculate Polar Hough Transform for lines.
Where: The 2D array
represents the input image.The 2D array
represents the result (all its elementsare set to zero before applying to the function). The integ-er variables (rows) and (columns) are the dimensions ofthe array
. And the variable
is calculating by(4). The version of Matlab in this work is 7.8.
JOURNAL OF COMPUTING, VOLUME 4, ISSUE 4, APRIL 2012, ISSN 2151-9617https://sites.google.com/site/journalofcomputingWWW.JOURNALOFCOMPUTING.ORG87