In recent years,with the development of computer vision becoming more and more mature,its related technologies have been widely used in the fields of automatic driving,remote sensing mapping,cultural relics protection and so on.Binocular stereo vision is a hot research direction in computer vision,which stereo matching process is the key.Especially in the field of 3D reconstruction,the accuracy of stereo matching directly determines the effect of 3D reconstruction.Therefore,this thesis focuses on how to improve the stereo matching accuracy.The algorithm proposed in this thesis is based on AD-Census stereo matching algorithm.Because AD algorithm is more robust in rich texture regions and Census algorithm is more robust in weak texture regions.In order to enhance the robustness of stereo matching in complex environment,there is AD-Census algorithm which integrates the above two algorithms.However,in the AD-Census algorithm,the AD cost and Census cost adopt fixed weights respectively,which may lead to the algorithm can not give full play to the maximum effect of its matching cost function in the smooth area or texture rich area of the image alone.Therefore,this thesis proposes an AD-Census stereo matching algorithm based on adaptive weight of image segmentation.By introducing the segmentation information and gradient information of the reference image,the algorithm indirectly reflects the characteristics of the region to which the matching pixels belong.Then stereo matching is performed based on the assumption that the same segmented region has similar disparity.When calculating the initial matching cost value,count the percentage of pixels in the matching window that are consistent with the segmentation information of the central pixel and the gradient value is greater than the set gradient threshold in all pixels in the whole window.The two statistics obtained are used to reflect the regional characteristics of the matched pixels.Taking the two obtained statistics as the independent variables of the improved AD-Census cost function,the weights of AD and Census are adaptively set;In the cost aggregation stage,this thesis proposes a cost aggregation method based on image segmentation.Similarly,the segmentation information and gradient information of the image are used to assign an appropriate weight to each position in the aggregation window to enhance the robustness of the aggregation process;In the disparity optimization stage,this thesis mainly adopts SGM and AD-Census algorithm disparity post-processing parts.The algorithm is tested in the Middlebury third generation image sets.And the results show that the error of the proposed algorithm is smaller than other algorithms.It shows that the AD-Census stereo matching algorithm based on adaptive weight of image segmentation has higher robustness for stereo matching in complex environment. |