In opencv using houghlines prints only one line
问题 I started following some tutorials on opencv and working on houghlines, and noticed that what ever image I give it would only return one line! I use opencv 4.2.0, and my code is: import cv2 import numpy as np image =cv2.imread("sudoku.jpg") gray=cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) edges=cv2.Canny(gray, 100, 170,apertureSize=3) cv2.imshow(" lines",edges) cv2.waitKey() cv2.destroyAllWindows() lines=cv2.HoughLines(edges, 1, np.pi/180, 240) for rho,theta in lines[0]: a=np.cos(theta) b=np.sin