Interactive lane finding algorithm that runs in real time at about ~10fps
This project was used to create the training data for:
https://github.com/Will-J-Gale/GTA-Fully-Convolutional-Lane-Finding
- Cut out region of interest
- Warp image so lanes are parallel
- Threshold and find edges of image
- Add previous images to try and fill in gaps of dashes lane lines
- Create histogram of images to find base of left and right lane
- Use boxes to find white pixels from base and average the X position
- Use all white pixels found in boxes to create a polynomial fit
- Use polynomial fit to create curved lanes
- Warp image back to original shape and overlay on original image
- GTA 5 + Mods
- Script Hook V
- Native trainer
- Enhanced native trainer
- GTA V FoV v1.35
- Extended Camera Settings
- Hood Camera
- Python 3.6
- OpenCV
- Numpy
Recommended to use on dual monitors
- Run GTA5 in windowed mode 1280x720
- Find car and enable Hood Camera
- Run GTA_LaneFinding.py
- Three Windows will appear
- Lane: This window shows 'Region of Interest' which can be moved by clicking and moving the red spheres
- Lane Finding Process: This windows shows some of the process of finding the lanes
- Settings: This window allows control of some settings used to find the lanes such as image threshold and HSV thresholds
While this algorithm can find lanes, it is not very robust.
The example above shows that the algorithm works well on straight, high contrast roads.
However, as soon as curves appear the algorithm breaks down.
Moreover, when the colour of the road changes or shadows appear the algorithm struggles.
Tweaking of parameters can combat this, however the algorithm cannot figure this out on its own.
Because of the static placement of the 'Region of Interest' fast left/right movement is problematic.