ABSTRACT Real-time stereo matching with high accuracy is a dynamic research topic; it is attractive in diverse computer vision applications. This paper presents a stereo-matching algorithm that produces high-quality disparity map while maintaining real-time performance. The proposed stereo-matching method is based on three per-pixel difference measurements with adjustment elements. The absolute differences and the gradient matching are combined with a colour-weighted extension of complete rank transform to reduce the effect of radiometric distortion. The disparity calculation is realized using improved dynamic programming that optimizes along and across all scanlines. It solves the inter-scanline inconsistency problem and increases the matching accuracy. The proposed algorithm is implemented on parallel high-performance graphic hardware using the Compute Unified Device Architecture to reach over 240 million disparity evaluations per second. The processing speed of our algorithm reaches 98 frames per second on 240 × 320-pixel images and 32 disparity levels. Our method ranks fourth in terms of accuracy and runtime for quarter-resolution images in the Middlebury stereo benchmark.