A novel algorithm for distance measurement using stereo camera