Development and implementation of a lane detection algorithm for both normal and low visibility conditions