OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Sun, 07 Oct 2012 20:12:56 -0500How do the rho and theta values work in HoughLines?http://answers.opencv.org/question/2966/how-do-the-rho-and-theta-values-work-in-houghlines/I have found some source code that finds lines in an image like I want and it uses the following HoughLines:
HoughLines( edges, lines, 1, CV_PI/180, 50, 0, 0 );
What I want to do is add the top, left, right, and bottom borders into the lines vector after Houghlines. From what I read in the documentation:
> lines – The output vector of lines. Each line is represented by a two-element vector (rho, theta) . rho is the distance from the coordinate origin (0,0) (top-left corner of the image) and theta is the line rotation angle in radians
lines uses the rho and theta values to represent lines. And that the 1, and CV_PI/180 arguments are called rho and theta. So I did some research on this algorithm and found this diagram:
![image description](http://upload.wikimedia.org/wikipedia/commons/3/39/Hough_transform_diagram.png)
This looks like a good explanation of what im trying to understand but I still cant wrap my head around how to add the borders using the appropriate rho and theta values. Can somone explain this a little more so that I can possibly understand it? I would really appreciate it! Thanks.ZachTMSun, 07 Oct 2012 20:12:56 -0500http://answers.opencv.org/question/2966/