O'Reilly logo

Computer Vision with Python 3 by Saurabh Kapur

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hough line

In mathematics, we define a line using two parameters--a slope and a constant (the point of intersection with the y axis). In this algorithm, we exploit the same concept and try to find the slope and constants of the lines (if any) in an image. Given any two points in the image, we substitute in the equation of the line (as shown next) and solve for the slope and intercept of the line. For example, let the two given points be (x1, y1), (x2, y2).

The equation of a line is defined as follows:

At (x1, y1):

At (x2, y2):

We will solve ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required