What are rho and theta in hough transform?
\rho is measured in pixels and \theta is measured in radians. First parameter, Input image should be a binary image, so apply threshold or use canny edge detection before applying hough transform.
How does Houghlines work?
Working of Houghline method:
Suppose you want the accuracy of angles to be 1 degree, you need 180 columns(Maximum degree for a straight line is 180). For r, the maximum distance possible is the diagonal length of the image. So taking one pixel accuracy, number of rows can be diagonal length of the image.
How do you use hough lines?
If two edge points lay on the same line, their corresponding cosine curves will intersect each other on a specific (ρ, θ) pair. Thus, the Hough Transform algorithm detects lines by finding the (ρ, θ) pairs that have a number of intersections larger than a certain threshold.