I'm looking at the documentation of OpenCV's cv2.HoughLines(), and the documentation references a multi-scale Hough transform. What is the difference between a classical Hough transform and a multi-scale Hough transform?
I'm looking at the documentation of OpenCV's cv2.HoughLines(), and the documentation references a multi-scale Hough transform. What is the difference between a classical Hough transform and a multi-scale Hough transform?
First you will need to understand how the Hough Transform algorithm works in general. It is not clear from your question how familiar you are with it.
I recomend to read the following if needed:
In a nutshell, the classical algorithm is composed of the following elements (all the angles are represented in degrees rather than radians only for conveniency):
rho and theta parameters of cv::HoughLines actuallly determine the resolution of ρ and θ.
Since the distance is bound by the image diagonal size, and the angle is 0..180,
we can create a matrix of all the combinations of distances and angles (according to the resolution). This is called the accumulator.rho parameter is 20, we'll get the following ρ values in the matrix: 0,20,40,60,80,100.
same applies for the angle. Each cell in the accumulator matrix represents one potential line (with a specific ρ,θ) .threshold) as the output.The multi-scale version adds the following, to form an iterative process:
srn parameter determined the divisor for the distance resolution.stn parameter determined the divisor for the angle resolution.min_theta and max_theta parameters that can limit the range of the angles we track.In general the multi-scale version can offer better result (due to trying more resolutions), for the price of heavier computation.
I haven't found formal documentation about the exact way this iterative process is done.
But from the comments in the opencv source code, it seems like at least 2 iterations are done: One coarse (with rho and theta) and one fine (with rho/srn and theta/stn).
I recommend you to try both and compare result quality and processing time in your specific case.
Note that there is also a probabalistic version - see cv::HoughLinesP