The dynamic programming-based dense stereo matching algorithms are faster than other global ones, but they usually suffer from the tangible horizontal “streaks” in their generated disparity maps. This problem takes place due to the independent processing of scanlines, ignoring vertical consistency between them. In this paper the path remembering method, which uses the information of the best paths of previous rows, is employed with new developments to establish more depth similarity between rows, especially along the slanted edges of objects in the scene. Also, a new way for estimating matching costs in the left border of the image is presented based on the information of the right-hand neighboring pixels. Mentioned improvements were applied to a well known and standard dynamic programming-based algorithm called “DP.” Evaluation of the new proposed algorithm on standard stereo images shows considerable improvements in the depth estimation along the slanted edges and in the left border of the final results. As a more precise report, the average error rate reduces from 14.2% to 10.4%.