Abstract : A report published by Ministry of Road Transport and Highways, Government of India, claims Mohan (IATSS Res 33:75–79, 2009 ) that around 17 deaths happen every hour by road accidents. Driver negligence is one of the major contributors to road accidents. Deviating from the road and hitting roadside objects can be avoided with early warning systems. Lane departure warning systems are inadequate to find the road edges, because of its indefinite nature. In this paper, an efficient algorithm has been proposed to identify the road edges. The algorithm was developed as a combination of concepts like HSV, thresholding, Canny edge detection, and random sample consensus (RANSAC) algorithm. Initially, the sample dataset was used to validate the algorithm. In the second iteration, real-time video was used to validate the algorithm. The algorithm was able to identify the road edge at various light conditions and various vehicle speeds. The algorithm was also developed further to calculate the distance from the center line and the road width. © Springer Nature Singapore Pte Ltd. 2019.