Next Article in Journal
Special Issue: Recent Advances in Intelligent Vehicular Networks and Communications
Previous Article in Journal
Medical Image Classification with a Hybrid SSM Model Based on CNN and Transformer
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Stereo Matching Method with Cost Volume Collaborative Filtering

School of Electrical and Information Engineering, Hubei University of Automotive Technology, Shiyan 442002, China
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(15), 3095; https://doi.org/10.3390/electronics13153095 (registering DOI)
Submission received: 25 June 2024 / Revised: 29 July 2024 / Accepted: 31 July 2024 / Published: 5 August 2024

Abstract

:
Aiming at the problem of matching ambiguity and low disparity accuracy at the object boundary in stereo matching, a novel stereo matching algorithm with cost volume collaborative filtering is proposed. Firstly, for each pixel, two support windows are built, namely a local cross- support window as well as a global support window for the whole image. Secondly, a new adaptive weighted guide filter with a cross-support window as a kernel window is derived, and it is used to locally filter the cost volume. In addition, a minimum spanning tree is constructed in the whole image window, and then the minimum spanning tree filter is used to globally filter the cost volume. The collaborative filtering of cost volume is realized by fusing the filtering results of the local filter and global filter, so that each pixel can not only receive the support of the neighboring pixels in the local adaptive window, but can also receive the effective support of other pixels in the whole image, thus effectively eliminating the matching ambiguity in different texture regions while maintaining the disparity edges. The experimental results show that the average matching error rate of our method on the Middlebury stereo images is 3.17%. Compared with the other state-of-the-art methods, our method has higher robustness and matching accuracy, the generated disparity maps are smoother, and the disparity edges are better preserved.

1. Introduction

The goal of stereo matching is to determine the correspondences of all pixels between a pair of stereo images, so as to perceive the depth information and three-dimensional structure information of the scene according to the disparity of the corresponding pixels. Due to low cost, easy implementation, and the ability to recover the dense depth information of the scene, it has numerous applications such as autonomous driving [1], 3D object detection [2], 3D reconstruction [3], etc. In addition, stereo matching is also a key technology in photogrammetry [4]. By utilizing stereo matching, more common points are identified, and dense 3D point clouds are also obtained. It can provide good support for the subsequent triangulation and 3D model generation. It is assumed that there is a pair of stereo images that are rectified. Among them, one image is the reference image and the other is the target image. The task of stereo matching is to find the corresponding pixel in the target image for each pixel of the reference image. Because the input image pair is rectified and their epipolar lines are horizontal, the search of pixel correspondences between stereo images is conducted along horizontal lines. The disparity is the difference between the horizontal coordinates of a pair of corresponding pixels. For the pair of stereo images in Figure 1, the left image is the reference image and the right image is the target image. The coordinates of pixel p in the left image are ( x , y ) , and its true corresponding pixel in the right image is p , whose coordinates are ( x , y ) , so that the disparity d of pixel p is the difference between the horizontal coordinate of pixels p and p , i.e., d = x x . The resultant output of stereo matching is a dense disparity map by finding all the correspondences between stereo images [5]. Because of the matching ambiguity problem, multiple candidate pixels in the target image are often very similar to the pixel to be matched, and there is occlusion, noise, or distortion in the images, so stereo matching is very challenging.
Stereo matching methods can be mainly divided into global methods, local methods, and deep-learning-based methods. The global method calculates the disparities of all pixels simultaneously. This can be achieved by minimizing an energy function defined on a Markov random field with a global optimization approach such as graph cuts [6], belief propagation [7], and dynamic programming [8]. Global methods generally have high matching accuracy. However, their computational complexity is very high due to the iterative nature of the underlying optimization process, so they are difficult to apply in situations with strict real-time requirements. The local methods calculate the disparity of each pixel one by one using the local “Winner Takes All (WTA)” optimization algorithm [5]. For each pixel, the WTA algorithm directly chooses the disparity associated with the minimum aggregation cost. In recent years, with the development of deep neural networks, stereo matching methods based on deep learning are proposed [9]. These kinds of methods are data-dependent and the training process of the network model is very time-consuming. It is noted that deep-learning-based methods cannot achieve good and stable performance when changing a scenario because of the generalization problem. Generally, compared with global methods and deep-learning-based methods, local methods are less time-consuming and can better meet the requirements of practical applications. Therefore, we mainly focus on how to generate more accurate disparity maps using a local stereo matching strategy in our work.
Figure 1. Stereo matching of Middlebury [10] Teddy image pair. (a) Reference (left) image; (b) target (right) image; (c) disparity map.
Figure 1. Stereo matching of Middlebury [10] Teddy image pair. (a) Reference (left) image; (b) target (right) image; (c) disparity map.
Electronics 13 03095 g001
The remainder of this paper is organized as follows. Section 2 discusses the related work. Section 3 systematically describes a novel stereo matching method based on cost volume collaborative filtering. Section 4 presents the experimental results and analyzes them. Section 5 concludes this paper.

2. Related Works

Stereo matching firstly needs to calculate the matching cost of each pixel at each disparity using some measurement of pixel similarity. Then, the raw matching costs of all pixels within a support window are aggregated to the center pixel at each disparity, aiming to eliminate matching ambiguity by increasing the cost distance between the real disparity and other candidate disparities. Here, there is an implicit assumption that the disparities of all pixels within a support window are similar. However, this assumption is not valid near depth discontinuities where the pixels in a support window come from different depths. This leads to the well-known edge-fattening effect. To resolve this problem, segmentation-based methods [11,12] divide the image into different regions and take segmented regions as the support windows. However, these methods severely rely on segmentation accuracy and perform poorly for highly textured images. Zhang et al. [13] proposed to adaptively build cross-based support windows for each pixel, and adopted the orthogonal integral image technique to perform cost aggregation. However, this method does not preserve the disparity edges of objects well.
The adaptive support weight (ASW) methods assign an appropriate support weight to each pixel in a support window according to the proximity and color similarity to the center pixel. This is equivalent to segmenting the image in a soft way. Yoon and Kweon [14] computed the support weights of pixels using the bilateral filter. Hence, the cost aggregation essentially used the bilateral filter to smooth the cost volume. The bilateral filter can effectively preserve disparity edges, but its computational complexity is related to the size of the support window. Accordingly, the bilateral filter-based methods execute very slowly when the size of support windows is relatively large. To reduce computational complexity, several acceleration techniques [15,16] for stereo matching with bilateral filter have been proposed. However, these accelerated approximation techniques are often at the expense of accuracy.
Inspired by the work of [14], various edge-aware filtering methods have been introduced into stereo matching for better estimating support weights. Since the computational complexity of the guided filter (GF) [17] is independent of the kernel window size and has better performance than BF, Rhemann et al. [18] utilized GF to smooth the cost volume. Several improved GF-based methods (e.g., adaptive guided filtering [19] and cross-based local multi-point filtering [20]) combine GF with adaptive support windows to avoid the kernel windows covering different objects. To better preserve the object edges, Hamzah et al. [21] used a cascade model of BF and the iterative guided image filter (IGF) [22] to smooth the cost volume. Inspired by human beings, which process stereoscopic correspondence from coarse to fine, Zhang et al. [23] adopted the coarse-to-fine strategy and performed cross-scale cost aggregation by enforcing cost volume consistency across multiple scales. To reduce the computational complexity of cost volume filtering, Yuan et al. [24] presented the fast gradient domain guided image filter (F-GDGIF) with sub-sampling to filter cost volume. To improve the accuracy at disparity discontinuities, Fan et al. [25] presented a novel edge-preserving cost aggregation method by enforcing anisotropy.
To avoid designing an optimal support window for each pixel, stereo matching with recursive edge-aware filters [26,27] have been presented. However, when the recursive edge-aware filters are used for cost aggregation, each pixel can only receive support from pixels in the row or column direction and cannot directly receive support from adjacent pixels in other directions. Yang [28,29] proposed a non-local cost aggregation method by constructing a minimum spanning tree (MST), which has extremely low computational complexity. Mei et al. [30] proposed a segment-tree-based cost aggregation for stereo matching. Cheng et al. [31] proposed a cross-tree structure consisting of a horizontal tree and a vertical tree to perform cost aggregation. Compared to local ASW methods, which often take local fixed-size or adaptive regions as support windows, non-local methods directly take the whole image as the support window of each pixel. Non-local methods can better cope with low- or weak-texture regions, but they generally demonstrate poor performance in highly textured regions.

3. The Proposed Method

Stereo matching methods typically consist of four steps: (1) matching cost computation; (2) cost volume filtering; (3) disparity computation; and (4) disparity refinement. An overview of the proposed algorithm is shown in Figure 2. Below, the proposed algorithm will be described in detail following this pipeline.

3.1. Matching Cost Computation

The matching cost represents the dissimilarity between the corresponding pixels in the left and right images. The census transform changes each pixel’s intensity into a bit string. Because the bit string represents the relative ordering of the neighboring pixels, it can maintain invariance to radiation changes. The census transform shows better performance than the other matching cost calculation methods [32]. Hence, we calculate the matching cost with the census transform.
Supposing that N p is a window centered on pixel p , the census transform of p is formulated as follows:
F p = q N p δ ( I p , I q
where F p is a bit string generated by the concatenation operation , and δ ( i , j ) is a binary function expressed as follows:
δ i , j = 1       i f   i > j 0        e l s e      
It is assumed that the left image is taken as the reference image and D is the disparity level set. For pixel p = ( x , y ) in the left image and an allowed disparity level of d D , the corresponding pixel in the right image can be denoted as p d = ( x d , y ) . The matching cost C p , d of pixel p with disparity d is defined as the Hamming distance of F p and F p d :
C p , d = h ( F p , F p d )
where h ( u , v ) denotes the Hamming function, which counts the number of different bits between the binary strings u and v .
As illustrated in Figure 3, after the matching costs C p , d of each pixel with each allowed disparity level are computed, the initial cost volume C, which is a 3D array, can be constructed. As described in Section 3.2, each cost image of the initial cost volume C will be collaboratively filtered with the adaptive weighted guided filter and the minimum spanning tree filter. Then, the filtered cost volume C A can be generated.

3.2. Cost Volume Collaborative Filtering

Aggregating the matching cost of pixels within each pixel’s support window is a key step in eliminating matching ambiguity and suppressing noise. On the one hand, if only local support windows are used, then the matching ambiguity in largely weak-texture regions cannot be eliminated. On the other hand, if only tree structures from the whole image are used, then they are sensitive to high-texture regions. Therefore, aiming to cope with the matching ambiguity in different texture regions, dual support windows are constructed for each pixel p , namely a local adaptive support window as well as a global support window, which is the entire image as shown in Figure 4. On this basis, the cost volume is aggregated using an adaptive weighted guided filter with the cross-support window as the kernel window and a minimum spanning tree filter with the whole image window as the kernel window. By fusing the output from the two filters, we achieve the cost volume collaborative filtering strategy.

3.2.1. Cost Volume Filtering with Adaptive Weighted Guided Filter

A. 
The structure of cross-adaptive support window
For any pixel p , in order to obtain context information suitable for its structure, as shown in Figure 5, we construct four arms of left, right, up, and down on the reference images, and the horizontal arms of all pixels on its vertical arms form the cross-support window of the pixel p .
We assume that the lengths of the arms are h p , h p + , v p , v p + , r e s p e c t i v e l y ; then, the end point and length of each arm can be determined according to the following judgment conditions:
L m i n D s ( p i , p ) L m a x
D c ( p i , p ) < τ   a n d   M a s k ( p i ) = 0
D c ( p i , p ) < τ 2 , i f L m a x 2 D s ( p i , p ) L m a x
In the above formulas, condition 1 defines the range of the arms, and L m i n and L m a x are the minimum arm length and the maximum arm length, respectively. D s p i , p = | p i p | indicates the spatial distance between p i and p , where p i represents the i -th pixel in the horizontal or vertical direction from p . Condition 2 limits the color difference between adjacent pixels in the arm, D c p i , p = max c R , G , B | I c p i I c p | represents the color distance between pixels p i and p , and τ is the threshold of the color distance. In addition, M a s k p i = 0 limiting pixel p i is not an edge point, and m a s k is the mask for C a n n y edge detection. Condition 3 indicates that when the arm length exceeds half of the maximum arm length, the threshold of the color distance is reduced by half for stricter inspection.
B. 
The cost volume is aggregated by an adaptive weighted guided filter
For any pixel p , it is assumed that its filtering result with the adaptive weighted guided filter on the d -th cost image is C l o c a l A ( p , d ) , and C l o c a l A ( p , d ) is derived below according to the definition of the adaptive weighted guided filter.
It is assumed that W k is an adaptive support window containing pixel p , and the filtering result of the adaptive weighted guided filter is the local linear transformation of the reference image I . Therefore, under the disparity level d , the filtering result C l o c a l A ( p , d ) of C ( p , d ) can be expressed as:
C l o c a l A p , d = a k T I p + b k , p   ϵ   W k
where a k is a 3 × 1 coefficient vector, I ( p ) is the 3 × 1 color vector of pixel p , and b k is a scalar.
Estimating the parameters a k and b k is a linear regression problem. It can be solved by minimizing the sum of the absolute differences between the filtering inputs and outputs of all pixels in the window W k . In order to better maintain disparity edges, inspired by weighted guided filtering in [33], this paper introduces a weighted factor ψ k for perceiving edges into the regular terms of the objective function of linear regression, which is defined as follows:
ψ k = 1 N i = 1 N σ I 2 k + λ σ I 2 i + λ
where σ I 2 i is the gray variance of all pixels in the 3 × 3 window centered on pixel i after I is converted into a gray image, the constant λ is equal to ( 0.001 × M ) 2 , M is the total number of gray levels, and N is the total number of all pixels.
Accordingly, the objective function E ( a k , b k ) of the adaptive weighted guided filter is defined as follows:
E a k , b k = p W k ( ( a k T I p + b k C p , d ) 2 + ε ψ ( k ) a k T a k )
In the above equation, ε is the regularization parameter. The solutions of parameters a k   and b k   in the adaptive weighted guided filter are obtained by linear regression:
a k = ( Σ k + ε ψ k J ) 1 ( 1 | W k | p W k I p C p , d μ k C k , d ¯ ) b k = C ( k , d ) ¯ a k T μ k
where Σ k represents the color covariance matrix of all pixels in W k , J is a 3 × 1 identity matrix, | W k | is the number of pixels in W k , μ k represents the color mean vector of all pixels in W k , and C ( k , d ) ¯ = ( 1 | W k | p W k C ( p , d ) ) is the average matching cost of all pixels in W k .
Finally, the filtering result C l o c a l A ( p , d ) of pixel p in the d -th cost image is taken as the mean value of all pixels’ filtering results in the support window W p , that is:
C l o c a l A p , d = 1 | W p | k W p a k T I p + b k = ( 1 | W p | k W p a k T ) I p + 1 | W p | k W p b k

3.2.2. Cost Volume Filtering with Minimum Spanning Tree Filter

The minimum spanning tree filter takes the entire reference image I as the kernel window. The reference image I is regarded as a connected and undirected graph, where each node corresponds to a pixel, and each edge connects a pair of adjacent pixels in the four-connected domain. The weight of each edge is the maximum of the RGB color differences between its adjacent pixels. As shown in Figure 4, it is easy to generate a minimum spanning tree from the undirected graph to connect all the pixels.
For any two pixels p and q , there is a unique path connecting them in the tree, and their distance D ( p , q ) on the tree is equal to the sum of the weights of all the edges on their path. Then, the support weight ω p , q between p and q can be expressed as
ω p , q = e x p ( D p , q σ )
where the parameter σ is used to adjust the support weight between two pixels. The kernel function k ( p , q ) of the minimum spanning tree filter can be expressed as
k p , q = ω ( p , q ) q I ω ( p , q )
It is worth noting that if pixels p and q are taken as two random variables, then ω p , q can be regarded as the joint probability of p and q , and the probability of p is equal to q I ω ( p , q ) . According to Bayes’ rule, the kernel function k p , q represents that the conditional probability of q under p is known.
For any pixel p , let C g l o b a l A p , d denote its filtering result with the minimum spanning tree filter in the d -th cost image, which is the weighted sum of the matching costs in the whole image:
C g l o b a l A p , d = q I k p , q C q , d = q I ω p , q C ( q , d ) q I ω ( p , q )
Here, we use the non-local cost aggregation method in [29] to quickly calculate the tree filtering results of all pixels at one time. It is assumed that S A ( p , d ) represents the molecule of C g l o b a l A p , d in Formula (11), i.e.,
S A p , d = q I ω p , q C ( q , d )
S A ( p , d ) for each pixel can be calculated at once by traversing the minimum spanning tree twice in turn, as shown in Figure 6. In the first traversal, the cost aggregation is performed by traversing from leaves to roots as shown in Figure 6a, and the temporary aggregation cost S A p , d of pixel p in this traversal can be calculated as follows:
S A p , d   = C p , d                                                      i f   p   i s   a   l e a f C p , d + q c h ( p ) ω p , q S A ( q , d )                  e l s e
where c h ( p ) is a set composed of all child nodes of pixel p .
In the second traversal, the cost aggregation is performed by traversing from the root to the leaves, as shown in Figure 6b. For the root node p , its final aggregation cost S A ( p , d ) can be calculated according to its father node p r ( p ) :
S A p , d = ω ( p r p , p ) S A ( p r p , d ) + ( 1 ω 2 p r p , p ) S A ( p , d )
Since the denominator of Formula (11) is a special case of the numerator with C ( q , d ) 1 , it can be quickly solved by the above same method. Therefore, it is only necessary to traverse the tree four times to calculate the tree filtering result C g l o b a l A ( p , d ) of pixel p .

3.2.3. Cost Volume Collaborative Filtering

For any pixel p , the collaborative filtering result C A ( p , d ) on the d -th cost image is equal to the average value of the filtering result C l o c a l A p , d of the adaptive weighted guided filter and the filtering result C g l o b a l A ( p , d ) of the minimum spanning tree filter, namely:
C A p , d = 1 2 ( C l o c a l A p , d + C g l o b a l A p , d )

3.3. Disparity Calculation and Disparity Refinement

In order to quickly calculate the disparity of each pixel, similar to other local optimization methods, this paper adopts the Winner-Takes-All (WTA) optimization method to obtain the optimal disparity of each pixel from the filtered cost volume C A ( p , d ) . As shown in Figure 7, for pixel p , the WTA method directly selects the disparity d p with its minimum filtering cost value from the disparity set D , and then d p   is chosen as the optimal disparity of pixel p , i.e.,
d p = argmin d D C A ( p , d )
The raw disparity map can be generated after the optimal disparity of each pixel is calculated according to the WTA method. Considering that the raw disparity maps contain some noise points and outliers whose disparities are invalid, the method proposed in [34] is used to refine the disparity. Firstly, the left–right consistency check operation is used to detect the outliers. Secondly, the scanline filling method is used to fill a valid disparity for each outlier. Finally, a fast weighted median filter is used to smooth the filled disparity map, and then the final disparity map can be obtained.

4. Experimental Results and Analysis

The stereo image dataset [10] provided by the Middlebury platform is used to verify the effectiveness of our proposed algorithm. The parameter settings of the proposed algorithm are shown in Table 1 and remain unchanged for all test images. The matching accuracy is measured by the error rate in the non-occluded regions, which is the percentage of mismatched pixels whose disparity error is greater than one pixel.

4.1. Evaluation of Cost Volume Filtering Method

In order to test the effectiveness of our cost volume filtering method, it is compared with the cost volume filtering methods in four state-of-the-art stereo matching algorithms (ISM [21], TF [28], CSGF [23] and GDGF [24]), and tested on 27 pairs of Middlebury stereo images in which objects contain various textures. First, the initial cost volume is generated with the matching cost calculation method in this paper, and it is used as the common input. Then, the above four cost volume filtering methods replace the proposed cost volume filtering method to generate their own raw disparity maps. Figure 8 shows the raw disparity maps of each cost volume filtering method, and the mismatched pixels are marked in red. Table 2 presents the error rates of different cost volume filtering methods on the raw disparity maps of each pair of stereo images.
It can be easily seen from Table 2 that our cost volume collaborative filtering method not only has the lowest average error rate, but also has the largest number of instances with the best results. Compared with the cost volume filtering methods of ISM, TF, CSGF, and GDGF, the average error rate of our cost volume cooperative filtering method is reduced by 1.55%, 3.41%, 1.14%, and 1.61%, respectively. From the quantitative results, the proposed cost volume collaborative filtering method is better than the other four cost volume filtering methods.
According to the visual comparison results in Figure 8, ISM and GDGF adopt fixed support windows, which cause a lot of matching errors in largely weak-texture regions. CSGF decreases the matching ambiguity in the weak-texture regions by using a multi-scale cost aggregation model. TF proposes a fast non-local cost aggregation approach with a minimum spanning tree from the whole image, and it can eliminate the matching ambiguity in the weak-texture regions well, but it may produce matching errors easily in the high-texture regions, e.g., the side of Wood2 in Figure 8. In contrast, by constructing a local adaptive cross-support window and a global image support window, our method can not only maintain the inherent connection between neighborhood pixels, but also capture more effective context information, so that it can eliminate the matching ambiguity in different texture regions.

4.2. Evaluation of the Overall Performance of the Stereo Matching Algorithm

To prove the overall matching performance of our stereo matching method, the final disparity maps generated by our stereo matching method are evaluated on the Middlebury dataset, and they are compared with the final matching results of the above four stereo matching algorithms, i.e., ISM, TF, CSGF, and GDGF. For each pair of stereo images, Table 3 shows the error rates of its final disparity maps generated by different stereo matching algorithms. As indicated in Table 3, the average error rate from our stereo matching method is 3.17%, which is 2.19%, 3.93%, 1.59%, and 2.36% lower than that of the ISM, TF, CSGF, and GDGF methods, respectively. We also find from Table 3 that our stereo matching method achieves better results than the other four methods on most stereo images.
Figure 9 shows the final disparity maps obtained by each matching method in which mismatched pixels are marked in red. We can see from the visual comparison in Figure 9, TF has the worst matching performance. This is mainly because TF destroys the original Markov structure of the reference image in the process of generating the tree, resulting in more mismatches in highly textured areas and depth discontinuities, e.g., the platform of Baby1 in Figure 5. Also, these disparity results cannot be improved even if they are refined by the post-processing operation. ISM, CSGF, and GDGF adopt local support windows and cannot effectively aggregate the matching cost within the context of each pixel, so they are unable to eliminate the matching ambiguity in largely weak-texture regions even after the disparity refinement operation, e.g., the yellow triangle area of Lampshade1 in Figure 9. We also find from the visual comparison that our stereo matching method adopts a local adaptive weighted guided filter and a global minimum spanning tree filter for the collaborative filtering of cost volume, which not only effectively eliminate the matching ambiguity in the weak-texture regions, but also maintain the disparity edge of each object well.
The final disparity maps obtained with our stereo matching method for six instances (i.e., Aloe, Cloth1, Bowling1, Rocks1, Moebius, and Reindeer) are shown in Figure 10. For each instance, from left to right are the reference images, the ground truth disparity maps, and the final disparity maps obtained with our method. As can be seen from Figure 10, the disparity maps obtained with our stereo matching method are very smooth and exceedingly close to the ground truth disparity maps. Accurate disparity results can be obtained in different texture regions, and the details such as edges in the disparity maps can also be well maintained.
In order to compare the running time of the above five stereo matching methods in the experiment, all of them are implemented on the same PC, and their experiment environment configuration is also kept the same, as shown in Table 4. The average runtime of each stereo matching method on the above 27 pairs of Middlebury stereo images are shown in Table 5.
As shown in Table 5, ISM has the longest average runtime, and the reason is that ISM cascades an iterative guided filter and bilateral filter to filter the cost volume, which leads to exceedingly high computational complexity. TF calculates the aggregation cost of all pixels at the same time by traversing a tree twice, which results in extremely fast computational speed. CSGF needs to filter multiple cost volumes of different scales, so its running time is also long. The running time of our method is slightly longer than that of GDGF. This is because the cost volume needs to be collaboratively filtered by the local filter and the global filter in the proposed method, but GDGF uses a single down-sampling gradient domain guided filter to smooth the cost volume. However, our stereo matching method has higher matching accuracy than the above four stereo matching methods and has stronger ability to eliminate the matching ambiguity.

5. Conclusions

In this paper, we propose a novel stereo matching method with collaborative filtering of cost volume in order to effectively eliminate the matching ambiguity in the matching process. Firstly, for each pixel, a local cross-support window is constructed to maintain the original connectivity with its neighboring pixels in the local window. On this basis, an adaptive weighted guided filter with the cross-support window as the kernel window is derived to smooth the cost volume. Secondly, a minimum spanning tree is constructed in the whole image window to capture more effective context information in a global manner. Then, a minimum spanning tree filter is derived that can filter the cost volume quickly. By embedding the local adaptive weighted guided filter into the global minimum spanning tree filter, we can achieve the collaborative filtering of the cost volume. As such, each pixel can not only receive the correct support from the neighboring pixels in its local adaptive support window, but also obtain effective support from other pixels in the whole image. The evaluation results show that the average matching error rate of our method on the Middlebury stereo images is 3.17%. The experimental results demonstrate that the proposed stereo matching method with collaborative filtering of cost volume can not only eliminate the matching ambiguity of different texture regions, but also better preserve the disparity edge. It is noteworthy that the initial cost volume constructed by some matching cost calculation methods has a direct impact on the collaborative filtering of cost volume and the disparity accuracy. In future work, we will consider more outstanding and robust matching cost calculation methods that can be adapted to various severe conditions such as low resolution, image distortion, illumination changes, and so on, and then integrate them into our stereo matching framework in order to further improve the robustness of stereo matching. Moreover, the proposed stereo method will be accelerated by CUDA implementations on GPU systems to achieve real-time performance. As such, our stereo method will be applied to the stereo vision system of intelligent robots to restore the depth information of the scene and lay a solid foundation for subsequent 3D object detection or 3D reconstruction.

Author Contributions

Conceptualization, W.W. (Wenhuan Wu); investigation, W.W. (Wenhuan Wu); methodology, W.W. (Wenhuan Wu); software, X.X. and W.W. (Wenshu Wang); supervision, W.W. (Wenhuan Wu); validation, X.X.; visualization, H.Z.; writing—original draft preparation, W.W. (Wenhuan Wu) and X.X.; writing—review and editing, W.W. (Wenshu Wang) and H.Z.; funding acquisition, W.W. (Wenhuan Wu). All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Natural Science Foundation of Hubei Province (NO.2022CFB538), China; by Theme Case Project of the Degree and Graduate Education Development Center of the Ministry of Education (NO. ZT-231052501), China; by Ph.D. Research Startup Foundation Project of Hubei University of Automotive Technology (NO. BK202347), China.

Data Availability Statement

The datasets used in this study were sourced from Middlebury Stereo Datasets at https://vision.middlebury.edu/stereo/data/ (accessed on 5 February 2024).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Shi, Y.; Guo, Y.; Mi, Z.; Li, X. Stereo CenterNet-based 3D object detection for autonomous driving. Neurocomputing 2022, 471, 219–229. [Google Scholar] [CrossRef]
  2. Cui, J.; Min, C.; Feng, D. Research on pose estimation for stereo vision measurement system by an improved method: Uncertainty weighted stereopsis pose solution method based on projection vector. Opt. Express 2020, 28, 5470–5491. [Google Scholar] [CrossRef] [PubMed]
  3. Tian, X.; Liu, R.; Wang, Z.; Ma, J. High quality 3D reconstruction based on fusion of polarization imaging and binocular stereo vision. Inf. Fusion 2022, 77, 19–28. [Google Scholar] [CrossRef]
  4. Li, Y.; Zheng, S.; Wang, X.; Ma, H. An efficient photogrammetric stereo matching method for high-resolution images. Comput. Geosci. 2016, 97, 58–66. [Google Scholar] [CrossRef]
  5. Taniai, T.; Matsushita, Y.; Sato, Y.; Naemura, T. Continuous 3D label stereo matching using local expansion moves. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 40, 2725–2739. [Google Scholar] [CrossRef] [PubMed]
  6. Xu, Y.; Yu, D.; Ma, Y.; Li, Q.; Zhou, Y. Underwater stereo-matching algorithm based on belief propagation. Signal Image Video Process. 2022, 17, 891–897. [Google Scholar] [CrossRef]
  7. Yao, P.; Zhang, H.; Xue, Y.; Chen, S. As-global-as-possible stereo matching with adaptive smoothness prior. IET Image Process. 2019, 13, 98–107. [Google Scholar] [CrossRef]
  8. Scharstein, D.; Szeliski, R. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. Int. J. Comput. Vis. 2002, 47, 7–42. [Google Scholar] [CrossRef]
  9. Laga, H.; Jospin, L.V.; Boussaid, F.; Bennamoun, M. A survey on deep learning techniques for stereo-based depth estimation. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 44, 1738–1764. [Google Scholar] [CrossRef]
  10. Scharstein, D.; Szeliski, R. Middlebury Stereo Datasets. [Online]. Available online: https://vision.middlebury.edu/stereo/data/ (accessed on 5 February 2024).
  11. Yang, S.; Lei, X.; Liu, Z.; Sui, G. An efficient local stereo matching method based on an adaptive exponentially weighted moving average filter in SLIC space. IET Image Process. 2021, 15, 1722–1732. [Google Scholar] [CrossRef]
  12. Tatar, N.; Arefi, H.; Hahn, M. High-resolution satellite stereo matching by object-based semiglobal matching and iterative guided edge-preserving filter. IEEE Geosci. Remote Sens. Lett. 2020, 18, 1841–1845. [Google Scholar] [CrossRef]
  13. Zhang, K.; Lu, J.; Lafruit, G. Cross-based local stereo matching using orthogonal integral images. IEEE Trans. Circuits Syst. Video Technol. 2009, 19, 1073–1079. [Google Scholar] [CrossRef]
  14. Yoon, K.J.; Kweon, I.S. Adaptive support-weight approach for correspondence search. IEEE Trans. Pattern Anal. Mach. Intell. 2006, 28, 650–656. [Google Scholar] [CrossRef] [PubMed]
  15. Richardt, C.; Orr, D.; Davies, I.; Criminisi, A.; Dodgson, N.A. Real-time spatiotemporal stereo matching using the dual-cross-bilateral grid. In Proceedings of the 11th European Conference on Computer Vision, Hersonissos, Greece, 5–11 September 2010; pp. 510–523. [Google Scholar]
  16. Yang, Q. Hardware-efficient bilateral filtering for stereo matching. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 36, 1026–1032. [Google Scholar] [CrossRef] [PubMed]
  17. He, K.; Sun, J.; Tang, X. Guided image filtering. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 1397–1409. [Google Scholar] [CrossRef] [PubMed]
  18. Hosni, A.; Rhemann, C.; Bleyer, M.; Rother, C.; Gelautz, M. Fast cost-volume filtering for visual correspondence and beyond. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 504–511. [Google Scholar] [CrossRef] [PubMed]
  19. Yang, Q.; Ji, P.; Li, D.; Yao, S.; Zhang, M. Fast stereo matching using adaptive guided filtering. Image Vis. Comput. 2014, 32, 202–211. [Google Scholar] [CrossRef]
  20. Lu, J.; Shi, K.; Min, D.; Lin, L.; Do, M.N. Cross-based local multipoint filtering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, 16–21 June 2012; pp. 430–437. [Google Scholar]
  21. Hamzah, R.A.; Kadmin, A.F.; Hamid, M.S.; Ghani, S.F.A.; Ibrahim, H. Improvement of stereo matching algorithm for 3D surface reconstruction. Signal Process. Image Commun. 2018, 65, 165–172. [Google Scholar] [CrossRef]
  22. Hamzah, R.A.; Ibrahim, H.; Hassan, A.H.A. Stereo matching algorithm based on per pixel difference adjustment, iterative guided filter and graph segmentation. J. Vis. Commun. Image Represent. 2017, 42, 145–160. [Google Scholar] [CrossRef]
  23. Zhang, K.; Fang, Y.; Min, D.; Sun, L.; Yang, S.; Yan, S.; Tian, Q. Cross-Scale Cost Aggregation for Stereo Matching. IEEE Trans. Circuits Syst. Video Technol. 2017, 27, 965–976. [Google Scholar] [CrossRef]
  24. Yuan, W.; Meng, C.; Tong, X.; Li, Z. Efficient local stereo matching algorithm based on fast gradient domain guided image filtering. Signal Process. Image Commun. 2021, 95, 116280. [Google Scholar] [CrossRef]
  25. Fan, S.; Sun, W.; Zheng, J.; Fu, Q.; Xue, M.; Wu, W. Accurate edge-preserving stereo matching by enhancing anisotropy. Signal Process. Image Commun. 2023, 114, 116945. [Google Scholar] [CrossRef]
  26. Cigla, C. Recursive edge-aware filters for stereo matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, Boston, MA, USA, 7–12 June 2015; pp. 27–34. [Google Scholar]
  27. Pham, C.C.; Jeon, J.W. Domain transformation-based efficient cost aggregation for local stereo matching. IEEE Trans. Circuits Syst. Video Technol. 2012, 23, 1119–1130. [Google Scholar] [CrossRef]
  28. Yang, Q. Stereo matching using tree filtering. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 834–846. [Google Scholar] [CrossRef] [PubMed]
  29. Yang, Q. A non-local cost aggregation method for stereo matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, 16–21 June 2012; pp. 1402–1409. [Google Scholar]
  30. Mei, X.; Sun, X.; Dong, W.; Wang, H.; Zhang, X. Segment-tree based cost aggregation for stereo matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Portland, OR, USA, 23–28 June 2013; pp. 313–320. [Google Scholar]
  31. Cheng, F.; Zhang, H.; Sun, M.; Yuan, D. Cross-trees, edge and superpixel priors-based cost aggregation for stereo matching. Pattern Recognit. 2015, 48, 2269–2278. [Google Scholar] [CrossRef]
  32. Hirschmuller, H.; Scharstein, D. Evaluation of cost functions for stereo matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Minneapolis, MN, USA, 17–22 June 2007; pp. 1–8. [Google Scholar]
  33. Li, Z.; Zheng, J.; Zhu, Z.; Yao, W.; Wu, S. Weighted guided image filtering. IEEE Trans. Image Process. 2015, 24, 120–129. [Google Scholar]
  34. Wu, W.; Zhu, H.; Yu, S.; Shi, J. Stereo matching with fusing adaptive support weights. IEEE Access 2019, 7, 61960–61974. [Google Scholar] [CrossRef]
Figure 2. Schematic flow diagram of the proposed algorithm.
Figure 2. Schematic flow diagram of the proposed algorithm.
Electronics 13 03095 g002
Figure 3. The initial cost volume C and the filtered cost volume C A . (a) Initial cost volume C ; (b) filtered cost volume C A .
Figure 3. The initial cost volume C and the filtered cost volume C A . (a) Initial cost volume C ; (b) filtered cost volume C A .
Electronics 13 03095 g003
Figure 4. Local adaptive support window and global image window.
Figure 4. Local adaptive support window and global image window.
Electronics 13 03095 g004
Figure 5. Four arms of pixel p and its cross-support window W p .
Figure 5. Four arms of pixel p and its cross-support window W p .
Electronics 13 03095 g005
Figure 6. Two traversals on the tree. (a) From the leaves to the root; (b) from the root to the leaves.
Figure 6. Two traversals on the tree. (a) From the leaves to the root; (b) from the root to the leaves.
Electronics 13 03095 g006
Figure 7. Winer-Takes-All optimization algorithm.
Figure 7. Winer-Takes-All optimization algorithm.
Electronics 13 03095 g007
Figure 8. The raw disparity maps of Lampshade2 and Wood1 generated by different cost volume filtering methods. (a) Reference image; (b) ISM [21]; (c) TF [28]; (d) CSGF [23]; (e) GDGF [24]; (f) proposed.
Figure 8. The raw disparity maps of Lampshade2 and Wood1 generated by different cost volume filtering methods. (a) Reference image; (b) ISM [21]; (c) TF [28]; (d) CSGF [23]; (e) GDGF [24]; (f) proposed.
Electronics 13 03095 g008
Figure 9. The final disparity maps of Baby1 and Lampshade1 generated by different stereo matching methods. (a) Reference image; (b) ISM [21]; (c) TF [28]; (d) CSGF [23]; (e) GDGF [24]; (f) proposed.
Figure 9. The final disparity maps of Baby1 and Lampshade1 generated by different stereo matching methods. (a) Reference image; (b) ISM [21]; (c) TF [28]; (d) CSGF [23]; (e) GDGF [24]; (f) proposed.
Electronics 13 03095 g009
Figure 10. The ground truth disparity maps and the final disparity maps obtained with our method. (a) Aloe; (b) Cloth1; (c) Bowling1; (d) Rocks1; (e) Moebius; (f) Reindeer.
Figure 10. The ground truth disparity maps and the final disparity maps obtained with our method. (a) Aloe; (b) Cloth1; (c) Bowling1; (d) Rocks1; (e) Moebius; (f) Reindeer.
Electronics 13 03095 g010
Table 1. The parameter settings of the proposed method.
Table 1. The parameter settings of the proposed method.
ParameterValueDescription
N p 5   ×   7The window size of the census transform
L m i n 3The minimum length of the arms of each pixel
L m a x 15The maximum length of the arms of each pixel
τ 6The threshold of color distance for detecting each arm
ε 10 4 The regularization parameter in the adaptive weighted guided filter
σ 0.03The parameter for adjusting the support weight between two pixels
Table 2. Comparison of different cost volume filtering methods.
Table 2. Comparison of different cost volume filtering methods.
DataISM [21]TF [28]CSGF [23]GDGF [24]Proposed
Aloe5.915.966.246.924.14
Art12.1312.4111.6012.019.86
Baby12.897.533.153.302.31
Baby23.6814.043.793.553.81
Baby34.017.944.634.704.09
Books9.8611.059.539.748.54
Bowling16.0216.975.675.885.12
Bowling26.9812.227.847.185.13
Cloth11.020.981.681.790.51
Cloth22.854.503.764.121.68
Cloth32.282.512.442.761.70
Cloth41.891.942.042.441.39
Dolls6.616.986.496.744.54
Flowerpots9.4516.229.349.338.29
Lampshade114.8211.0010.3012.367.08
Lampshade216.8412.6611.0114.016.12
Laundry18.6317.4216.3819.2217.13
Moebius10.1010.7610.209.697.97
Reindeer6.7811.227.167.606.43
Rocks13.253.523.433.441.89
Rocks22.262.872.402.531.66
Wood14.2510.554.265.782.72
Wood22.105.732.532.322.43
Tsukuba5.544.473.664.455.28
Venus1.681.951.661.491.57
Teddy8.437.327.917.977.50
Cones4.254.004.274.633.82
Avg (%)6.468.326.056.524.91
The best results are shown in bold among all methods.
Table 3. Comparison of different stereo algorithms.
Table 3. Comparison of different stereo algorithms.
DataISM [21]TF [28]CSGF [23]GDGF [24]Proposed
Aloe4.764.945.186.082.93
Art9.3410.418.839.477.36
Baby13.238.542.983.491.57
Baby22.3315.492.332.502.96
Baby33.914.103.303.922.05
Books8.449.607.558.966.89
Bowling111.6820.809.3010.953.23
Bowling24.8811.064.745.434.04
Cloth10.440.480.840.930.14
Cloth22.183.972.963.321.20
Cloth31.681.911.902.100.92
Cloth41.371.231.501.630.63
Dolls4.456.424.525.223.46
Flowerpots9.7915.268.289.735.18
Lampshade19.5011.366.728.702.79
Lampshade219.1710.7116.3617.422.86
Laundry13.0710.9610.3112.3311.56
Moebius9.587.978.298.705.27
Reindeer3.818.574.285.492.93
Rocks12.932.702.712.961.35
Rocks21.272.071.351.501.14
Wood13.5410.173.285.081.37
Wood20.341.470.320.320.37
Tsukuba2.091.521.911.974.07
Venus0.170.420.180.180.38
Teddy7.376.346.047.525.93
Cones3.343.222.793.273.09
Avg (%)5.367.104.765.533.17
The best results are shown in bold among all methods.
Table 4. The experiment environment configuration.
Table 4. The experiment environment configuration.
CPUMemoryOperating SystemProgramming Language
Intel(R) Core (TM) i7-1075016 GBWindows10 (64 bit)C++ and OpenCV
Table 5. The runtime comparison of different stereo matching methods.
Table 5. The runtime comparison of different stereo matching methods.
ISM [21]TF [28]CSGF [23]GDGF [24]Proposed
Avg (s)36.171.509.444.057.51
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wu, W.; Xu, X.; Wang, W.; Zhang, H. Stereo Matching Method with Cost Volume Collaborative Filtering. Electronics 2024, 13, 3095. https://doi.org/10.3390/electronics13153095

AMA Style

Wu W, Xu X, Wang W, Zhang H. Stereo Matching Method with Cost Volume Collaborative Filtering. Electronics. 2024; 13(15):3095. https://doi.org/10.3390/electronics13153095

Chicago/Turabian Style

Wu, Wenhuan, Xi Xu, Wenshu Wang, and Haokun Zhang. 2024. "Stereo Matching Method with Cost Volume Collaborative Filtering" Electronics 13, no. 15: 3095. https://doi.org/10.3390/electronics13153095

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop