Modified Dynamic Programming for Fast Stereo Matching