| In recent years,with the development of national economy,drone has been widely used in production and construction.In order to complete the complex tasks in the actual environment,the depth perception based on stereo vision has become a research hotspot because of its relatively low cost,high precision and strong scene adaptability.At present,the key to improve the quality of stereo vision is to calculate the disparity based on image matching.Although various excellent algorithms have been proposed one after another,the main contradiction between using limited calculation resources and obtaining higher accuracy in a limited time has not changed.Besides,in addition to the precondition of perception accuracy,the depth perception system applied to drone has high requirement for real-time performance.Therefore,from the perspective of improving the depth perception accuracy and reducing the time complexity,this paper makes an in-depth study from three aspects: cost calculation,cost aggregation and algorithm optimization.1.For cost calculation,an efficient Census transformation assisted by texture information is improved.Aiming at the problem that the traditional Census algorithm has a large cost of memory and the onboard embedded system is difficult to meet the storage requirements,this paper proposes the half-Census transformation.It changes the traditional coding strategy and compares the two pixels symmetrical to the center pixel,which reduces the coding length by half and improves the memory utilization by twice.In order to solve the problem of poor cost performance of the Census transformation in the area of repeated texture and sharp texture change,this paper uses gradient to calculate the adaptive weight,and combines AD algorithm with half-Census transformation reduce the error matching rate in the area.2.For cost aggregation,a semi-global matching algorithm based on edge information is improved.To solve the problem that the traditional semi-global matching algorithm can’t get the optimal solution in the edge and non-edge regions at the same time by using a single regularized penalty parameter,this paper proposes a binary mapping algorithm based on edge information to solve the penalty coefficient,and integrates it into the semi-global matching algorithm.Finally,the filtering algorithm based on guided filter weighting is applied to protect the edge of disparity map and further improve disparities accuracy.3.For algorithm optimization,a parallel optimization algorithm based on GPU is improved.Aiming at the problem of high time complexity of stereo matching algorithm,which is difficult to achieve real-time processing of drone,this paper solves the problem from cost calculation,cost aggregation and disparity optimization.According to the characteristics of different algorithms,this scheme redesigns the GPU resource structure,focusing on the hardware advantages of GPU large-scale thread parallel operation,combining with GPU multi task scheduling mechanism,GPU high-speed instructions,shared memory and other characteristics,to ensure the accuracy and improve the real-time performance as much as possible,and finally implements the algorithm on Nvida Jeston TX2.Through the actual scene verification,the error of the stereo vision system using this algorithm is 0.3m in the range of 8m,the operation speed is 351 times higher than running on the CPU,and the average image processing frame rate is 21 fps. |