JunshengFu / driving-lane-departure-warning

Built a real-time lane departure warning system with a monocular camera, using OpenCV.
GNU General Public License v3.0
220 stars 103 forks source link

Change of lanes #1

Closed Kuppharish closed 7 years ago

Kuppharish commented 7 years ago

@JunshengFu This code will not work when there is a change of lanes because during the perspective transform you are giving the lane boundaries as input(src,dst) but when there is a change in lanes it still uses the old values which will give huge errors. Is there any solution for this? Thankyou

JunshengFu commented 7 years ago

The perspective transform is used to warp the image from front view to bird view. And it can be fixed once your camera is fixed. So, we only need to select one frame (any suitable frame) to find the (src, dst).

In order to choose the right perspective transform, I did in this way. In order to get the correct perspective transform for you camera setting, you need to calibrate your camera.

For "lane changing video", there is one demo in the second last section.