Hough Line Transform is a typical algorithm used for detecting the lines existing in the image.
We know that a straight line \(y=mx+b\) can be represented as a point \((b,m)\) a the parameter space. However, vertical lines pose a problem because of unbounded values of the slope parameter \(m\).
For example, we have a line depicted in Cartesian system as red line below
The intersection point of the line and the perpendicular line that comes from the origin is \(P_{0}=(\rho\cos{\theta}, \rho\sin{\theta})\).
So, for any point \(P=(x,y)\) on the line, vector \(P-P_{0}\) and \(P_{0}-0=P_{0}\) must be orthogonal together.
Therefore, \((P-P_{0})\cdot{P_{0}}=0\) or \(P\cdot{P_{0}} = P_{0}\cdot{P_{0}}\)
\(x * \rho\cos{\theta} + y * \rho\sin{\theta}=\rho\cos{\theta} * \rho\cos{\theta} + \rho\sin{\theta} * \rho\sin{\theta}\)
\(\rho(x\cos{\theta} + y\sin{\theta}) = \rho^{2}(cos^{2}{\theta} + sin^{2}{\theta})\)
Since \(cos^{2}{\theta} + sin^{2}{\theta}=1\), \[x\cos{\theta} + y\sin{\theta} = \rho\tag{1}\]
A straight line can also be described as point \((\rho, \theta)\) in Polar system.
From \((1)\), with fixed \((x,y)\), a point in Cartesian system can form a sinusoid in Polar system.
Several points belonging to a straight line in the image space will form multiple sinusoids in the Hough space and they are intersecting at one point.
Demo Hough Line Transform