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 ...