Code can be linked as part of an iOS application or run as a standalone desktop application (for debug purposes).
Performs well in real time on iPhone 6.
Built for own entertaiment.
↓ Setup perspective
↓ Feed frame from file or camera
↓ Warp perspective (road → screen)
↓ Grayscale
↓ Blur
↓ Canny
↓ Hough lines
↓ Detect lanes
↓ Unwrap perspective for lane points coordinates (screen → road)
↓ Get distance from car bounds to lanes (in inches)
↓ Process data, update state, fire events to outside world
↺ Repeat
Perspective transform/dashboard:
Enjoy!