Method for generating disparity map of forest scene based on improved SGM
Generating accurate disparity map is the basis of three-dimensional reconstruction and resource investiga-tion under forest canopy by binocular vision.Due to the complex structure and many parallax discontinuities in the forest environment,the existing algorithms will have a large mismatch rate and unclear trunk edge contour when ap-plied to forest scenes.Aiming at the above problems,this paper proposes an improved Semi-Global Matching(SGM)algorithm.Firstly,in the initial cost calculation stage,the Census central pixel value is replaced by the average value of four neighboring pixels to avoid the matching error caused by the sudden change of the central pixel value.Second-ly,the binocular camera image is segmented by k-means clustering,and the pixels are divided into several different clusters.In the process of cost aggregation,the clustering segmentation information,pixel color information and pixel gradient information are fused,and the differences between pixels are analyzed,and the penalty term in the energy function is adaptively adjusted,so that the features of parallax mutation can still be maintained.Finally,sub-pixel thinning,left-right consistency checking and median filtering are used to optimize the disparity value and obtain a more accurate disparity map.Experimental results show that the disparity map generated by this algorithm is more ac-curate and more robust to different forest scenes than the traditional SGM algorithm.