A method of stereo matching using each image fragments as a unit is proposed. Different from the conventional pixelbypixel stereo method, the authors use the edge information of the image to divide the reference image into small segments and perform stereo matching in units of small segments in the horizontal and vertical directions, and then use the disparity images to improve the accuracy of the matching. In each segment, the authors divide the matching cost into high cost and low cost and calculate the cost contribution of the two cost values to the entire segment in different calculation modes. This calculation method can accurately match the situation when the object is partially occluded.Next, the authors enlarge the loworder digit of the intensity for the two reference images and search for more accurate disparity values in all the fragments according to the enlarged reference images. Finally, the disparity map is filled and smoothed using the same color region median filter according to the original reference image.The results of the experiments show that this method has the characteristics of low computational complexity, fast speed, accurate matching, and clear edge disparity of the object. It achieved good performance with the Middlebury stereo benchmark.