How do you use Hough transform to detect lines?
Create a hough transform matrix using the hough function. Locate the peaks in the Hough transform matrix function. The peaks correspond to the intersection point in the parameter plane. Each of these peaks is a detected line.