| At present,obtaining target distance information by visual ranging has played an important role in UAV positioning,robot semantic map construction,autonomous driving and even aerospace and other fields.Stereo matching algorithm is the most crucial link in binocular ranging system,which directly affects the accuracy of final ranging.This paper aims to improve the accuracy and real-time performance of local stereo matching algorithm and semi-global stereo matching algorithm by discussing their respective problems,and finally achieve the goal of real-time ranging and improve the accuracy of ranging algorithm.The main research content of this paper includes the following aspects:1.To address the issues of high mismatch rates in low-texture areas and regions with disparities jumps and the sensitivity of the local stereo matching algorithm to changes in image brightness,this article proposes a matching algorithm based on dynamic templates and reliable point filtering.The real-time target detection algorithm is utilized to capture the left image target as a matching template to enhance the algorithm’s real-time performance.Moreover,the computational complexity of the algorithm is reduced by imposing extreme constraints and reliable point screening.The method of disparity correction through reliable point screening is used to first select reliable points with accurate disparities and then propagate reliable disparities to unreliable areas to improve the accuracy of the matching.In addition,the lighting robustness of the algorithm is enhanced by a method based on edges and threshold limits.Finally,a fusion ranging algorithm combining object recognition and size measurement is proposed to provide distance,category,and size information of objects.2.To address the high computational complexity of semi-global stereo matching algorithms and issues such as foreground inflation effects,an adaptive window and effective disparity correction-based semi-global optimization algorithm is proposed in this article.First,the image preprocessing module is used to denoise and enhance the texture of the captured image.The matching cost calculation module based on adaptive window is used to adaptively calculate the cost of different regions.The computational complexity is reduced by adjusting the number and direction of the path in the cost aggregation stage.Post-processing methods are added,including a method to find effective disparities for disparity filling to obtain a better disparity map.Finally,the reliability scoring and foreground inflation effect areas are improved by the disparity correction method based on superpixel segmentation.This article demonstrates improvements in ranging accuracy and real-time performance for the local stereo matching algorithm and semi-global stereo matching algorithm in indoor scenes.Additionally,the algorithms are shown to be capable of obtaining category and size information for objects.The proposed matching algorithm based on dynamic templates and reliable disparity correction has an average error of6.44 cm in the ranging range of 40 cm to 2m,and the lighting robustness is higher than that of the method before optimization.The average error of the semi-global optimization algorithm based on adaptive window and effective disparity correction in the ranging range of 40 cm to 2m is 0.90 cm. |