#There are multiple lines in an image, and when the number of votes is greater than the threshold, it is a straight line
set threshold according to M
result = np.array ( np.where (accumulator > threshold))
# When the division of coordinates is small, the cast bias may occur and the most accurate parameter is not obtained. Therefore, the non-maximal values should be suppressed and the maximal values should be obtained
result = non-maxima suppression (result)
return coordinates of a line
if __name__=='__main__':
Read the image
Gaussian kernel convolution denoising
Grayscale
Do canny detetcion to get binary map
houghTransformLine(edge) and get the line parameters