A suggestion, that I think will work, so give it a shot. The 4 images I will be using are in reference from "OpenCV 2 Computer Vision Application Programming Cookbook" by Robert Laganiere. This was one of the books I used for studying image processing, and there was a similar example on road using HoughLine.
I used HoughLine before, but not on roads. So to give u better idea, here it is=>
The original image is as seen:
Now u can apply Canny to the image, and it will look like this:
OR u can use Sobel too...
After which, u apply HoughLine:
You will have to adjust the parameters yourself.
So here is my suggestion=>
Put a front camera, slightly low enough to be able to detect the lanes up to a few metres, you can use ROI too(Region of Interest) to focus on the bottom half of the video where the lanes are most likely to be. This is to eliminate noise, where other objects parallel to the road is detected as well.
You make the robot stay in the centre both the detected road lines. And another usage of the ROI is that one side of the line disappear,means that it is moving sightly slanted. You can adjust the robot to go back right on track.
When there is a turn, you can specify that if the lines(maybe through canny operator) is no longer vertical, do a turn till the lines are vertical again.
Of course, you will have to write two different functions to check whether to do a right turn or a left turn based on the angle of the lines.
This is how I would tackle the problem. My method should have pretty decent results. The only problem you may face is adjusting the parameters of Houghlines and Canny.
(P.S. In viewing your pictures, I notice the side of the road kerb have gaps once in a while. So I would recommend HoughLineP instead of HoughLine where you can specify the maximum gap between each line to consider it a line, if I do remember correctly. If that still doesn't work, you may need to do some pre-processing on the frames of the video.)
Hope you find my method useful. Good Luck. If there is anything else you may need help with, comment on this answer, I try my best to help(: