Giter Site home page Giter Site logo

finding_lane_lines's Introduction

Finding_Lane_lines

1.Pipeline

solidYellowLeft

(1) Transform the image into grayscale

use cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

gray_img

(3) Blur the image using a 7*7 kernel

blur = cv2.GaussianBlur(gray, (7, 7), 0) blur

(4) Use canny edge detection to find all edges in the image

canny

(5) Crop the image with a triangle

the triangle size is: [(int(0.08 * width), height), (int(0.92 * width), height), (int(0.5 * width), int(height * 0.3))]

cropped

(6) Using Hough to extract straight lines

Here are my settings: minLineLength = 60 maxLineGap = 10 lines = cv2.HoughLinesP(lineImg, 1, np.pi / 120, 100, minLineLength, maxLineGap) These are the lines found by HoughLinesP: Hough

(7) separate left and right lines, calculate the slope, and draw green lines with the points found by getCoor()

finalimg

2.Shortcomings and future improvement

(1). The green line disappears periodically in the output video.

This is because in a frame like below, the right side lane less clear comparing the first frame I showed in this README. The first right white line we can se is farther way from the camera. Screen Shot 2019-07-29 at 10 59 33 AM while in a frame like below, where the first right side line is closer to the camera, then the straight line is longer and easier to detect on the picture Hough improvements: As we can see from step 4, edge detection has destinguished the edge. So the algorithm for Hough and calculating lines should be improved. Also, I could extends the line detected from last frame and carry over to make the video look more smooth.

(2). This model assumes road being straight

  • If the road bends, the triangle in this model will no longer be able to detect appropriate lane area. To imporve this, it needs to be broaden, maybe with a trapazoid
  • if the road bends at a large angle, then it won't be detected as a straight line by Hough

(3) Houghline not detecting best result

Hough Transform is tricky to get right with its parameters. I am not sure I got the best settings.

3.Output Video

go to folder "test_videos_output"

finding_lane_lines's People

Contributors

an-bluecat avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.