This study aimed to propose a stereo matching method based on the cost calculation of combination feature and reconstruction optimization of an unstable tree. For cost calculation, the improved Census transform was used to calculate the illumination characteristics, the color and gradient
operators were used to calculate the color features, and the LBP (Local Binary Pattern) operator was used to calculate the texture features. Then, the initial matching cost was calculated by combining all three features. For cost aggregation, the minimum spanning tree algorithm was improved
and the tree aggregation window was reset. For disparity optimization, the stability parameters were constructed to judge the stability of the tree aggregation window, and unstable trees were disassembled, reconstructed, incorporated into the surrounding stable trees. In the reconstruction
process, the effects of error disparity ratio difference, brightness difference, and disparity difference were considered comprehensively. The experimental results showed that the performance of the proposed method was obviously better than that of the stereo matching method based on the minimum
spanning tree, and was close to that of the two globally optimized stereo matching methods. Further, the method was applied to stereo matching of uterine images, and the depth information was rich in the disparity images, showing that this method could provide a basis for medical diagnosis.