Naoki Yokoyama
About MeResearchTutorialsSide Projects CV


Red numbers are mean squared errors calculated to determine if a lane is trustworthy or not

Computer vision program to identify lanes

Spent a lot of time to learn how to use OpenCV's Python library to create a program that would identify lines in the video and superimpose a lane between them as a final project for a course. It works by creating several bit masks that characterize lane lines (bilateral blurs with Canny edge detection, HSL color thresholding, ROI selection), clears everything else, and then uses a polyfit function to generate polynomials to define the location of the lines.


The ROI (region of interest) shifts as the car moves away from the lane, then snaps to the new lane when the car crosses the lane so that the appropriate lanes are being detected


The color changes if the detected lines are deemed incorrect by the program (using mean squared errors calculated between lines from the current and previous frames, and slope comparisons between the lines in the current frame)