Robust and reliable lane detection is an important issue for driver assistance systems and self-guided systems. Input images acquired from a camera on moving vehicle need to be processed for lane and vehicular traffic detection. We propose an algorithm that uses a chain code detector for detecting lanes and detects vehicles using the horizontal lines formed by the vehicles at the edge of the images. In the first step, a vanishing point is obtained from both sides of the lane, which are obtained from the chain code analysis using the canny edge operator. In the second step, the driveways are decided by combining the vanishing point and the lane information on both sides of the moving vehicle. We define the lane properties and the limiting conditions for reliable lane detection. The robustness of proposed algorithm has been verified from experimental results of complex background images.