Real-time lane detection and tracking in embedded systems

Hi everybody!

This time I just bring a youtube link to one video we have created that summarizes our work in Vicomtech regarding lane detection and tracking. As you can see, it can determine the position of the vehicle inside its lane, identify whether the vehicle’s wheel are near the lane markings (to warn the driver about lane departures), and make guesses about the curvature of the road ahead.

We have tried it in embedded computers and it works real-time (above 30 fps), with recall and precission results (relative to lane change event) above 95%.

Hope you like it!

This entry was posted in Computer vision and tagged , , , . Bookmark the permalink.

20 Responses to Real-time lane detection and tracking in embedded systems

  1. Daniel says:

    Hello Marcos,
    this is a really great work. I would like to do the same. Could you maybe offer the code?
    I sent you an email with a few questions. Please answer it. Thank you :)

  2. wahib haq says:


    I am working on a research project as part of my computer vision course at Technical University of Munich. I have to find the SDLP parameter to judge how good driving is done by driver but the basic pre-req to start with is tracking his position on lane. It would be really really useful if i can use your code for this project. This is totally a university research project and I’ll mention the authors wherever required. It would be a great help because then i can spend my good time on working on data analysis and doing the real work rather than doing lane detection and tracking.

    Thanks in advance.

    • Hi!
      Let me check if I can find a way to provide you a demo app thta you can run on your videos. This is because the code belongs to my employeer.
      I will send you an answer soon.
      Best regards,

  3. ashraf says:

    Hi marcosnietodoncel !
    i’m working on similar project
    Can you send this demo for my , i’ll be grateful

  4. Thai Hien says:

    Hi marcosnietodoncel!
    i’m working on a research project of my course at University. Can you send this demo for me, i ‘ll be grateful

    • Hi Thai,

      Thanks for writing. I am only sharing the pieces of code you can find under the Code section of this blog. Other source code are not open, or belong to my employee.

      Sorry about that. I am open to provide advises.
      Good luck with your project!

      Kind regards,


  5. rohol says:

    Hi Marcos,
    this is a great work.
    is it possible to share these videos that you tested your program?
    I want to test my program and compare with your work.

    tanks a lot.

  6. Wissam says:

    Hi Macros,

    I am working on a research project like this one but for aeronautic. It would be useful if you want to collaborate with me..

  7. Pingback: Driver Drowsiness Detection | Marcos Nieto's Blog

  8. Pablo Gómez says:

    Buen día Marcos

    Soy de Colombia, y me interesaría saber que algoritmo utilizó para la detección de la linea, si usó el mapeo de perspectiva inversa, y sobre que sistema embebido hizo el proyecto.

    Gracias, será de mucha ayuda su colaboración.

  9. atmaklasik says:

    hi marco, i certainly doing the same research as yours.
    i just want to know about the methodology and principal of lane and vehicle tracking. also if you could share the pieces of the codes i would very thankfull to you but it’s okay if you won’t to.

    if you want to share please email to thank you so much marco :)

    • Hi! Thanks for writing.
      Unfortunately I am not able to share code with you guys because most of my work is done under private research projects and I am normally just allowed to disseminate the results, in the form of videos, papers, and talks in conferences.

      Possibly you know, but the key for lane detection is the ability to compute the vanishing point, then, the geometry of the lanes is largely simplified and you can detect lanes using row-wise intensity bump detectors, and fit a linear or parabolic model.
      For vehicle detector, I use a combination of several steps: (1) perspective gives me a grid of candidates positions and sizes that are feasible for each scene; (2) fast heuristics (presence of shadows beneath the car) with zero False Negatives but some False Positives; and (3) verification with a HOG Cascade detector.
      Last step is a good optical flow-based tracking approach that can handle creation and desctruction of vehicles.

      Good luck with your work!!


  10. Ayush Rai says:

    Hello sir,
    I wasn’t able to download the viulib library from Basically I wanted to use for Lane detection in ADAS? Can you tell me from where I can download viulib.

  11. Hasith says:

    Very nice work indeed. If possible can you tell me what was the process you used in coding this problem ? What algorithms and theories you used ? (for an example, Bird’s eye view -> binary image -> distance transform or Hough transform or etc.) And can you tell me what was the processor and GPU of the embedded system you used for real time performance at 30 fps?

    • Hi, thanks!
      Yes, the pipeline is basically the following:
      0.- (Offline) Create a LUT to map regions of the image into the bird’s-eye view (so, no image is created and this saves a lot of processing time)
      1.- Apply a filter to highlight lane markings and threshold to get a binary image.
      3.- Use the LUT to find maxima, and apply Kalman Filter to detections.
      4.- Apply semantics to determine lane change, etc.
      No GPU is required, the algorithm itself has been carefully engineered to run fast and can be deployed in low-cost ARM-based systems.

  12. Pingback: Real-time vehicle detection and lane detection for ADAS | Marcos Nieto's Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s