Let every edge pixel vote
Every edge pixel on the road ahead votes for every line through it, and peaks in the accumulator are lines. At 1° and a threshold of 60 the lab finds the same 15 lines as cv2.HoughLines, all of them on two painted lane lines.
Try this
Lower the threshold and watch one lane line turn into a fan of near-identical lines, then halve the angle bin and watch the fan double.
Where this lab comes from
What Is the Hough Transform? Finding Lines by VotingThe Hough transform finds straight lines by letting every edge pixel vote for every line that could pass through it. On a dashcam highway frame, 1,749 edge pixels cast 314,820 votes and the 15 strongest lines all lie on painted lane markings, but on only two of them. A from-scratch accumulator matches cv2.HoughLines vote for vote.
More in cameras and geometry
- Focus, aperture and depth of field — Move the subject and watch the focus plane and the blur follow.
- Four ways a fisheye maps angle to radius — Plot r(θ) for the classical designs against a fitted curve.
- The scene, and what the camera sees — Orbit a 3-D scene on the left; the pinhole view updates on the right.