[Python] Calculate the curve of roads from images

Discussão em 'Python' iniciado por Stack, Abril 10, 2025.

  1. Stack

    Stack Membro Participativo

    I've recorded a video in a park with a phone's camera mounted on a rolling stand and extracted the frames. I'm processing them as follows:

    1. Applied Otsu's thresholding on the image
    2. Cleared much of the noise around the path with a custom trained Unet model
    3. Selected the largest patch of white left on the image (It is the road for every image tested)
    4. Filled the holes enclosed by the patch of white
    5. Detected the main contour of the road and simplified it to be a bit more rough

    This is how I create the binary image on the right hand side. The examples below are the average results I get from running the script on a random batch of samples. How could I improve my method of processing the images so the path is closer to reality and most importantly how could I get the curvature of the road? My main goal is to control the steering of a rather "large" vehicle and maneuver in the park.

    Any suggestions are welcome!

    [​IMG] [​IMG] [​IMG]

    Continue reading...

Compartilhe esta Página