Stereo matching plays an important role in 3D reconstruction in the context of digital museums. At present, it has problems such as occlusion, weak texture, and discontinuous disparity, which restrict the development of binocular vision. In response to this type of problem, Census transformed algorithms based on mean discrimination and Sobel edge detection were introduced to calculate the cost function. At the same time, the algorithm also incorporated the absolute value method of grayscale difference, making it more adaptable to situations such as discontinuous disparity and weak textures. The results show that the Census transform algorithm, which introduces edge gradients, has the lowest error matching rate on different images, with a minimum value of 25.1%. The classical Census transformation method and the AD Census classical transformation algorithm are 28.3% and 27.4%, respectively.Compared with the other two algorithms, the Census transformation of edge gradient improves the matching performance of the algorithm in the discontinuous area of edge disparity and improves the anti-interference ability of the algorithm. At the same time, the algorithm has the lowest error matching rate in the disparity discontinuous regions of Teddy, Cones, Venus, and Tsukuba images, and the lowest value is only 32.1%. Compared to the classic Census transformation method and the AD Census classical transformation algorithm, the minimum error matching rate has decreased by 13.2% and 4.5%, respectively. In addition, the algorithm has the lowest average effective runtime on all four types of images, with an effective average of 4.6 seconds on Venus images with rich texture features, which is 0.6 seconds lower than the classic Census transform algorithm.The improved Census transform algorithm not only has high matching accuracy but also low time complexity, providing a reliable method reference for modern 3D reconstruction fields.