Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

markushaug/Lane-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lane recognition system for robotic systems

(No longer being developed.)

Dashboard

Table of content

ABOUT

C++ program using OpenCV to detect and track lanes. Can be used for autonomous driving functions, e.g. to determine whether the driver is coming out of the lane.

KEY FEATURES

  • Written in C++ with OpenCV
  • IDE: Xcode
  • Customizable parameters (Treshold, ROI Size, ...)
  • Signal Processing:
    • Create ROI
    • Canny edge detection
    • Hough line detector

HOW TO USE

I only worked with Xcode under OSX. For other IDEs or compilers I can not provide any information.

  1. In Xcode is set up the library search paths for OpenCV.
  • In my case it is /usr/local/Cellar/opencv/3.4.0/lib /usr/local/lib.
  1. Set path to input file in main.cpp or pass arguments at programm start
  • Or use a single integer to select one of your web cams. (Webcam1 == 1, cam2 == 2, ...)
  • Or provide an pth to a file (video/image)
  1. Configure options in lane_detection.h
  • houghVote determines the fidelity of the line recognition (higher means more lines kept)
  • Further you can enable or disable windows of your choice
  1. Run program
  • Use the xcode project file
  • You may have to change the library paths to your library folder

Implementation

Preprocessing

ROI

The Algorithm creates the ROI, performs the gaussian blur filter to smooth the frame in order to remove noise and perform the canny edge filter.

Canny Edge filter

CANNY

Used to create a binary image of edges. The Gaussian blur is used, followed by a Sobel filter in the x and y direction to determine the size of the gradient. The non-maximum suppression is applied to remove pixels from an identified edge. To determine an edge, two thresholds are used. If a pixel gradient is greater than the upper threshold, the pixel is retained, and if the pixel is lower than the lower threshold, it is rejected. Pixels in the center of the two thresholds are retained when a neighboring pixel is considered part of an edge.

Hough Transform

HOUGH

Used to recognize straight lines where a line is represented by polar coordinates. When all x-y values are represented as polar coordinates, intersection points of the resulting sinusoidal waves show at least two points that share the same line, with the intersection point representing an additional point on the line. As a result, the filter tracks the intersections and declares a line only if the number of points on the line exceeds a certain threshold.

TODO

  • Apply a Bitwise-AND to put the Filter-Layer on top of the input stream.
  • Optimization of the Algorithm (Intersection, Converting infinite lines to finite lines, ...)
  • Probabilistic Hough -> Equivalent to the Hough transformation, but provides endpoint values for all lines determined.

FAQ / CONTACT / TROUBLESHOOT

If you run into issues while using Lane-Detection, please use one of the following options:

  • Use github's issue reporter on the right, so that other people can search these issues too
  • Send me an email [email protected] (might take a few days)

CONTRIBUTING

I would appreciate it if you would contribute to this project. Do not hesitate to contact me if you are interested. I can give you an introduction to the core and the main concepts of the program. (Intermediate) C++, OpenCV and Math skills are required.


Homepage haugmarkus.de  ·  GitHub @markushaug  · 

Releases

No releases published

Packages

No packages published

Languages