Line Detection – CV

The basic steps to detect a line in a frame are:

1. Turning the frame to grayscale via color maping conversion.
2. Bluring(A.K.A Smoothing) the frame via a Median Kernel.
3. Detecting edges on the frame via derivatives and comparing the result(gradient) which are highest above a threshold or that are adjacent to high edges that are above the threshold.

A more complex and accurate way is to add another two steps:

4. Use Hough Transoform to detect edges that best describe the line (via a voting system on polar coordinates that are above a threshold of voting).
5. Calculate the average slope and intercept for each of the edges detected and combine them into one line.