Skip to content

OryWickizer/LaneLineDetection

Repository files navigation

LaneLineDetection

Abstract

Using OpenCV's cv2 package, Python, and ROS to determine lane line angles from a front-facing camera on an AgileX LIMO wheeled robot.

Explanation of Provided Files

  • LIMO Office Assistant Document.pdf

    • A more detailed (but messy) guide to many of the LIMO's features.
  • LIMO Office Assistant Document.docx

    • An editable version of the above guide.
  • LIMO_test.jpeg

    • The example JPEG used in the "Example of a JPEG to Lane Line Angles" section of this GitHub.
  • laneLineAngles.py

    • The python code that is run on a test image (here, LIMO_test.jpeg) to find lane lines and lane line angles.
  • codeOnLIMO.py

    • The Python file that is used in the "Using the AgileX LIMO's Onboard Camera to Find Lane Lines in Real-time" section of this GitHub on the LIMO to:
      • take images from the AgileX LIMO's Dabai camera stream and to
      • process those images in real-time to find lane lines and display them on the LIMO's screen.

Example of a JPEG to Lane Line Angles

This section used the laneLineAngles.py file and the LIMO_test.jpeg file on a Windows PC.

BGR (Original Image) --> HSV

LIMO_test hsv

Create a mask based on the lane line HSV color values:

mask

Apply that mask to the HSV image to get just the lane lines (and some noise from the trees):

mask applied

Convert the image to Grayscale:

grayed

Blur the image to remove noise (not shown).

Find the edges of the lane lines, and then find the corresponding contours:

edges

contours

Create boxes to surround the contours. Then, find the angles of those boxes relative to a vertical line (angles shown in blue):

angles

Using the AgileX LIMO's Onboard Camera to Find Lane Lines in Real-time

I wish I would have thought to get a video of the LIMO running this program, but here at least is an image of the process:

Limo running code to find lane lines

Here, the LIMO is running the Python file codeOnLIMO.py to find and display lane lines in real-time.

The code is taking images from the onboard camera's (the camera is called Dabai) stream and processing them to find lane lines several times a second.

Next Steps

The next steps in this project could involve:

  • Getting the code running on the LIMO to find lane lane angles, as is done in the laneLineAngles.py code.
  • Using the found lane line angles as part of a control algorithm to keep the LIMO moving in-between lane lines.

To get started, I would recommend taking a look at the "Basic Movement" section of the included "LIMO Office Assistant Document." Here, an attempt is made to send movement commands to the LIMO through code, which could come in handy when trying to develop a control algorithm to keep the LIMO between lane lines while moving.

Specs

Robot Platform

  • AgileX LIMO

Software

  • ROS 1 Melodic
  • OpenCV's cv2 python package
  • Python 2.7

About

Using OpenCV's cv2 package, Python, and ROS to determine lane line angles from a front-facing camera on an AgileX LIMO wheeled robot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages