πŸ›£ Lane Detection using Python

Code I wrote in Python utilizing NumPy, OpenCV, etc., for Udacity’s Self-Driving Car course. The flow goes like this:

Each video frame is processed as an image:

  1. Convert image to grayscale
  2. Apply a Gaussian blur to the grayscaled image
  3. Generate an image which only contains edges from the grayscaled image (Canny edge detection algorithm)
  4. Mask edges image to a region limited to where the camera would be positioned (a triangle in the middle)
  5. Determine coordinates of lines from the masked image (Hough transform algorithm)
  6. Extrapolate lines:

  7. Calculate min ys and max ys from lines
  8. Separate lines by slope, into left lines and right lines
  9. Calculate mean slope and intercept of left and right lines
  10. Calculate extrapolated line for each left and right lines
  11. Draw semi-transparent lines onto original image

Repeat for each video frame

Edward J. Stembler is a Software Engineer with 21+ years experience in designing and creating software solutions across a wide range of technologies. Passionate about Machine Learning, Data Science, Data Visualization, Elixir, Ruby, Python, Raspberry Pi, Arduino, and Robotics.

Leave a reply:

Your email address will not be published.

Sliding Sidebar

Tweets

Instagram

  • Slowly finishing off a loaf of Chicago Italian bread Yesterdayhellip
    1 month ago by ejstembler Slowly finishing off a loaf of Chicago Italian bread. Yesterday it was an egg sandwich, today French toast
  • 5 burger night!
    1 month ago by ejstembler $5 burger night!
  • Chicken Cacciatore for dinner!
    1 month ago by ejstembler Chicken Cacciatore for dinner!
  • Loved the Croquetas De Jamon Catracho and Toffee Pudding! Alexhellip
    4 weeks ago by ejstembler Loved the Croquetas De Jamon, Catracho, and Toffee Pudding! Alex loved the medium-rare Catracho tenderloin too! And Yana loved the grilled octopus with sour cabbage slaw. We met the chef afterwards. She brought us these tiny Alfajores cookies. Alex asked her what is was, she told him he'd like it. He licked a cookie suspiciously and told her, "There's something wrong with this chocolate. It's too sweet!"
  • Bangers amp Mash amp Newcastle for dinner
    1 month ago by ejstembler Bangers & Mash & Newcastle for dinner