Patent ID: 8902053

Claim:
A method for lane departure warning, applicable to an electronic device, the method comprising: segmenting an original image into a plurality of regional images; analyzing a plurality of characteristics of each of the regional images, and accordingly removing at least one non-lane line region from the regional images, so as to obtain a plurality of lane line candidates; determining a plurality of lane lines from the lane line candidates according to a location of each of the lane line candidates in the original image; distinguishing the lane lines into at least one left lane line and at least one right lane line; and analyzing a variation of an angle between each of the at least one left lane line and the at least one right lane line and a horizontal line, so as to judge whether the electronic device departs from a lane and send a lane departure warning, wherein the step of analyzing the variation of the angle between each of the at least one left lane line and the at least one right lane line and the horizontal line, so as to judge whether the electronic device departs from the lane comprises: comparing the angle of each of the at least one left lane line and the angle of each of the at least one right lane line with a first angle threshold and a second angle threshold respectively; when the angle of the left lane line is greater than the first angle threshold and the angle of the right lane line is smaller than the second angle threshold, determining that departure to the left occurs; and when the angle of the right lane line is greater than the first angle threshold and the angle of the left lane line is smaller than the second angle threshold, determining that departure to the right occurs.