# Local Stereo Matching Using Adaptive Cross-Region-Based Guided Image Filtering with Orthogonal Weights

Authors: Lingyin Kong; Jiangping Zhu; Sancong Ying
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Adaptive cross-region-based guided image filtering (ACR-GIF) is a commonly used cost aggregation method. However, the weights of points in the adaptive cross-region (ACR) are generally not considered, which affects the accuracy of disparity results. In this study, we propose an improved cost aggregation method to address this issue. First, the orthogonal weight is proposed according to the structural feature of the ACR, and then the orthogonal weight of each point in the ACR is computed. Second, the matching cost volume is filtered using ACR-GIF with orthogonal weights (ACR-GIF-OW). In order to reduce the computing time of the proposed method, an efficient weighted aggregation computing method based on orthogonal weights is proposed. Additionally, by combining ACR-GIF-OW with our recently proposed matching cost computation method and disparity refinement method, a local stereo matching algorithm is proposed as well. The results of Middlebury evaluation platform show that, compared with ACR-GIF, the proposed cost aggregation method can significantly improve the disparity accuracy with less additional time overhead, and the performance of the proposed stereo matching algorithm outperforms other state-of-the-art local and nonlocal algorithms.


---

## Body

## 1. Introduction

Binocular stereo vision can acquire disparity information with required accuracy only by using image pairs of the same scene that are obtained from different angles. It is widely applied in three-dimensional reconstruction [1], three-dimensional measurement [2], robot vision [3], unmanned driving [4], and so on. The purpose of stereo matching is to find corresponding points in a pair of images. The accuracy tends to affect the precision of disparity results. So, it is a critical procedure in binocular stereo vision systems and is a topic of significant research interest in the field of computer vision.Currently, stereo matching algorithms are mainly divided into two categories. The first category is based on deep learning. In particular, algorithms based on convolutional neural networks (CNNs) have developed rapidly in recent years. Žbontar and LeCun [5] proposed an algorithm that utilizes the Siamese network to compute the matching cost. Pairs of small image patches were used to train the network to determine the similarities among the patches. Pang et al. [6] proposed a cascade residual learning network divided into two stages, where each stage independently calculates disparity maps and multiscale residual signals. Chang et al. proposed a pyramid stereo matching network [7] comprising a spatial pyramid pooling module and a 3D CNN module. Kunal Swami et al. [8] proposed an end-to-end network model to utilize rich multiscale context information, which most existing methods cannot achieve. A large effective receiving domain is implemented to extract multiscale context information, while retaining the required spatial information in the entire network. Kim et al. [9] proposed a network architecture that uses both the matching cost volume and disparity map as inputs. Their architecture contains two subnetworks, namely, the matching probability construction network and the confidence estimation network. Such methods achieve high matching accuracy, but ground truth disparity maps are required in advance, especially for end-to-end network models.The second category is conventional algorithms. These conventional algorithms can be classified as global, semiglobal, and local algorithms. Global algorithms usually obtain disparities by solving the minimum value of the global energy functions, including graph cuts [10] and belief propagation [11]. They are characterized by high matching accuracy and low computing efficiency. The first semiglobal algorithm was proposed by Hirschmüller [12], which mainly used the idea of dynamic programming. The matching accuracy and computing efficiency of semiglobal algorithms lie between those of global and local algorithms. Local algorithms are based on cost aggregation within the specified support region, and the matching accuracy is usually lower than those of the first two types. However, the computing efficiency is higher. Such algorithms generally employ the following four steps [13]: matching cost computation, cost aggregation, disparity computation, and disparity refinement.Cost aggregation refers to summing or averaging the matching cost in the support region of each pixel, which directly influences the computing efficiency and accuracy of the algorithm. It is one of the most important steps and also the primary focus of many studies. Filtering-based cost aggregation methods are currently adopted by most local algorithms, in which cost aggregation is interpreted as the filtering of the matching cost volume. Compared with other filtering methods, guided image filtering (GIF) [14] is usually the preferred approach, owing to its superior filtering effect and computational efficiency.Hosni et al. [15] were the first to apply GIF to cost aggregation, achieving good results. Various cost aggregation methods have been proposed on the basis of this approach. Based on weighting GIF [16], Hong et al. [17] proposed a cost volume filtering method, in which the adaptive weight based on the local variance is used to control linear coefficients according to local texture features; this yields better performance. Kordelas et al. [18] proposed a content-based GIF, in which two rectangular support regions with different sizes are employed. The support region was selected according to the texture homogeneity of the local area around the pixels. In order to improve the accuracy of object edges and areas with discontinuous disparities in images and to reduce the noise in the matching targets, Hamzah et al. [19] proposed an adaptive support weight based on iterative GIF. Moreover, Wu et al. [20] proposed a strategy to fuse GIF and MST (minimum spanning tree) filter, which embedded the local support region-based GIF into the MST filter based on the whole image; it improved robustness of textureless and highly textured regions. Zhu et al. [21] introduced the weight into the energy function of GIF, thus considering the entire image as a support region. This resulted in better matching accuracy.Adaptive cross-region-based guided image filtering (ACR-GIF) is a cost aggregation method adopted by many local stereo matching algorithms currently [22–26]. However, the weights of points in the adaptive cross-region [27] (ACR) are generally not taken into account, which affects the accuracy of results. The main contributions of this paper to address this issue are summarized as follows:(1)
An improved cost aggregation method is proposed. Firstly, according to the structural characteristic of the ACR, the orthogonal weight is proposed, and then the matching cost volume is filtered using ACR-GIF with orthogonal weights (ACR-GIF-OW).(2)
In order to improve the computational efficiency of the proposed method, an efficient weighted aggregation computing method based on orthogonal weights is proposed.(3)
Combining ACR-GIF-OW with our recently proposed matching cost computation and disparity refinement methods, a local stereo matching algorithm is proposed.The main contributions of this paper are different from our previous paper [28]. In the previous paper, our work focused on matching cost computation and disparity refinement, so a gradient calculation method and a multistep refinement method based on ACR were proposed. However, the main contributions of this paper are mainly related to cost aggregation as mentioned above.The remainder of this paper is structured as follows. The related work using ACR-GIF is discussed inSection 2. The proposed stereo matching algorithm using ACR-GIF-OW is described in Section 3. Experimental results and discussions are presented in Section 4 and finally, Section 5 concludes this paper.


## 2. Related Work

In this section, we discuss cost aggregation methods using ACR-GIF as they are more relevant to our proposed approach. GIF is analyzed first since ACR-GIF is an improved version of GIF.GIF utilizes support regions with fixed shapes and sizes. As a result, the matching accuracy of textureless areas or regions with discontinuous disparities in images is affected. Therefore, it has become imperative to acquire adaptive support regions according to different regions and structures in images.Due to its simple implementation and high computing efficiency, many local stereo matching algorithms use the ACR as the support region. Yang et al. [22] established the rectangular ACR where the boundary is determined by the endpoint of the support arm, and the endpoint is the spot where the color difference exceeds the threshold and is closest to the center pixel in the given direction. This approach ensures that most pixels in the support region are similar to the center pixel. Zhu et al. [23] adopted both color difference and distance as conditions in constructing the rectangular ACR. The support arm extends when both conditions are met. This method can effectively reduce outliers from occluded regions or areas with discontinuous depths in the support region.In addition to the rectangular ACR, the arbitrary-shaped ACR has also been commonly employed. Xu et al. [24] used the arbitrary-shaped ACR-based GIF, where the length of the support arm is determined by the color similarity of RGB channels. Zhu et al. [25] added an exponential threshold to the decision rule for arm length in order to process textureless regions; subsequently, they proposed an adaptive threshold using image variance to address the issue of the support region not being constructed in the same image structure when the brightness changes. Furthermore, in order to improve the accuracy of textureless regions, Yan et al. [26] proposed a decision rule for arm length by using dual constraint linear variable thresholds to construct the arbitrary-shaped ACR.The above works all put emphasis on how to construct the ACR; the weight of each point in the ACR is not considered. Different from them, our method takes the orthogonal weight of each point in the ACR into consideration.


## 3. The Proposed Algorithm

The stereo matching algorithm proposed in this paper mainly includes five steps: (1) input image preprocessing, (2) matching cost computation, (3) cost aggregation using ACR-GIF-OW, (4) disparity computation, and (5) disparity refinement. A flowchart of the proposed algorithm is shown in Figure1. Each step is detailed in the following sections.Figure 1
Flowchart of the proposed algorithm.


### 3.1. Input Image Preprocessing

Since guided images are required in matching cost computation, it is necessary to preprocess the rectified input image. GIF has edge-preserving feature and good smoothing effect, and the computation time is independent of the size of the support region. Hence, guided images are obtained by using GIF.


### 3.2. Matching Cost Computation

To render the model more robust and achieve more accurate results, we adopt a matching cost computation method that combines the absolute differences (AD), census transformation [29], and the gradient.AD is computed by using information on RGB channels according to the following equation:(1)CADm,d=13∑c∈R,G,BILeftm,c−IRightn,c,where ILeftm,c is the value of point mxm,ym on the channel c of the left image and IRightn,c is the value of the corresponding point nxm−d,ym on the channel c of the right image, when the disparity is d.Census transformation firstly compares the gray value of the center point with those of other points in the window and utilizes 0 or 1 to represent the result; then, the results are linked to form a binary bit string. This can be formulated as(2)Scen=⊗i∈WkξIk,Ii,ξIk,Ii=1,Ik>Ii,0,otherwise.Here,⊗ represents a bitwise connection operation, Wk is the window centered on the point k, i is an arbitrary point in Wk, and Ii and Ik are gray values of points i and k, respectively.Subsequently, the Hamming distance of binary bit strings between corresponding points is computed to measure the similarity between them. We assume thatScenLm is the binary bit string of point m in the left image and ScenRn is the binary bit string of the corresponding point n in the right image when the disparity is d. The Hamming distance between m and n can be expressed as(3)Ccenm,d=HammingScenLm,ScenRn.The gradient is calculated by our recently proposed method [28]. It combines the RGB gradient of the input image and the guided image to compute the gradient in x and y directions, respectively. The expressions are as follows:(4)Cgxm,d=13∑c∈R,G,BgxLeftIm,c−gxRightIn,c+gxLeftGm,c−gxRightGn,c,Cgym,d=13∑c∈R,G,BgyLeftIm,c−gyRightIn,c+gyLeftGm,c−gyRightGn,c,where gx and gy represent the gradient in x and y directions, respectively. The superscripts I and G, respectively, represent the input image and the guided image.By weighted fusion of the above-mentioned approaches, the matching cost computation function is acquired as follows:(5)Cm,d=4−exp−CADm,dλAD−exp−Ccenm,dλcen−exp−Cgxm,dλgx−exp−Cgym,dλgy.Here,λAD, λcen, λgx, and λgy are the weight of AD, census transformation, the gradient in x direction, and the gradient in y direction, respectively; CAD, Ccen, Cgx, and Cgy are the matching cost of the corresponding approach.


### 3.3. Cost Aggregation Using ACR-GIF-OW

#### 3.3.1. ACR Construction

Points with similar color in the support region may arise from the same structure of the image; thus, these points have similar disparity [27]. In order to ensure that only points with similar color are included in the support region, the ACR is adopted. Double thresholds of the distance and color difference are used to restrict the arm length [30]. The decision rules are as follows:(1)
Dcp,pe<C1 and Dcpe,pn<C1(2)
Ddp,pe<L1(3)
IfL2<Ddp,pe<L1, Dcp,pe<C2 and Dcpe,pn<C2pe is an arbitrary point on the support arm with center point p, pn is the point preceding pe in the direction of the support arm, and Dcp,pe=maxc∈R,G,BIcp−Icpe, Ddp,pe=p−pe. C1, C2, L1, and L2 are thresholds, and C2<C1 and L2<L1.When the above rules are fulfilled, the center point is considered to be the starting point that expands in four directions, and the expansion stops when one of the decision rules is not satisfied. The ACRRp can be expressed as the union of all horizontal support arms Hq, whose center point q is on the vertical support arm of point p, as shown in Figure 2.Figure 2
Schematic view of the ACR.


#### 3.3.2. The Orthogonal Weight Calculation

According to the construction process and structural feature of the ACR, we detect a horizontal path at first and then a vertical one when observed from any point to the center point. Therefore, the weight of each point relative to the center point can be computed by multiplying the weight between the adjacent points on the path [31]. Since the weight can be decomposed into two parts (the horizontal weight and the vertical weight), we name it as the orthogonal weight, as shown in Figure 3.Figure 3
Schematic of the orthogonal weight.Here,qi,j is an arbitrary point in the Rp, px,y is the center point, and HWj,y and VWi,x represent the horizontal and vertical weights of point q relative to point p, respectively.The orthogonal weight can be computed by multiplying the horizontal and vertical weights, and thus, the orthogonal weight ofq can be expressed as(6)Wq,p=HWj,y⋅VWi,x.To obtain the calculations associated withHWj,y and VWi,x conveniently, we construct the weight matrix of horizontal adjacent points, WH, and the weight matrix of vertical adjacent points, WV. The information on RGB channels is used to compute the weights of adjacent points, as shown in the following formulae:(7)WHx,y=f∑c∈R,G,BIch,w−Ich,w+1,(8)WVx,y=f∑c∈R,G,BIch,w−Ich+1,w,where h and w, respectively, represent the row and column indices of image I. The expression of function ft in equations (7) and (8) is shown as follows:(9)ft=1,t<δ,exp1γ,t≥δ,where parameters δ and γ are constants. The purpose of introducing function ft is to avoid the problem that when there is a significant local difference in the intensity between adjacent pixels on the path, information tends to get lost [21].After calculating the matricesWH and WV, the horizontal and vertical weights of q can be computed as follows:(10)HWj,y=∏k=minj,ymaxj,y−1WHi,k,j≠y,1,j=y,(11)VWi,x=∏k=mini,xmaxi,x−1WVk,y,i≠x,1,i=x.According to equation (10), another recursive form of computing the horizontal weight is formulated as(12)HWj,y=WHi,j⋅HWj+1,y,y−j>1,WHi,y−1,y−j=1.Similarly, according to equation (11), another recursive form of computing the vertical weight is formulated as(13)VWi,x=WVi,y⋅VWi+1,x,x−i>1,WVx−1,y,x−i=1.According to equations (12) and (13), HWj,y and VWi,x can be computed from the center point in both directions, such that the weight of the previous point can be utilized, and only one multiplication is required in each computation.


#### 3.3.3. The Weighted Aggregation Computing Method

On the basis of the discussion inSection 3.3.2 and inspired by the orthogonal integral image [27], we propose a weighted aggregation computing method based on orthogonal weights. Based on the feature that the orthogonal weight can be decomposed; the process of weighted aggregation is decomposed into two orthogonal directions of one-dimensional weighted aggregation as follows:(1)
The weighted sum of the horizontal support arm for each point is computed. To improve the computing efficiency for any pointri,j in the image, the weighted sum of the left and right support arms is separately computed as follows:(14)WSLi,j=∑k=beg_hjHWk,j⋅imgi,k=∑k=beg_hj−1HWk,j⋅imgi,k+imgi,j,WSRi,j=∑k=jend_hHWk,j⋅imgi,k=∑k=j+1end_hHWk,j⋅imgi,k+imgi,j,whereWSLi,j and WSRi,j are the weighted sum of the left and right support arms of point r, respectively; beg_h and end_h are the beginning and ending positions of the horizontal support arm for point r, respectively; img is a single-channel image. For RGB images, one of the channels is selected according to the need for calculation.(2)
The weighted sum of the horizontal support arm for pointr is computed and stored in WSHas follows:(15)WSHi,j=WSLi,j+WSRi,j−imgi,j.(3)
Based onWSH, the weighted sum of the vertical support arm for each point is computed. Similarly, to improve the computing efficiency, the weighted sum of the up and bottom support arms for the center point px,y is, respectively, computed as follows:(16)WSUx,y=∑k=beg_vxVWk,x⋅WSHk,y=∑k=beg_vx−1VWk,x⋅WSHk,y+WSHx,y,WSDx,y=∑k=xend_vVWk,x⋅WSHk,y=∑k=x+1end_vVWk,x⋅WSHk,y+WSHx,y.Here,WSUx,y and WSDx,y are the weighted sum of the up and bottom support arms for point p, respectively; beg_v and end_v are the beginning and ending positions of the vertical support arm for point p, respectively.(4)
The weighted aggregation result of the ACR centered at pointp is obtained as follows:(17)WACRx,y=WSUx,y+WSDx,y−WSHx,y.


#### 3.3.4. ACR-GIF-OW

On the basis of the computing method described inSection 3.3.3, we adopt ACR-GIF-OW as the cost aggregation method. Since the color image has more obvious edge protection effects [14], we select the color image as the guidance image. We denote the guidance image as I and the filtering input image as the matching cost volume C. The linear model coefficients ap and bp can be acquired by minimizing the weighted local energy function that is formulated as(18)Eap,bp=∑q∈RpWq,p⋅ap⋅Iq+bp−Cq,d2+ε⋅ap2,where Rp is the ACR centered at pixel p, ε is a regularization parameter, and Wq,p is the orthogonal weight of point q defined in equation (6).The solution to this equation is given as(19)ap=∑p+εU−11∑q∈RpWp,q∑q∈RpWp,q⋅Iq⋅Cq,d−μp⋅C¯p=∑p+εU−11∑q∈RpWp,q∑q∈RpWp,q⋅IRq⋅Cq,d−μpR⋅C¯p1∑q∈RpWp,q∑q∈RpWp,q⋅IGq⋅Cq,d−μpG⋅C¯p1∑q∈RpWp,q∑q∈RpWp,q⋅IBq⋅Cq,d−μpB⋅C¯p,bp=C¯p−apTμp=C¯p−apT⋅μpRμpGμpB.Here,μpc=∑q∈RpWp,q⋅Icq/∑q∈RpWp,qc∈R,G,B, C¯p=∑q∈RpWp,q⋅Cq,d/∑q∈RpWp,q, ∑p is the 3×3 covariance matrix of I in Rp, and U is an 3×3 identity matrix.The linear model is then used to compute the filtered result, which is also the result of cost aggregation, as shown as follows:(20)CAq,d=a¯qTIq+b¯q,where a¯q=1/∑p∈RqWp,q∑p∈Rqap, b¯q=1/∑p∈RqWp,q∑p∈Rqbp, and CA is the matching cost volume after cost aggregation.The comparison of results after cost aggregation using ACR-GIF [28] without/with orthogonal weights is shown in Figure 4.Figure 4
Comparison of results after cost aggregation. (a) Using ACR-GIF without orthogonal weights. (b) Using ACR-GIF with orthogonal weights.
(a)(b)


### 3.4. Disparity Computation

We use the winner-take-all strategy [13] for the disparity computation, in which the disparity corresponding to the minimum matching cost of each point in CA is selected as the initial disparity. The expression is given by(21)dinim=argmin0≤d≤dmaxCAm,d.Here,dinim is the initial disparity of point m.


### 3.5. Disparity Refinement

There are many outliers in the initial disparity map that need to be detected and corrected by disparity refinement. In this study, a multistep refinement method [28] proposed by us recently is adopted, and each step has been elucidated in the following sections.


#### 3.5.1. Left-Right Consistency Check and Outlier’s Classification

The left-right consistency check judges whether the disparities of two points satisfy the condition given in the following equation:(22)diniLx0,y0−diniRx0−diniLx0,y0,y0≤1,where diniL and diniR represent the initial disparity map of the left and right images, respectively; x0 and y0 are the point indices.Subsequently, the detected outliers are divided into two classes: one has the corresponding point in the right image, and the other does not exist the corresponding point in the right image. The first class is called the corresponding outlier, and the second is called the no-corresponding outlier. The steps described below correct the two classes separately.


#### 3.5.2. ACR Voting

To replace the disparities of outliers with that of reliable points, we first use ACR voting, in which the total number of votes of reliable points and the highest number of votes among different disparities are counted. We then consider the following conditions:(23)NT>N,(24)NmaxNT>P.Here,NT is the total number of votes, Nmax is the highest number of votes among different disparities, and N and P are thresholds. If both equations (23) and (24) are satisfied, the disparity corresponding to the highest number of votes is used to replace the outlier’s disparity. Meanwhile, the outlier is marked as reliable. In order to deal with as many outliers as possible, this step is iterated five times.


#### 3.5.3. ACR Four-Direction Propagation Interpolation

For corresponding outliers, the nearest reliable points are found in their own ACR along the directions of the four support arms. The corresponding disparities are separately marked asdRL, dRR, dRU, and dRD. Then, the disparities of these outliers are replaced by equation (25), and they are marked as reliable points.(25)dR=dhmin,ifdRLanddRRexisting,dvmin,ifdRUanddRDexisting,dhmin+dvmin2,ifdhmin−dvmin≤2,not changed,otherwise.Here,dhmin=mindRL,dRR and dvmin=mindRU,dRD. For dealing with as many outliers as possible, this step is iterated three times.


#### 3.5.4. Two-Direction Propagation Interpolation

For remaining corresponding outliers, the nearest reliable points are found along the left and right directions, and the corresponding disparities are recorded asdl and dr, respectively. Then, the disparities of these outliers are replaced by equation (26), and they are marked as reliable points.(26)dR=dhmin,ifdlanddrexisting,not changed,otherwise.Here,dhmin=mindl,dr.


#### 3.5.5. No-Corresponding Outliers Interpolation

After the above-mentioned steps, the remaining outliers are mainly no-corresponding outliers. Since such outliers usually appear in the leftmost area of the image, we use one-direction propagation interpolation; that is, the nearest reliable point is found along the right side of the outlier. The disparity of the outlier is then replaced and the outlier is marked as reliable.


#### 3.5.6. Subpixel Refinement

To reduce the error caused by disparity discontinuity, an approach based on quadratic polynomial interpolation is used for subpixel refinement as follows:(27)dsub=dR−CAm,dR+1−CAm,dR−12CAm,dR+1+CAm,dR−1−2CAm,dR,where dR is the disparity of point m after previous steps; CAm,dR+1 and CAm,dR−1 are cost aggregation results of point m when the disparity is dR+1 and dR−1, respectively. At last, the 3×3 median filter is used to smooth the disparity result.


## 3.1. Input Image Preprocessing

Since guided images are required in matching cost computation, it is necessary to preprocess the rectified input image. GIF has edge-preserving feature and good smoothing effect, and the computation time is independent of the size of the support region. Hence, guided images are obtained by using GIF.


## 3.2. Matching Cost Computation

To render the model more robust and achieve more accurate results, we adopt a matching cost computation method that combines the absolute differences (AD), census transformation [29], and the gradient.AD is computed by using information on RGB channels according to the following equation:(1)CADm,d=13∑c∈R,G,BILeftm,c−IRightn,c,where ILeftm,c is the value of point mxm,ym on the channel c of the left image and IRightn,c is the value of the corresponding point nxm−d,ym on the channel c of the right image, when the disparity is d.Census transformation firstly compares the gray value of the center point with those of other points in the window and utilizes 0 or 1 to represent the result; then, the results are linked to form a binary bit string. This can be formulated as(2)Scen=⊗i∈WkξIk,Ii,ξIk,Ii=1,Ik>Ii,0,otherwise.Here,⊗ represents a bitwise connection operation, Wk is the window centered on the point k, i is an arbitrary point in Wk, and Ii and Ik are gray values of points i and k, respectively.Subsequently, the Hamming distance of binary bit strings between corresponding points is computed to measure the similarity between them. We assume thatScenLm is the binary bit string of point m in the left image and ScenRn is the binary bit string of the corresponding point n in the right image when the disparity is d. The Hamming distance between m and n can be expressed as(3)Ccenm,d=HammingScenLm,ScenRn.The gradient is calculated by our recently proposed method [28]. It combines the RGB gradient of the input image and the guided image to compute the gradient in x and y directions, respectively. The expressions are as follows:(4)Cgxm,d=13∑c∈R,G,BgxLeftIm,c−gxRightIn,c+gxLeftGm,c−gxRightGn,c,Cgym,d=13∑c∈R,G,BgyLeftIm,c−gyRightIn,c+gyLeftGm,c−gyRightGn,c,where gx and gy represent the gradient in x and y directions, respectively. The superscripts I and G, respectively, represent the input image and the guided image.By weighted fusion of the above-mentioned approaches, the matching cost computation function is acquired as follows:(5)Cm,d=4−exp−CADm,dλAD−exp−Ccenm,dλcen−exp−Cgxm,dλgx−exp−Cgym,dλgy.Here,λAD, λcen, λgx, and λgy are the weight of AD, census transformation, the gradient in x direction, and the gradient in y direction, respectively; CAD, Ccen, Cgx, and Cgy are the matching cost of the corresponding approach.


## 3.3. Cost Aggregation Using ACR-GIF-OW

### 3.3.1. ACR Construction

Points with similar color in the support region may arise from the same structure of the image; thus, these points have similar disparity [27]. In order to ensure that only points with similar color are included in the support region, the ACR is adopted. Double thresholds of the distance and color difference are used to restrict the arm length [30]. The decision rules are as follows:(1)
Dcp,pe<C1 and Dcpe,pn<C1(2)
Ddp,pe<L1(3)
IfL2<Ddp,pe<L1, Dcp,pe<C2 and Dcpe,pn<C2pe is an arbitrary point on the support arm with center point p, pn is the point preceding pe in the direction of the support arm, and Dcp,pe=maxc∈R,G,BIcp−Icpe, Ddp,pe=p−pe. C1, C2, L1, and L2 are thresholds, and C2<C1 and L2<L1.When the above rules are fulfilled, the center point is considered to be the starting point that expands in four directions, and the expansion stops when one of the decision rules is not satisfied. The ACRRp can be expressed as the union of all horizontal support arms Hq, whose center point q is on the vertical support arm of point p, as shown in Figure 2.Figure 2
Schematic view of the ACR.


### 3.3.2. The Orthogonal Weight Calculation

According to the construction process and structural feature of the ACR, we detect a horizontal path at first and then a vertical one when observed from any point to the center point. Therefore, the weight of each point relative to the center point can be computed by multiplying the weight between the adjacent points on the path [31]. Since the weight can be decomposed into two parts (the horizontal weight and the vertical weight), we name it as the orthogonal weight, as shown in Figure 3.Figure 3
Schematic of the orthogonal weight.Here,qi,j is an arbitrary point in the Rp, px,y is the center point, and HWj,y and VWi,x represent the horizontal and vertical weights of point q relative to point p, respectively.The orthogonal weight can be computed by multiplying the horizontal and vertical weights, and thus, the orthogonal weight ofq can be expressed as(6)Wq,p=HWj,y⋅VWi,x.To obtain the calculations associated withHWj,y and VWi,x conveniently, we construct the weight matrix of horizontal adjacent points, WH, and the weight matrix of vertical adjacent points, WV. The information on RGB channels is used to compute the weights of adjacent points, as shown in the following formulae:(7)WHx,y=f∑c∈R,G,BIch,w−Ich,w+1,(8)WVx,y=f∑c∈R,G,BIch,w−Ich+1,w,where h and w, respectively, represent the row and column indices of image I. The expression of function ft in equations (7) and (8) is shown as follows:(9)ft=1,t<δ,exp1γ,t≥δ,where parameters δ and γ are constants. The purpose of introducing function ft is to avoid the problem that when there is a significant local difference in the intensity between adjacent pixels on the path, information tends to get lost [21].After calculating the matricesWH and WV, the horizontal and vertical weights of q can be computed as follows:(10)HWj,y=∏k=minj,ymaxj,y−1WHi,k,j≠y,1,j=y,(11)VWi,x=∏k=mini,xmaxi,x−1WVk,y,i≠x,1,i=x.According to equation (10), another recursive form of computing the horizontal weight is formulated as(12)HWj,y=WHi,j⋅HWj+1,y,y−j>1,WHi,y−1,y−j=1.Similarly, according to equation (11), another recursive form of computing the vertical weight is formulated as(13)VWi,x=WVi,y⋅VWi+1,x,x−i>1,WVx−1,y,x−i=1.According to equations (12) and (13), HWj,y and VWi,x can be computed from the center point in both directions, such that the weight of the previous point can be utilized, and only one multiplication is required in each computation.


### 3.3.3. The Weighted Aggregation Computing Method

On the basis of the discussion inSection 3.3.2 and inspired by the orthogonal integral image [27], we propose a weighted aggregation computing method based on orthogonal weights. Based on the feature that the orthogonal weight can be decomposed; the process of weighted aggregation is decomposed into two orthogonal directions of one-dimensional weighted aggregation as follows:(1)
The weighted sum of the horizontal support arm for each point is computed. To improve the computing efficiency for any pointri,j in the image, the weighted sum of the left and right support arms is separately computed as follows:(14)WSLi,j=∑k=beg_hjHWk,j⋅imgi,k=∑k=beg_hj−1HWk,j⋅imgi,k+imgi,j,WSRi,j=∑k=jend_hHWk,j⋅imgi,k=∑k=j+1end_hHWk,j⋅imgi,k+imgi,j,whereWSLi,j and WSRi,j are the weighted sum of the left and right support arms of point r, respectively; beg_h and end_h are the beginning and ending positions of the horizontal support arm for point r, respectively; img is a single-channel image. For RGB images, one of the channels is selected according to the need for calculation.(2)
The weighted sum of the horizontal support arm for pointr is computed and stored in WSHas follows:(15)WSHi,j=WSLi,j+WSRi,j−imgi,j.(3)
Based onWSH, the weighted sum of the vertical support arm for each point is computed. Similarly, to improve the computing efficiency, the weighted sum of the up and bottom support arms for the center point px,y is, respectively, computed as follows:(16)WSUx,y=∑k=beg_vxVWk,x⋅WSHk,y=∑k=beg_vx−1VWk,x⋅WSHk,y+WSHx,y,WSDx,y=∑k=xend_vVWk,x⋅WSHk,y=∑k=x+1end_vVWk,x⋅WSHk,y+WSHx,y.Here,WSUx,y and WSDx,y are the weighted sum of the up and bottom support arms for point p, respectively; beg_v and end_v are the beginning and ending positions of the vertical support arm for point p, respectively.(4)
The weighted aggregation result of the ACR centered at pointp is obtained as follows:(17)WACRx,y=WSUx,y+WSDx,y−WSHx,y.


### 3.3.4. ACR-GIF-OW

On the basis of the computing method described inSection 3.3.3, we adopt ACR-GIF-OW as the cost aggregation method. Since the color image has more obvious edge protection effects [14], we select the color image as the guidance image. We denote the guidance image as I and the filtering input image as the matching cost volume C. The linear model coefficients ap and bp can be acquired by minimizing the weighted local energy function that is formulated as(18)Eap,bp=∑q∈RpWq,p⋅ap⋅Iq+bp−Cq,d2+ε⋅ap2,where Rp is the ACR centered at pixel p, ε is a regularization parameter, and Wq,p is the orthogonal weight of point q defined in equation (6).The solution to this equation is given as(19)ap=∑p+εU−11∑q∈RpWp,q∑q∈RpWp,q⋅Iq⋅Cq,d−μp⋅C¯p=∑p+εU−11∑q∈RpWp,q∑q∈RpWp,q⋅IRq⋅Cq,d−μpR⋅C¯p1∑q∈RpWp,q∑q∈RpWp,q⋅IGq⋅Cq,d−μpG⋅C¯p1∑q∈RpWp,q∑q∈RpWp,q⋅IBq⋅Cq,d−μpB⋅C¯p,bp=C¯p−apTμp=C¯p−apT⋅μpRμpGμpB.Here,μpc=∑q∈RpWp,q⋅Icq/∑q∈RpWp,qc∈R,G,B, C¯p=∑q∈RpWp,q⋅Cq,d/∑q∈RpWp,q, ∑p is the 3×3 covariance matrix of I in Rp, and U is an 3×3 identity matrix.The linear model is then used to compute the filtered result, which is also the result of cost aggregation, as shown as follows:(20)CAq,d=a¯qTIq+b¯q,where a¯q=1/∑p∈RqWp,q∑p∈Rqap, b¯q=1/∑p∈RqWp,q∑p∈Rqbp, and CA is the matching cost volume after cost aggregation.The comparison of results after cost aggregation using ACR-GIF [28] without/with orthogonal weights is shown in Figure 4.Figure 4
Comparison of results after cost aggregation. (a) Using ACR-GIF without orthogonal weights. (b) Using ACR-GIF with orthogonal weights.
(a)(b)


## 3.3.1. ACR Construction

Points with similar color in the support region may arise from the same structure of the image; thus, these points have similar disparity [27]. In order to ensure that only points with similar color are included in the support region, the ACR is adopted. Double thresholds of the distance and color difference are used to restrict the arm length [30]. The decision rules are as follows:(1)
Dcp,pe<C1 and Dcpe,pn<C1(2)
Ddp,pe<L1(3)
IfL2<Ddp,pe<L1, Dcp,pe<C2 and Dcpe,pn<C2pe is an arbitrary point on the support arm with center point p, pn is the point preceding pe in the direction of the support arm, and Dcp,pe=maxc∈R,G,BIcp−Icpe, Ddp,pe=p−pe. C1, C2, L1, and L2 are thresholds, and C2<C1 and L2<L1.When the above rules are fulfilled, the center point is considered to be the starting point that expands in four directions, and the expansion stops when one of the decision rules is not satisfied. The ACRRp can be expressed as the union of all horizontal support arms Hq, whose center point q is on the vertical support arm of point p, as shown in Figure 2.Figure 2
Schematic view of the ACR.


## 3.3.2. The Orthogonal Weight Calculation

According to the construction process and structural feature of the ACR, we detect a horizontal path at first and then a vertical one when observed from any point to the center point. Therefore, the weight of each point relative to the center point can be computed by multiplying the weight between the adjacent points on the path [31]. Since the weight can be decomposed into two parts (the horizontal weight and the vertical weight), we name it as the orthogonal weight, as shown in Figure 3.Figure 3
Schematic of the orthogonal weight.Here,qi,j is an arbitrary point in the Rp, px,y is the center point, and HWj,y and VWi,x represent the horizontal and vertical weights of point q relative to point p, respectively.The orthogonal weight can be computed by multiplying the horizontal and vertical weights, and thus, the orthogonal weight ofq can be expressed as(6)Wq,p=HWj,y⋅VWi,x.To obtain the calculations associated withHWj,y and VWi,x conveniently, we construct the weight matrix of horizontal adjacent points, WH, and the weight matrix of vertical adjacent points, WV. The information on RGB channels is used to compute the weights of adjacent points, as shown in the following formulae:(7)WHx,y=f∑c∈R,G,BIch,w−Ich,w+1,(8)WVx,y=f∑c∈R,G,BIch,w−Ich+1,w,where h and w, respectively, represent the row and column indices of image I. The expression of function ft in equations (7) and (8) is shown as follows:(9)ft=1,t<δ,exp1γ,t≥δ,where parameters δ and γ are constants. The purpose of introducing function ft is to avoid the problem that when there is a significant local difference in the intensity between adjacent pixels on the path, information tends to get lost [21].After calculating the matricesWH and WV, the horizontal and vertical weights of q can be computed as follows:(10)HWj,y=∏k=minj,ymaxj,y−1WHi,k,j≠y,1,j=y,(11)VWi,x=∏k=mini,xmaxi,x−1WVk,y,i≠x,1,i=x.According to equation (10), another recursive form of computing the horizontal weight is formulated as(12)HWj,y=WHi,j⋅HWj+1,y,y−j>1,WHi,y−1,y−j=1.Similarly, according to equation (11), another recursive form of computing the vertical weight is formulated as(13)VWi,x=WVi,y⋅VWi+1,x,x−i>1,WVx−1,y,x−i=1.According to equations (12) and (13), HWj,y and VWi,x can be computed from the center point in both directions, such that the weight of the previous point can be utilized, and only one multiplication is required in each computation.


## 3.3.3. The Weighted Aggregation Computing Method

On the basis of the discussion inSection 3.3.2 and inspired by the orthogonal integral image [27], we propose a weighted aggregation computing method based on orthogonal weights. Based on the feature that the orthogonal weight can be decomposed; the process of weighted aggregation is decomposed into two orthogonal directions of one-dimensional weighted aggregation as follows:(1)
The weighted sum of the horizontal support arm for each point is computed. To improve the computing efficiency for any pointri,j in the image, the weighted sum of the left and right support arms is separately computed as follows:(14)WSLi,j=∑k=beg_hjHWk,j⋅imgi,k=∑k=beg_hj−1HWk,j⋅imgi,k+imgi,j,WSRi,j=∑k=jend_hHWk,j⋅imgi,k=∑k=j+1end_hHWk,j⋅imgi,k+imgi,j,whereWSLi,j and WSRi,j are the weighted sum of the left and right support arms of point r, respectively; beg_h and end_h are the beginning and ending positions of the horizontal support arm for point r, respectively; img is a single-channel image. For RGB images, one of the channels is selected according to the need for calculation.(2)
The weighted sum of the horizontal support arm for pointr is computed and stored in WSHas follows:(15)WSHi,j=WSLi,j+WSRi,j−imgi,j.(3)
Based onWSH, the weighted sum of the vertical support arm for each point is computed. Similarly, to improve the computing efficiency, the weighted sum of the up and bottom support arms for the center point px,y is, respectively, computed as follows:(16)WSUx,y=∑k=beg_vxVWk,x⋅WSHk,y=∑k=beg_vx−1VWk,x⋅WSHk,y+WSHx,y,WSDx,y=∑k=xend_vVWk,x⋅WSHk,y=∑k=x+1end_vVWk,x⋅WSHk,y+WSHx,y.Here,WSUx,y and WSDx,y are the weighted sum of the up and bottom support arms for point p, respectively; beg_v and end_v are the beginning and ending positions of the vertical support arm for point p, respectively.(4)
The weighted aggregation result of the ACR centered at pointp is obtained as follows:(17)WACRx,y=WSUx,y+WSDx,y−WSHx,y.


## 3.3.4. ACR-GIF-OW

On the basis of the computing method described inSection 3.3.3, we adopt ACR-GIF-OW as the cost aggregation method. Since the color image has more obvious edge protection effects [14], we select the color image as the guidance image. We denote the guidance image as I and the filtering input image as the matching cost volume C. The linear model coefficients ap and bp can be acquired by minimizing the weighted local energy function that is formulated as(18)Eap,bp=∑q∈RpWq,p⋅ap⋅Iq+bp−Cq,d2+ε⋅ap2,where Rp is the ACR centered at pixel p, ε is a regularization parameter, and Wq,p is the orthogonal weight of point q defined in equation (6).The solution to this equation is given as(19)ap=∑p+εU−11∑q∈RpWp,q∑q∈RpWp,q⋅Iq⋅Cq,d−μp⋅C¯p=∑p+εU−11∑q∈RpWp,q∑q∈RpWp,q⋅IRq⋅Cq,d−μpR⋅C¯p1∑q∈RpWp,q∑q∈RpWp,q⋅IGq⋅Cq,d−μpG⋅C¯p1∑q∈RpWp,q∑q∈RpWp,q⋅IBq⋅Cq,d−μpB⋅C¯p,bp=C¯p−apTμp=C¯p−apT⋅μpRμpGμpB.Here,μpc=∑q∈RpWp,q⋅Icq/∑q∈RpWp,qc∈R,G,B, C¯p=∑q∈RpWp,q⋅Cq,d/∑q∈RpWp,q, ∑p is the 3×3 covariance matrix of I in Rp, and U is an 3×3 identity matrix.The linear model is then used to compute the filtered result, which is also the result of cost aggregation, as shown as follows:(20)CAq,d=a¯qTIq+b¯q,where a¯q=1/∑p∈RqWp,q∑p∈Rqap, b¯q=1/∑p∈RqWp,q∑p∈Rqbp, and CA is the matching cost volume after cost aggregation.The comparison of results after cost aggregation using ACR-GIF [28] without/with orthogonal weights is shown in Figure 4.Figure 4
Comparison of results after cost aggregation. (a) Using ACR-GIF without orthogonal weights. (b) Using ACR-GIF with orthogonal weights.
(a)(b)


## 3.4. Disparity Computation

We use the winner-take-all strategy [13] for the disparity computation, in which the disparity corresponding to the minimum matching cost of each point in CA is selected as the initial disparity. The expression is given by(21)dinim=argmin0≤d≤dmaxCAm,d.Here,dinim is the initial disparity of point m.


## 3.5. Disparity Refinement

There are many outliers in the initial disparity map that need to be detected and corrected by disparity refinement. In this study, a multistep refinement method [28] proposed by us recently is adopted, and each step has been elucidated in the following sections.


### 3.5.1. Left-Right Consistency Check and Outlier’s Classification

The left-right consistency check judges whether the disparities of two points satisfy the condition given in the following equation:(22)diniLx0,y0−diniRx0−diniLx0,y0,y0≤1,where diniL and diniR represent the initial disparity map of the left and right images, respectively; x0 and y0 are the point indices.Subsequently, the detected outliers are divided into two classes: one has the corresponding point in the right image, and the other does not exist the corresponding point in the right image. The first class is called the corresponding outlier, and the second is called the no-corresponding outlier. The steps described below correct the two classes separately.


### 3.5.2. ACR Voting

To replace the disparities of outliers with that of reliable points, we first use ACR voting, in which the total number of votes of reliable points and the highest number of votes among different disparities are counted. We then consider the following conditions:(23)NT>N,(24)NmaxNT>P.Here,NT is the total number of votes, Nmax is the highest number of votes among different disparities, and N and P are thresholds. If both equations (23) and (24) are satisfied, the disparity corresponding to the highest number of votes is used to replace the outlier’s disparity. Meanwhile, the outlier is marked as reliable. In order to deal with as many outliers as possible, this step is iterated five times.


### 3.5.3. ACR Four-Direction Propagation Interpolation

For corresponding outliers, the nearest reliable points are found in their own ACR along the directions of the four support arms. The corresponding disparities are separately marked asdRL, dRR, dRU, and dRD. Then, the disparities of these outliers are replaced by equation (25), and they are marked as reliable points.(25)dR=dhmin,ifdRLanddRRexisting,dvmin,ifdRUanddRDexisting,dhmin+dvmin2,ifdhmin−dvmin≤2,not changed,otherwise.Here,dhmin=mindRL,dRR and dvmin=mindRU,dRD. For dealing with as many outliers as possible, this step is iterated three times.


### 3.5.4. Two-Direction Propagation Interpolation

For remaining corresponding outliers, the nearest reliable points are found along the left and right directions, and the corresponding disparities are recorded asdl and dr, respectively. Then, the disparities of these outliers are replaced by equation (26), and they are marked as reliable points.(26)dR=dhmin,ifdlanddrexisting,not changed,otherwise.Here,dhmin=mindl,dr.


### 3.5.5. No-Corresponding Outliers Interpolation

After the above-mentioned steps, the remaining outliers are mainly no-corresponding outliers. Since such outliers usually appear in the leftmost area of the image, we use one-direction propagation interpolation; that is, the nearest reliable point is found along the right side of the outlier. The disparity of the outlier is then replaced and the outlier is marked as reliable.


### 3.5.6. Subpixel Refinement

To reduce the error caused by disparity discontinuity, an approach based on quadratic polynomial interpolation is used for subpixel refinement as follows:(27)dsub=dR−CAm,dR+1−CAm,dR−12CAm,dR+1+CAm,dR−1−2CAm,dR,where dR is the disparity of point m after previous steps; CAm,dR+1 and CAm,dR−1 are cost aggregation results of point m when the disparity is dR+1 and dR−1, respectively. At last, the 3×3 median filter is used to smooth the disparity result.


## 3.5.1. Left-Right Consistency Check and Outlier’s Classification

The left-right consistency check judges whether the disparities of two points satisfy the condition given in the following equation:(22)diniLx0,y0−diniRx0−diniLx0,y0,y0≤1,where diniL and diniR represent the initial disparity map of the left and right images, respectively; x0 and y0 are the point indices.Subsequently, the detected outliers are divided into two classes: one has the corresponding point in the right image, and the other does not exist the corresponding point in the right image. The first class is called the corresponding outlier, and the second is called the no-corresponding outlier. The steps described below correct the two classes separately.


## 3.5.2. ACR Voting

To replace the disparities of outliers with that of reliable points, we first use ACR voting, in which the total number of votes of reliable points and the highest number of votes among different disparities are counted. We then consider the following conditions:(23)NT>N,(24)NmaxNT>P.Here,NT is the total number of votes, Nmax is the highest number of votes among different disparities, and N and P are thresholds. If both equations (23) and (24) are satisfied, the disparity corresponding to the highest number of votes is used to replace the outlier’s disparity. Meanwhile, the outlier is marked as reliable. In order to deal with as many outliers as possible, this step is iterated five times.


## 3.5.3. ACR Four-Direction Propagation Interpolation

For corresponding outliers, the nearest reliable points are found in their own ACR along the directions of the four support arms. The corresponding disparities are separately marked asdRL, dRR, dRU, and dRD. Then, the disparities of these outliers are replaced by equation (25), and they are marked as reliable points.(25)dR=dhmin,ifdRLanddRRexisting,dvmin,ifdRUanddRDexisting,dhmin+dvmin2,ifdhmin−dvmin≤2,not changed,otherwise.Here,dhmin=mindRL,dRR and dvmin=mindRU,dRD. For dealing with as many outliers as possible, this step is iterated three times.


## 3.5.4. Two-Direction Propagation Interpolation

For remaining corresponding outliers, the nearest reliable points are found along the left and right directions, and the corresponding disparities are recorded asdl and dr, respectively. Then, the disparities of these outliers are replaced by equation (26), and they are marked as reliable points.(26)dR=dhmin,ifdlanddrexisting,not changed,otherwise.Here,dhmin=mindl,dr.


## 3.5.5. No-Corresponding Outliers Interpolation

After the above-mentioned steps, the remaining outliers are mainly no-corresponding outliers. Since such outliers usually appear in the leftmost area of the image, we use one-direction propagation interpolation; that is, the nearest reliable point is found along the right side of the outlier. The disparity of the outlier is then replaced and the outlier is marked as reliable.


## 3.5.6. Subpixel Refinement

To reduce the error caused by disparity discontinuity, an approach based on quadratic polynomial interpolation is used for subpixel refinement as follows:(27)dsub=dR−CAm,dR+1−CAm,dR−12CAm,dR+1+CAm,dR−1−2CAm,dR,where dR is the disparity of point m after previous steps; CAm,dR+1 and CAm,dR−1 are cost aggregation results of point m when the disparity is dR+1 and dR−1, respectively. At last, the 3×3 median filter is used to smooth the disparity result.


## 4. Experimental Results and Discussions

We carried out our experiments on Middlebury evaluation platform [32], whose dataset includes two parts: training sets and test sets. Every part has fifteen image pairs with different resolution at least 1300×1100 pixels. Owing to the high resolution, complicated scene structure, and different lighting or exposure conditions, the results of the dataset can actually reflect the robustness and accuracy of the algorithm.The parameters and thresholds in the proposed stereo matching algorithm are set as follows:δ=1/510, γ=−3, λAD=30/255, λcen=45/255, λgx=5/255, λgy=15/255, ε=0.012, C1=15/255, C2=12/255, L1=maxH,W/30, L2=maxH,W/60, N=40, and P=0.5, where H and W represent the height and width of the input image, respectively. Among them, the values of λAD, λcen, λgx, and λgy are referenced from [23], the values of C1, C2, L1, L2, N, and P are referenced from [28], the value of ε is the same as in [15].


### 4.1. Efficiency of the Proposed Weighted Aggregation Computing Method

In order to verify the effectiveness of the proposed weighted aggregation computing method, the computation time of straightforward computing (the weight of each point in the ACR is computed according to equations (12) and (13) and then summed by traversal) and the computing method described in Section 3.3.3 are compared. The experimental environment used is Matlab 2018b, and the computer configuration is Intel Core i7-8750H CPU and 16G memory. The results of training sets are shown in Figure 5.Figure 5
Comparison of the computation time between straightforward computing and the proposed computing method.The chart illustrates that the computation time of the proposed computing method is obviously less than that required for straightforward computing. Among them, the computation time for Shelves is reduced by a maximum of 80.2%; the computation time for Recycle, Vintage, Jadeplant, and Adirondack is, respectively, reduced by 79.9%, 79.1%, 78.9%, and 78%. Owing to the relatively low resolution and disparity level, the percentage reduction of Teddy and ArtL is comparatively low, that is, 64.6% and 55.6%, respectively. The computation time is reduced by 72.7% on average. The above data indicate that, compared with straightforward computing, the proposed computing method can effectively reduce computing time and improve computing efficiency.


### 4.2. Comparison of ACR-GIF and ACR-GIF-OW

To verify the effect of the proposed cost aggregation method, two stereo matching algorithms that, respectively, adopt ACR-GIF used in [28] and ACR-GIF-OW for cost aggregation are compared in terms of their disparity result and time overhead. Except for cost aggregation, all other steps of two algorithms are identical.


#### 4.2.1. Comparison of Disparity Results

The metric bad 2.0 is used to quantitatively evaluate the accuracy of disparity results. It is the default metric of Middlebury evaluation platform that represents the percentage of bad pixels with disparity errors greater than 2.0 pixels. The results of the training sets are shown in Figure6.Figure 6
Comparison of bad 2.0 between ACR-GIF and ACR-GIF-OW: (a) bad 2.0 in nonoccluded regions; (b) bad 2.0 in all regions.
(a)(b)As observed in Figure6(a), in nonoccluded regions, except Shelves and Teddy, the values of bad 2.0 for the remaining images are reduced to varying degrees. Among them, the value of Motorcycle and MotorcycleE can be reduced by more than 40%; the value of Adirondack, PlaytableP, and Recycle can be reduced by more than 30%; the value of Piano, Pipes, and Vintage can be reduced by more than 20%. From Figure 6(b), we can see that, in all regions, except ArtL, Shelves, and Teddy, the values of bad 2.0 for the remaining images are also reduced to varying degrees. Among them, the values of Motorcycle and MotorcycleE are reduced by more than 30%; the values of Adirondack, PlaytableP, and Recycle are reduced by more than 20%; the values of Piano, Playtable, and Vintage are reduced by more than 15%.Figure7 shows the comparison result of the bad 2.0 weighted average on training sets, which is obtained from Middlebury evaluation platform (the weight of each image is given by the platform). It can be seen from Figure 7 that the value of ACR-GIF-OW is evidently lower than that of ACR-GIF. The weighted average can be reduced by 24.1% and 16.3% in nonoccluded regions and all regions, respectively.Figure 7
Comparison of the bad 2.0 weighted average between ACR-GIF and ACR-GIF-OW. nonocc: nonoccluded regions; all: all regions.According to the above results, we can conclude that, compared to that of ACR-GIF, the accuracy of disparity results obtained by using ACR-GIF-OW is significantly superior in both nonoccluded regions and all regions.Next, to compare the results of two algorithms more intuitively, we select three images from training sets and make comparisons of disparity maps and the corresponding error maps acquired by two algorithms, as shown in Figure8.Figure 8
Comparison of MotorcycleE, Adirondack, and Recycle. (a) Ground truth disparity maps and rectified left images. (b) Disparity maps and the corresponding error maps of ACR-GIF and (c) ACR-GIF-OW.
(a)(b)(c)We find that, in error maps of ACR-GIF-OW, black regions in red boxes are apparently smaller in area (the black color implies that the disparity errors are greater than 2.0 pixels), and these red boxes mainly correspond to weakly textured and textureless regions in the image. The above result indicates that ACR-GIF-OW can improve the disparity accuracy of these regions, thereby improving the overall disparity accuracy.Furthermore, the performance on the low texture, repetitive pattern, plain color, and discontinue regions is compared, as shown in Figure9.Figure 9
Comparison of low texture, repetitive pattern, plain color, and discontinue regions. (a) Left images. (b) Error maps of ACR-GIF. (c) Error maps of ACR-GIF-OW.It can be found in Figure9 that the performance of ACR-GIF-OW is obviously better than ACR-GIF (the area of black region in the red box), especially in low texture, plain color, and discontinue regions.


#### 4.2.2. Comparison of Time Overhead

Using the same experimental environment and computer as described in Section4.1, the time overhead of ACR-GIF and ACR-GIF-OW is compared. The result is shown in Figure 10.Figure 10
Comparison of time overhead between ACR-GIF and ACR-GIF-OW.The chart illustrates that the time overhead of ACR-GIF-OW is more than that of ACR-GIF, owing to the weights’ computation. Among them, the time overhead of Teddy has the lowest growth rate of 4.5%; the time overhead of Adirondack has the highest growth rate of 17.6%. The average growth rate of time overhead on training sets is 12.7%.Combining the results acquired in Sections4.2.1 and 4.2.2, we can conclude that comparing the increase in time overhead shows that ACR-GIF-OW exhibits an obvious improvement with regard to the disparity accuracy. Thus, considering both the accuracy and the time overhead, the proposed method is advantageous over ACR-GIF.


### 4.3. Analysis of Parameter Setting

Parametersδ and γ are two key parameters in the process of the orthogonal weight calculation. Figure 11 shows the effect of parameters δ and γ with different settings.Figure 11
Effect of parameters (a)δ and (b) γ. The weighted average of bad 2.0 on training sets in both nonoccluded and all regions is listed.
(a)(b)Figure11(a) indicates that when δ>1/510, the disparity accuracy of both nonoccluded and all regions becomes worse; on the contrary, the accuracy remains unchanged. Figure 11(b) reveals that when γ=−3, the disparity accuracy can achieve its best in both nonoccluded and all regions. According to the above conclusions, the best setting of δ and γ is 1/510 and −3, respectively.


### 4.4. Effect of Each Step in the Proposed Algorithm

The proposed algorithm is composed of several steps. For analyzing how does each step affect the final result, except for bad 2.0, the weighted average of avgerr on training sets is also used. Avgerr is another metric that means average absolute error in pixels. The results after performing each step are shown in Figure12.Figure 12
Weighted average on training sets in nonoccluded and all regions after performing each step: (a) bad 2.0 and (b) avgerr. MCC: matching cost computation, CA: cost aggregation, and DR: disparity refinement.
(a)(b)Figure12 presents the contribution of each step to the reduction of disparity errors in both nonoccluded and all regions. After performing CA, the value of bad 2.0 in nonoccluded and all regions can be decreased by 39.4% and 31.1%, respectively; the value of avgerr in nonoccluded and all regions can be decreased by 56.4% and 34.4%, respectively. After performing DR, the value of bad 2.0 can be, respectively, reduced by 27.7% and 22.9% in nonoccluded and all regions; the value of avgerr can be, respectively, reduced by 29.5% and 47.6% in nonoccluded and all regions.Moreover, Figure13 shows the effect of each step in DR. The charts indicate that the contribution of each step is distinct for different metrics and regions. For the bad 2.0, Step 5 is the most effective. But for the avgerr, the errors are significantly reduced by Step 1. In all regions, Step 2 is more effective than in nonoccluded regions, and so are Steps 3 and 4. Thus, the combination of these steps guarantees a better result.Figure 13
Weighted average on training sets in nonoccluded and all regions after performing each step of DR: (a) bad 2.0; (b) avgerr. 1: ACR voting, 2: ACR four-direction propagation interpolation, 3: two-direction propagation interpolation, 4: no-corresponding outliers interpolation, and 5: subpixel refinement.
(a)(b)


### 4.5. Comparison with State-of-the-Art Stereo Matching Algorithms

#### 4.5.1. Comparison with Other Local Stereo Matching Algorithms

To verify the performance of the local stereo matching algorithm proposed in this paper, we select seven state-of-the-art local algorithms for comparison, namely, DAWA-F [33], FASW [20], IEBIMst [34], ADSM [35], DoGGuided [36], IGF [37], and ISM [38]. The disparity map comparison of five stereo images in Middlebury datasets is shown in Figure 14.Figure 14
Comparison of disparity maps with other local stereo matching algorithms. (a) Jadeplant, (b) Vintage, (c) Classroom2, (d) Livingroom, and (e) Newkuba.To make a quantitative comparison of disparity results, the metric bad 2.0 is employed again. The comparison results of whole datasets are shown in Tables1 and 2, where the bold fonts indicate the best results. The weighted average shown in the last row is the weighted average of training sets and test sets. The weights are given by the Middlebury evaluation platform.Table 1
Comparison of bad 2.0 in nonoccluded regions with other local stereo matching algorithms.
Image nameDAWA-F (%)FASW (%)IEBIMst (%)ADSM (%)IGF (%)ISM (%)DoGGuided (%)Proposed (%)Adirondack20.926.041.336.536.737.340.517.6ArtL20.417.216.020.628.028.823.914.9Jadeplant44.734.331.535.744.645.542.526.1Motorcycle16.723.017.027.631.532.130.815.5MotorcycleE17.122.720.830.533.734.331.614.3Piano21.632.030.438.845.344.741.824.7PianoL49.543.653.959.052.553.158.042.2Pipes21.023.715.426.633.534.228.614.5Playroom30.537.542.046.844.444.644.629.4Playtable27.043.555.056.959.859.861.536.8PlaytableP19.228.125.631.844.444.536.419.2Recycle19.823.224.229.637.838.133.117.9Shelves51.349.952.553.352.551.854.648.6Teddy10.810.58.5712.221.622.014.78.78Vintage39.144.164.752.854.955.057.538.9Australia47.241.736.740.442.742.545.437.5AustraliaP13.618.112.120.320.126.423.610.8Bicycle213.123.116.927.323.734.830.616.3Classroom219.227.232.535.132.236.134.617.4Classroom2E66.440.651.055.945.644.552.544.9Computer20.419.125.322.328.634.428.317.2Crusade30.334.958.156.143.056.259.133.5CrusadeP33.928.149.850.937.252.753.825.2Djembe8.7318.511.224.221.425.226.411.4DjembeL48.940.848.658.050.951.060.645.4Hoops37.836.456.956.344.752.454.735.7Livingroom26.729.330.236.534.739.738.326.6Newkuba29.928.426.832.131.933.335.523.3Plants28.031.126.938.737.438.844.523.6Staircase36.541.071.769.747.175.372.038.4Weighted average (%)26.228.331.536.336.640.239.223.1Table 2
Comparison of bad 2.0 in all regions with other local stereo matching algorithms.
Image nameDAWA-F (%)FASW (%)IEBIMst (%)ADSM (%)IGF (%)ISM (%)DoGGuided (%)Proposed (%)Adirondack25.728.043.638.639.340.040.522.7ArtL34.927.927.030.236.237.123.929.0Jadeplant56.445.541.646.753.554.442.540.4Motorcycle24.127.222.631.235.636.330.823.5MotorcycleE24.626.926.634.337.938.531.622.2Piano26.636.134.642.148.648.141.830.0PianoL52.847.056.861.255.456.158.046.0Pipes33.433.726.636.542.543.128.627.2Playroom39.344.949.353.250.650.944.638.5Playtable34.147.058.359.862.262.361.542.6PlaytableP25.931.331.036.248.448.536.426.7Recycle24.625.826.031.740.240.533.122.7Shelves52.851.354.054.453.653.054.650.7Teddy19.417.315.618.626.927.314.716.5Vintage43.448.166.656.057.657.757.543.1Australia49.242.939.241.044.243.545.441.5AustraliaP19.120.415.622.223.328.223.616.6Bicycle219.327.722.232.129.338.830.622.0Classroom229.833.938.940.839.241.934.627.7Classroom2E70.646.357.361.151.649.652.552.0Computer34.231.335.334.140.343.628.331.4Crusade43.139.063.962.750.660.959.144.8CrusadeP46.235.457.358.145.358.453.838.0Djembe13.621.113.726.424.527.426.415.9DjembeL52.242.549.558.752.652.060.647.5Hoops49.647.864.464.154.860.854.747.4Livingroom34.935.735.641.340.045.338.333.7Newkuba38.333.933.237.037.838.935.531.3Plants38.237.132.444.543.443.844.534.2Staircase45.748.875.274.054.078.272.047.0Weighted average (%)34.334.037.241.542.144.946.231.4The results of Tables1 and 2 indicate that, whether in nonoccluded regions or all regions, the number of the best results obtained by the proposed method is higher than other local algorithms, and the rest of the results are also relatively good. Besides, both of the weighted average values are the best as well. Furthermore, for image pairs with different illuminations like ArtL, PianoL, and DjembeL and with different exposures like MotorcycleE and Classroom2E, better results are acquired by the proposed algorithm. This demonstrates that the proposed algorithm has better robustness when the illumination or exposure changes for a pair of images. To summarize, the performance of the proposed algorithm is evidently better than those of the other seven state-of-the-art local algorithms.


#### 4.5.2. Comparison with Other Nonlocal Stereo Matching Algorithms

In order to make a more comprehensive comparison, except for local algorithms, we also select six state-of-the-art nonlocal algorithms for comparison, namely, DDL [39], LS_ELAS [40], TSGO [41], DSGCA [42], SIGMRF [43], and SPPSMNet [44]. Among them, DSGCA, SIGMRF, and SPPSMNet are algorithms based on deep learning. The disparity map comparison of the same five stereo images is shown in Figure 15.Figure 15
Comparison of disparity maps with other nonlocal stereo matching algorithms. (a) Jadeplant. (b) Vintage. (c) Classroom2. (d) Livingroom. (e) Newkuba.The comparison results of bad 2.0 are shown in Tables3 and 4, where the bold fonts also indicate the best results.Table 3
Comparison of bad 2.0 in nonoccluded regions with other nonlocal stereo matching algorithms.
Image nameDDL (%)LS-ELAS (%)TSGO (%)DSGCA (%)SPPSMNet (%)SIGMRF (%)Proposed (%)Adirondack24.234.527.327.025.629.217.6ArtL20.210.612.320.439.815.014.9Jadeplant34.540.653.135.045.541.526.1Motorcycle26.121.423.526.132.328.715.5MotorcycleE24.323.025.725.133.734.514.3Piano31.233.133.432.437.236.724.7PianoL43.648.854.545.754.147.242.2Pipes26.123.022.526.034.815.614.5Playroom36.238.549.641.843.139.929.4Playtable38.851.745.053.538.154.536.8PlaytableP25.621.127.035.132.835.519.2Recycle24.336.224.226.730.434.217.9Shelves54.754.652.254.947.858.248.6Teddy12.414.413.313.821.414.18.78Vintage44.150.657.550.846.741.138.9Australia44.353.534.142.932.560.037.5AustraliaP19.410.316.920.920.633.010.8Bicycle225.815.820.023.634.067.916.3Classroom228.337.043.330.233.063.217.4Classroom2E42.183.655.445.555.999.544.9Computer21.124.514.327.636.339.817.2Crusade37.149.154.142.053.884.833.5CrusadeP28.734.649.236.048.682.025.2Djembe21.713.933.921.035.035.211.4DjembeL46.844.966.250.271.695.245.4Hoops36.045.745.944.252.891.535.7Livingroom30.334.939.833.337.158.126.6Newkuba28.429.142.634.638.165.823.3Plants32.764.447.238.446.755.023.6Staircase37.562.752.646.856.988.638.4Weighted average (%)29.433.635.232.638.748.323.1Table 4
Comparison of bad 2.0 in all regions with other nonlocal stereo matching algorithms.
Image nameDDL (%)LS-ELAS (%)TSGO (%)DSGCA (%)SPPSMNet (%)SIGMRF (%)Proposed (%)Adirondack26.437.129.432.528.632.522.7ArtL30.319.720.836.548.426.029.0Jadeplant46.052.261.049.454.853.240.4Motorcycle30.225.128.533.537.134.923.5MotorcycleE28.226.430.332.538.439.822.2Piano35.436.937.137.541.341.030.0PianoL47.151.557.149.756.850.546.0Pipes36.333.031.638.042.327.127.2Playroom43.745.455.049.648.746.338.5Playtable43.155.248.858.141.958.642.6PlaytableP29.424.431.941.735.841.326.7Recycle27.238.726.831.932.538.122.7Shelves55.955.253.657.649.860.150.7Teddy19.020.418.222.625.921.216.5Vintage48.053.760.554.650.044.943.1Australia45.554.635.647.335.363.641.5AustraliaP22.213.518.727.024.339.916.6Bicycle230.520.924.330.237.070.722.0Classroom234.843.749.040.139.868.427.7Classroom2E47.385.360.253.259.299.452.0Computer33.535.525.340.346.550.431.4Crusade42.255.960.252.660.287.544.8CrusadeP35.544.455.447.855.285.238.0Djembe24.317.236.226.338.639.615.9DjembeL48.346.767.153.473.095.447.5Hoops47.155.255.155.360.393.147.4Livingroom35.940.643.340.741.662.933.7Newkuba34.335.546.343.043.670.231.3Plants39.367.750.747.753.061.834.2Staircase45.666.558.355.162.590.247.0Weighted average (%)35.138.940.040.843.853.731.4Similar to Tables1 and 2, the results of Tables 3 and 4 can also indicate that the robustness and performance of the proposed algorithm are obviously better than those of the other six state-of-the-art nonlocal algorithms.


## 4.1. Efficiency of the Proposed Weighted Aggregation Computing Method

In order to verify the effectiveness of the proposed weighted aggregation computing method, the computation time of straightforward computing (the weight of each point in the ACR is computed according to equations (12) and (13) and then summed by traversal) and the computing method described in Section 3.3.3 are compared. The experimental environment used is Matlab 2018b, and the computer configuration is Intel Core i7-8750H CPU and 16G memory. The results of training sets are shown in Figure 5.Figure 5
Comparison of the computation time between straightforward computing and the proposed computing method.The chart illustrates that the computation time of the proposed computing method is obviously less than that required for straightforward computing. Among them, the computation time for Shelves is reduced by a maximum of 80.2%; the computation time for Recycle, Vintage, Jadeplant, and Adirondack is, respectively, reduced by 79.9%, 79.1%, 78.9%, and 78%. Owing to the relatively low resolution and disparity level, the percentage reduction of Teddy and ArtL is comparatively low, that is, 64.6% and 55.6%, respectively. The computation time is reduced by 72.7% on average. The above data indicate that, compared with straightforward computing, the proposed computing method can effectively reduce computing time and improve computing efficiency.


## 4.2. Comparison of ACR-GIF and ACR-GIF-OW

To verify the effect of the proposed cost aggregation method, two stereo matching algorithms that, respectively, adopt ACR-GIF used in [28] and ACR-GIF-OW for cost aggregation are compared in terms of their disparity result and time overhead. Except for cost aggregation, all other steps of two algorithms are identical.


### 4.2.1. Comparison of Disparity Results

The metric bad 2.0 is used to quantitatively evaluate the accuracy of disparity results. It is the default metric of Middlebury evaluation platform that represents the percentage of bad pixels with disparity errors greater than 2.0 pixels. The results of the training sets are shown in Figure6.Figure 6
Comparison of bad 2.0 between ACR-GIF and ACR-GIF-OW: (a) bad 2.0 in nonoccluded regions; (b) bad 2.0 in all regions.
(a)(b)As observed in Figure6(a), in nonoccluded regions, except Shelves and Teddy, the values of bad 2.0 for the remaining images are reduced to varying degrees. Among them, the value of Motorcycle and MotorcycleE can be reduced by more than 40%; the value of Adirondack, PlaytableP, and Recycle can be reduced by more than 30%; the value of Piano, Pipes, and Vintage can be reduced by more than 20%. From Figure 6(b), we can see that, in all regions, except ArtL, Shelves, and Teddy, the values of bad 2.0 for the remaining images are also reduced to varying degrees. Among them, the values of Motorcycle and MotorcycleE are reduced by more than 30%; the values of Adirondack, PlaytableP, and Recycle are reduced by more than 20%; the values of Piano, Playtable, and Vintage are reduced by more than 15%.Figure7 shows the comparison result of the bad 2.0 weighted average on training sets, which is obtained from Middlebury evaluation platform (the weight of each image is given by the platform). It can be seen from Figure 7 that the value of ACR-GIF-OW is evidently lower than that of ACR-GIF. The weighted average can be reduced by 24.1% and 16.3% in nonoccluded regions and all regions, respectively.Figure 7
Comparison of the bad 2.0 weighted average between ACR-GIF and ACR-GIF-OW. nonocc: nonoccluded regions; all: all regions.According to the above results, we can conclude that, compared to that of ACR-GIF, the accuracy of disparity results obtained by using ACR-GIF-OW is significantly superior in both nonoccluded regions and all regions.Next, to compare the results of two algorithms more intuitively, we select three images from training sets and make comparisons of disparity maps and the corresponding error maps acquired by two algorithms, as shown in Figure8.Figure 8
Comparison of MotorcycleE, Adirondack, and Recycle. (a) Ground truth disparity maps and rectified left images. (b) Disparity maps and the corresponding error maps of ACR-GIF and (c) ACR-GIF-OW.
(a)(b)(c)We find that, in error maps of ACR-GIF-OW, black regions in red boxes are apparently smaller in area (the black color implies that the disparity errors are greater than 2.0 pixels), and these red boxes mainly correspond to weakly textured and textureless regions in the image. The above result indicates that ACR-GIF-OW can improve the disparity accuracy of these regions, thereby improving the overall disparity accuracy.Furthermore, the performance on the low texture, repetitive pattern, plain color, and discontinue regions is compared, as shown in Figure9.Figure 9
Comparison of low texture, repetitive pattern, plain color, and discontinue regions. (a) Left images. (b) Error maps of ACR-GIF. (c) Error maps of ACR-GIF-OW.It can be found in Figure9 that the performance of ACR-GIF-OW is obviously better than ACR-GIF (the area of black region in the red box), especially in low texture, plain color, and discontinue regions.


### 4.2.2. Comparison of Time Overhead

Using the same experimental environment and computer as described in Section4.1, the time overhead of ACR-GIF and ACR-GIF-OW is compared. The result is shown in Figure 10.Figure 10
Comparison of time overhead between ACR-GIF and ACR-GIF-OW.The chart illustrates that the time overhead of ACR-GIF-OW is more than that of ACR-GIF, owing to the weights’ computation. Among them, the time overhead of Teddy has the lowest growth rate of 4.5%; the time overhead of Adirondack has the highest growth rate of 17.6%. The average growth rate of time overhead on training sets is 12.7%.Combining the results acquired in Sections4.2.1 and 4.2.2, we can conclude that comparing the increase in time overhead shows that ACR-GIF-OW exhibits an obvious improvement with regard to the disparity accuracy. Thus, considering both the accuracy and the time overhead, the proposed method is advantageous over ACR-GIF.


## 4.2.1. Comparison of Disparity Results

The metric bad 2.0 is used to quantitatively evaluate the accuracy of disparity results. It is the default metric of Middlebury evaluation platform that represents the percentage of bad pixels with disparity errors greater than 2.0 pixels. The results of the training sets are shown in Figure6.Figure 6
Comparison of bad 2.0 between ACR-GIF and ACR-GIF-OW: (a) bad 2.0 in nonoccluded regions; (b) bad 2.0 in all regions.
(a)(b)As observed in Figure6(a), in nonoccluded regions, except Shelves and Teddy, the values of bad 2.0 for the remaining images are reduced to varying degrees. Among them, the value of Motorcycle and MotorcycleE can be reduced by more than 40%; the value of Adirondack, PlaytableP, and Recycle can be reduced by more than 30%; the value of Piano, Pipes, and Vintage can be reduced by more than 20%. From Figure 6(b), we can see that, in all regions, except ArtL, Shelves, and Teddy, the values of bad 2.0 for the remaining images are also reduced to varying degrees. Among them, the values of Motorcycle and MotorcycleE are reduced by more than 30%; the values of Adirondack, PlaytableP, and Recycle are reduced by more than 20%; the values of Piano, Playtable, and Vintage are reduced by more than 15%.Figure7 shows the comparison result of the bad 2.0 weighted average on training sets, which is obtained from Middlebury evaluation platform (the weight of each image is given by the platform). It can be seen from Figure 7 that the value of ACR-GIF-OW is evidently lower than that of ACR-GIF. The weighted average can be reduced by 24.1% and 16.3% in nonoccluded regions and all regions, respectively.Figure 7
Comparison of the bad 2.0 weighted average between ACR-GIF and ACR-GIF-OW. nonocc: nonoccluded regions; all: all regions.According to the above results, we can conclude that, compared to that of ACR-GIF, the accuracy of disparity results obtained by using ACR-GIF-OW is significantly superior in both nonoccluded regions and all regions.Next, to compare the results of two algorithms more intuitively, we select three images from training sets and make comparisons of disparity maps and the corresponding error maps acquired by two algorithms, as shown in Figure8.Figure 8
Comparison of MotorcycleE, Adirondack, and Recycle. (a) Ground truth disparity maps and rectified left images. (b) Disparity maps and the corresponding error maps of ACR-GIF and (c) ACR-GIF-OW.
(a)(b)(c)We find that, in error maps of ACR-GIF-OW, black regions in red boxes are apparently smaller in area (the black color implies that the disparity errors are greater than 2.0 pixels), and these red boxes mainly correspond to weakly textured and textureless regions in the image. The above result indicates that ACR-GIF-OW can improve the disparity accuracy of these regions, thereby improving the overall disparity accuracy.Furthermore, the performance on the low texture, repetitive pattern, plain color, and discontinue regions is compared, as shown in Figure9.Figure 9
Comparison of low texture, repetitive pattern, plain color, and discontinue regions. (a) Left images. (b) Error maps of ACR-GIF. (c) Error maps of ACR-GIF-OW.It can be found in Figure9 that the performance of ACR-GIF-OW is obviously better than ACR-GIF (the area of black region in the red box), especially in low texture, plain color, and discontinue regions.


## 4.2.2. Comparison of Time Overhead

Using the same experimental environment and computer as described in Section4.1, the time overhead of ACR-GIF and ACR-GIF-OW is compared. The result is shown in Figure 10.Figure 10
Comparison of time overhead between ACR-GIF and ACR-GIF-OW.The chart illustrates that the time overhead of ACR-GIF-OW is more than that of ACR-GIF, owing to the weights’ computation. Among them, the time overhead of Teddy has the lowest growth rate of 4.5%; the time overhead of Adirondack has the highest growth rate of 17.6%. The average growth rate of time overhead on training sets is 12.7%.Combining the results acquired in Sections4.2.1 and 4.2.2, we can conclude that comparing the increase in time overhead shows that ACR-GIF-OW exhibits an obvious improvement with regard to the disparity accuracy. Thus, considering both the accuracy and the time overhead, the proposed method is advantageous over ACR-GIF.


## 4.3. Analysis of Parameter Setting

Parametersδ and γ are two key parameters in the process of the orthogonal weight calculation. Figure 11 shows the effect of parameters δ and γ with different settings.Figure 11
Effect of parameters (a)δ and (b) γ. The weighted average of bad 2.0 on training sets in both nonoccluded and all regions is listed.
(a)(b)Figure11(a) indicates that when δ>1/510, the disparity accuracy of both nonoccluded and all regions becomes worse; on the contrary, the accuracy remains unchanged. Figure 11(b) reveals that when γ=−3, the disparity accuracy can achieve its best in both nonoccluded and all regions. According to the above conclusions, the best setting of δ and γ is 1/510 and −3, respectively.


## 4.4. Effect of Each Step in the Proposed Algorithm

The proposed algorithm is composed of several steps. For analyzing how does each step affect the final result, except for bad 2.0, the weighted average of avgerr on training sets is also used. Avgerr is another metric that means average absolute error in pixels. The results after performing each step are shown in Figure12.Figure 12
Weighted average on training sets in nonoccluded and all regions after performing each step: (a) bad 2.0 and (b) avgerr. MCC: matching cost computation, CA: cost aggregation, and DR: disparity refinement.
(a)(b)Figure12 presents the contribution of each step to the reduction of disparity errors in both nonoccluded and all regions. After performing CA, the value of bad 2.0 in nonoccluded and all regions can be decreased by 39.4% and 31.1%, respectively; the value of avgerr in nonoccluded and all regions can be decreased by 56.4% and 34.4%, respectively. After performing DR, the value of bad 2.0 can be, respectively, reduced by 27.7% and 22.9% in nonoccluded and all regions; the value of avgerr can be, respectively, reduced by 29.5% and 47.6% in nonoccluded and all regions.Moreover, Figure13 shows the effect of each step in DR. The charts indicate that the contribution of each step is distinct for different metrics and regions. For the bad 2.0, Step 5 is the most effective. But for the avgerr, the errors are significantly reduced by Step 1. In all regions, Step 2 is more effective than in nonoccluded regions, and so are Steps 3 and 4. Thus, the combination of these steps guarantees a better result.Figure 13
Weighted average on training sets in nonoccluded and all regions after performing each step of DR: (a) bad 2.0; (b) avgerr. 1: ACR voting, 2: ACR four-direction propagation interpolation, 3: two-direction propagation interpolation, 4: no-corresponding outliers interpolation, and 5: subpixel refinement.
(a)(b)


## 4.5. Comparison with State-of-the-Art Stereo Matching Algorithms

### 4.5.1. Comparison with Other Local Stereo Matching Algorithms

To verify the performance of the local stereo matching algorithm proposed in this paper, we select seven state-of-the-art local algorithms for comparison, namely, DAWA-F [33], FASW [20], IEBIMst [34], ADSM [35], DoGGuided [36], IGF [37], and ISM [38]. The disparity map comparison of five stereo images in Middlebury datasets is shown in Figure 14.Figure 14
Comparison of disparity maps with other local stereo matching algorithms. (a) Jadeplant, (b) Vintage, (c) Classroom2, (d) Livingroom, and (e) Newkuba.To make a quantitative comparison of disparity results, the metric bad 2.0 is employed again. The comparison results of whole datasets are shown in Tables1 and 2, where the bold fonts indicate the best results. The weighted average shown in the last row is the weighted average of training sets and test sets. The weights are given by the Middlebury evaluation platform.Table 1
Comparison of bad 2.0 in nonoccluded regions with other local stereo matching algorithms.
Image nameDAWA-F (%)FASW (%)IEBIMst (%)ADSM (%)IGF (%)ISM (%)DoGGuided (%)Proposed (%)Adirondack20.926.041.336.536.737.340.517.6ArtL20.417.216.020.628.028.823.914.9Jadeplant44.734.331.535.744.645.542.526.1Motorcycle16.723.017.027.631.532.130.815.5MotorcycleE17.122.720.830.533.734.331.614.3Piano21.632.030.438.845.344.741.824.7PianoL49.543.653.959.052.553.158.042.2Pipes21.023.715.426.633.534.228.614.5Playroom30.537.542.046.844.444.644.629.4Playtable27.043.555.056.959.859.861.536.8PlaytableP19.228.125.631.844.444.536.419.2Recycle19.823.224.229.637.838.133.117.9Shelves51.349.952.553.352.551.854.648.6Teddy10.810.58.5712.221.622.014.78.78Vintage39.144.164.752.854.955.057.538.9Australia47.241.736.740.442.742.545.437.5AustraliaP13.618.112.120.320.126.423.610.8Bicycle213.123.116.927.323.734.830.616.3Classroom219.227.232.535.132.236.134.617.4Classroom2E66.440.651.055.945.644.552.544.9Computer20.419.125.322.328.634.428.317.2Crusade30.334.958.156.143.056.259.133.5CrusadeP33.928.149.850.937.252.753.825.2Djembe8.7318.511.224.221.425.226.411.4DjembeL48.940.848.658.050.951.060.645.4Hoops37.836.456.956.344.752.454.735.7Livingroom26.729.330.236.534.739.738.326.6Newkuba29.928.426.832.131.933.335.523.3Plants28.031.126.938.737.438.844.523.6Staircase36.541.071.769.747.175.372.038.4Weighted average (%)26.228.331.536.336.640.239.223.1Table 2
Comparison of bad 2.0 in all regions with other local stereo matching algorithms.
Image nameDAWA-F (%)FASW (%)IEBIMst (%)ADSM (%)IGF (%)ISM (%)DoGGuided (%)Proposed (%)Adirondack25.728.043.638.639.340.040.522.7ArtL34.927.927.030.236.237.123.929.0Jadeplant56.445.541.646.753.554.442.540.4Motorcycle24.127.222.631.235.636.330.823.5MotorcycleE24.626.926.634.337.938.531.622.2Piano26.636.134.642.148.648.141.830.0PianoL52.847.056.861.255.456.158.046.0Pipes33.433.726.636.542.543.128.627.2Playroom39.344.949.353.250.650.944.638.5Playtable34.147.058.359.862.262.361.542.6PlaytableP25.931.331.036.248.448.536.426.7Recycle24.625.826.031.740.240.533.122.7Shelves52.851.354.054.453.653.054.650.7Teddy19.417.315.618.626.927.314.716.5Vintage43.448.166.656.057.657.757.543.1Australia49.242.939.241.044.243.545.441.5AustraliaP19.120.415.622.223.328.223.616.6Bicycle219.327.722.232.129.338.830.622.0Classroom229.833.938.940.839.241.934.627.7Classroom2E70.646.357.361.151.649.652.552.0Computer34.231.335.334.140.343.628.331.4Crusade43.139.063.962.750.660.959.144.8CrusadeP46.235.457.358.145.358.453.838.0Djembe13.621.113.726.424.527.426.415.9DjembeL52.242.549.558.752.652.060.647.5Hoops49.647.864.464.154.860.854.747.4Livingroom34.935.735.641.340.045.338.333.7Newkuba38.333.933.237.037.838.935.531.3Plants38.237.132.444.543.443.844.534.2Staircase45.748.875.274.054.078.272.047.0Weighted average (%)34.334.037.241.542.144.946.231.4The results of Tables1 and 2 indicate that, whether in nonoccluded regions or all regions, the number of the best results obtained by the proposed method is higher than other local algorithms, and the rest of the results are also relatively good. Besides, both of the weighted average values are the best as well. Furthermore, for image pairs with different illuminations like ArtL, PianoL, and DjembeL and with different exposures like MotorcycleE and Classroom2E, better results are acquired by the proposed algorithm. This demonstrates that the proposed algorithm has better robustness when the illumination or exposure changes for a pair of images. To summarize, the performance of the proposed algorithm is evidently better than those of the other seven state-of-the-art local algorithms.


### 4.5.2. Comparison with Other Nonlocal Stereo Matching Algorithms

In order to make a more comprehensive comparison, except for local algorithms, we also select six state-of-the-art nonlocal algorithms for comparison, namely, DDL [39], LS_ELAS [40], TSGO [41], DSGCA [42], SIGMRF [43], and SPPSMNet [44]. Among them, DSGCA, SIGMRF, and SPPSMNet are algorithms based on deep learning. The disparity map comparison of the same five stereo images is shown in Figure 15.Figure 15
Comparison of disparity maps with other nonlocal stereo matching algorithms. (a) Jadeplant. (b) Vintage. (c) Classroom2. (d) Livingroom. (e) Newkuba.The comparison results of bad 2.0 are shown in Tables3 and 4, where the bold fonts also indicate the best results.Table 3
Comparison of bad 2.0 in nonoccluded regions with other nonlocal stereo matching algorithms.
Image nameDDL (%)LS-ELAS (%)TSGO (%)DSGCA (%)SPPSMNet (%)SIGMRF (%)Proposed (%)Adirondack24.234.527.327.025.629.217.6ArtL20.210.612.320.439.815.014.9Jadeplant34.540.653.135.045.541.526.1Motorcycle26.121.423.526.132.328.715.5MotorcycleE24.323.025.725.133.734.514.3Piano31.233.133.432.437.236.724.7PianoL43.648.854.545.754.147.242.2Pipes26.123.022.526.034.815.614.5Playroom36.238.549.641.843.139.929.4Playtable38.851.745.053.538.154.536.8PlaytableP25.621.127.035.132.835.519.2Recycle24.336.224.226.730.434.217.9Shelves54.754.652.254.947.858.248.6Teddy12.414.413.313.821.414.18.78Vintage44.150.657.550.846.741.138.9Australia44.353.534.142.932.560.037.5AustraliaP19.410.316.920.920.633.010.8Bicycle225.815.820.023.634.067.916.3Classroom228.337.043.330.233.063.217.4Classroom2E42.183.655.445.555.999.544.9Computer21.124.514.327.636.339.817.2Crusade37.149.154.142.053.884.833.5CrusadeP28.734.649.236.048.682.025.2Djembe21.713.933.921.035.035.211.4DjembeL46.844.966.250.271.695.245.4Hoops36.045.745.944.252.891.535.7Livingroom30.334.939.833.337.158.126.6Newkuba28.429.142.634.638.165.823.3Plants32.764.447.238.446.755.023.6Staircase37.562.752.646.856.988.638.4Weighted average (%)29.433.635.232.638.748.323.1Table 4
Comparison of bad 2.0 in all regions with other nonlocal stereo matching algorithms.
Image nameDDL (%)LS-ELAS (%)TSGO (%)DSGCA (%)SPPSMNet (%)SIGMRF (%)Proposed (%)Adirondack26.437.129.432.528.632.522.7ArtL30.319.720.836.548.426.029.0Jadeplant46.052.261.049.454.853.240.4Motorcycle30.225.128.533.537.134.923.5MotorcycleE28.226.430.332.538.439.822.2Piano35.436.937.137.541.341.030.0PianoL47.151.557.149.756.850.546.0Pipes36.333.031.638.042.327.127.2Playroom43.745.455.049.648.746.338.5Playtable43.155.248.858.141.958.642.6PlaytableP29.424.431.941.735.841.326.7Recycle27.238.726.831.932.538.122.7Shelves55.955.253.657.649.860.150.7Teddy19.020.418.222.625.921.216.5Vintage48.053.760.554.650.044.943.1Australia45.554.635.647.335.363.641.5AustraliaP22.213.518.727.024.339.916.6Bicycle230.520.924.330.237.070.722.0Classroom234.843.749.040.139.868.427.7Classroom2E47.385.360.253.259.299.452.0Computer33.535.525.340.346.550.431.4Crusade42.255.960.252.660.287.544.8CrusadeP35.544.455.447.855.285.238.0Djembe24.317.236.226.338.639.615.9DjembeL48.346.767.153.473.095.447.5Hoops47.155.255.155.360.393.147.4Livingroom35.940.643.340.741.662.933.7Newkuba34.335.546.343.043.670.231.3Plants39.367.750.747.753.061.834.2Staircase45.666.558.355.162.590.247.0Weighted average (%)35.138.940.040.843.853.731.4Similar to Tables1 and 2, the results of Tables 3 and 4 can also indicate that the robustness and performance of the proposed algorithm are obviously better than those of the other six state-of-the-art nonlocal algorithms.


## 4.5.1. Comparison with Other Local Stereo Matching Algorithms

To verify the performance of the local stereo matching algorithm proposed in this paper, we select seven state-of-the-art local algorithms for comparison, namely, DAWA-F [33], FASW [20], IEBIMst [34], ADSM [35], DoGGuided [36], IGF [37], and ISM [38]. The disparity map comparison of five stereo images in Middlebury datasets is shown in Figure 14.Figure 14
Comparison of disparity maps with other local stereo matching algorithms. (a) Jadeplant, (b) Vintage, (c) Classroom2, (d) Livingroom, and (e) Newkuba.To make a quantitative comparison of disparity results, the metric bad 2.0 is employed again. The comparison results of whole datasets are shown in Tables1 and 2, where the bold fonts indicate the best results. The weighted average shown in the last row is the weighted average of training sets and test sets. The weights are given by the Middlebury evaluation platform.Table 1
Comparison of bad 2.0 in nonoccluded regions with other local stereo matching algorithms.
Image nameDAWA-F (%)FASW (%)IEBIMst (%)ADSM (%)IGF (%)ISM (%)DoGGuided (%)Proposed (%)Adirondack20.926.041.336.536.737.340.517.6ArtL20.417.216.020.628.028.823.914.9Jadeplant44.734.331.535.744.645.542.526.1Motorcycle16.723.017.027.631.532.130.815.5MotorcycleE17.122.720.830.533.734.331.614.3Piano21.632.030.438.845.344.741.824.7PianoL49.543.653.959.052.553.158.042.2Pipes21.023.715.426.633.534.228.614.5Playroom30.537.542.046.844.444.644.629.4Playtable27.043.555.056.959.859.861.536.8PlaytableP19.228.125.631.844.444.536.419.2Recycle19.823.224.229.637.838.133.117.9Shelves51.349.952.553.352.551.854.648.6Teddy10.810.58.5712.221.622.014.78.78Vintage39.144.164.752.854.955.057.538.9Australia47.241.736.740.442.742.545.437.5AustraliaP13.618.112.120.320.126.423.610.8Bicycle213.123.116.927.323.734.830.616.3Classroom219.227.232.535.132.236.134.617.4Classroom2E66.440.651.055.945.644.552.544.9Computer20.419.125.322.328.634.428.317.2Crusade30.334.958.156.143.056.259.133.5CrusadeP33.928.149.850.937.252.753.825.2Djembe8.7318.511.224.221.425.226.411.4DjembeL48.940.848.658.050.951.060.645.4Hoops37.836.456.956.344.752.454.735.7Livingroom26.729.330.236.534.739.738.326.6Newkuba29.928.426.832.131.933.335.523.3Plants28.031.126.938.737.438.844.523.6Staircase36.541.071.769.747.175.372.038.4Weighted average (%)26.228.331.536.336.640.239.223.1Table 2
Comparison of bad 2.0 in all regions with other local stereo matching algorithms.
Image nameDAWA-F (%)FASW (%)IEBIMst (%)ADSM (%)IGF (%)ISM (%)DoGGuided (%)Proposed (%)Adirondack25.728.043.638.639.340.040.522.7ArtL34.927.927.030.236.237.123.929.0Jadeplant56.445.541.646.753.554.442.540.4Motorcycle24.127.222.631.235.636.330.823.5MotorcycleE24.626.926.634.337.938.531.622.2Piano26.636.134.642.148.648.141.830.0PianoL52.847.056.861.255.456.158.046.0Pipes33.433.726.636.542.543.128.627.2Playroom39.344.949.353.250.650.944.638.5Playtable34.147.058.359.862.262.361.542.6PlaytableP25.931.331.036.248.448.536.426.7Recycle24.625.826.031.740.240.533.122.7Shelves52.851.354.054.453.653.054.650.7Teddy19.417.315.618.626.927.314.716.5Vintage43.448.166.656.057.657.757.543.1Australia49.242.939.241.044.243.545.441.5AustraliaP19.120.415.622.223.328.223.616.6Bicycle219.327.722.232.129.338.830.622.0Classroom229.833.938.940.839.241.934.627.7Classroom2E70.646.357.361.151.649.652.552.0Computer34.231.335.334.140.343.628.331.4Crusade43.139.063.962.750.660.959.144.8CrusadeP46.235.457.358.145.358.453.838.0Djembe13.621.113.726.424.527.426.415.9DjembeL52.242.549.558.752.652.060.647.5Hoops49.647.864.464.154.860.854.747.4Livingroom34.935.735.641.340.045.338.333.7Newkuba38.333.933.237.037.838.935.531.3Plants38.237.132.444.543.443.844.534.2Staircase45.748.875.274.054.078.272.047.0Weighted average (%)34.334.037.241.542.144.946.231.4The results of Tables1 and 2 indicate that, whether in nonoccluded regions or all regions, the number of the best results obtained by the proposed method is higher than other local algorithms, and the rest of the results are also relatively good. Besides, both of the weighted average values are the best as well. Furthermore, for image pairs with different illuminations like ArtL, PianoL, and DjembeL and with different exposures like MotorcycleE and Classroom2E, better results are acquired by the proposed algorithm. This demonstrates that the proposed algorithm has better robustness when the illumination or exposure changes for a pair of images. To summarize, the performance of the proposed algorithm is evidently better than those of the other seven state-of-the-art local algorithms.


## 4.5.2. Comparison with Other Nonlocal Stereo Matching Algorithms

In order to make a more comprehensive comparison, except for local algorithms, we also select six state-of-the-art nonlocal algorithms for comparison, namely, DDL [39], LS_ELAS [40], TSGO [41], DSGCA [42], SIGMRF [43], and SPPSMNet [44]. Among them, DSGCA, SIGMRF, and SPPSMNet are algorithms based on deep learning. The disparity map comparison of the same five stereo images is shown in Figure 15.Figure 15
Comparison of disparity maps with other nonlocal stereo matching algorithms. (a) Jadeplant. (b) Vintage. (c) Classroom2. (d) Livingroom. (e) Newkuba.The comparison results of bad 2.0 are shown in Tables3 and 4, where the bold fonts also indicate the best results.Table 3
Comparison of bad 2.0 in nonoccluded regions with other nonlocal stereo matching algorithms.
Image nameDDL (%)LS-ELAS (%)TSGO (%)DSGCA (%)SPPSMNet (%)SIGMRF (%)Proposed (%)Adirondack24.234.527.327.025.629.217.6ArtL20.210.612.320.439.815.014.9Jadeplant34.540.653.135.045.541.526.1Motorcycle26.121.423.526.132.328.715.5MotorcycleE24.323.025.725.133.734.514.3Piano31.233.133.432.437.236.724.7PianoL43.648.854.545.754.147.242.2Pipes26.123.022.526.034.815.614.5Playroom36.238.549.641.843.139.929.4Playtable38.851.745.053.538.154.536.8PlaytableP25.621.127.035.132.835.519.2Recycle24.336.224.226.730.434.217.9Shelves54.754.652.254.947.858.248.6Teddy12.414.413.313.821.414.18.78Vintage44.150.657.550.846.741.138.9Australia44.353.534.142.932.560.037.5AustraliaP19.410.316.920.920.633.010.8Bicycle225.815.820.023.634.067.916.3Classroom228.337.043.330.233.063.217.4Classroom2E42.183.655.445.555.999.544.9Computer21.124.514.327.636.339.817.2Crusade37.149.154.142.053.884.833.5CrusadeP28.734.649.236.048.682.025.2Djembe21.713.933.921.035.035.211.4DjembeL46.844.966.250.271.695.245.4Hoops36.045.745.944.252.891.535.7Livingroom30.334.939.833.337.158.126.6Newkuba28.429.142.634.638.165.823.3Plants32.764.447.238.446.755.023.6Staircase37.562.752.646.856.988.638.4Weighted average (%)29.433.635.232.638.748.323.1Table 4
Comparison of bad 2.0 in all regions with other nonlocal stereo matching algorithms.
Image nameDDL (%)LS-ELAS (%)TSGO (%)DSGCA (%)SPPSMNet (%)SIGMRF (%)Proposed (%)Adirondack26.437.129.432.528.632.522.7ArtL30.319.720.836.548.426.029.0Jadeplant46.052.261.049.454.853.240.4Motorcycle30.225.128.533.537.134.923.5MotorcycleE28.226.430.332.538.439.822.2Piano35.436.937.137.541.341.030.0PianoL47.151.557.149.756.850.546.0Pipes36.333.031.638.042.327.127.2Playroom43.745.455.049.648.746.338.5Playtable43.155.248.858.141.958.642.6PlaytableP29.424.431.941.735.841.326.7Recycle27.238.726.831.932.538.122.7Shelves55.955.253.657.649.860.150.7Teddy19.020.418.222.625.921.216.5Vintage48.053.760.554.650.044.943.1Australia45.554.635.647.335.363.641.5AustraliaP22.213.518.727.024.339.916.6Bicycle230.520.924.330.237.070.722.0Classroom234.843.749.040.139.868.427.7Classroom2E47.385.360.253.259.299.452.0Computer33.535.525.340.346.550.431.4Crusade42.255.960.252.660.287.544.8CrusadeP35.544.455.447.855.285.238.0Djembe24.317.236.226.338.639.615.9DjembeL48.346.767.153.473.095.447.5Hoops47.155.255.155.360.393.147.4Livingroom35.940.643.340.741.662.933.7Newkuba34.335.546.343.043.670.231.3Plants39.367.750.747.753.061.834.2Staircase45.666.558.355.162.590.247.0Weighted average (%)35.138.940.040.843.853.731.4Similar to Tables1 and 2, the results of Tables 3 and 4 can also indicate that the robustness and performance of the proposed algorithm are obviously better than those of the other six state-of-the-art nonlocal algorithms.


## 5. Conclusions

In this study, an improved cost aggregation method is proposed, in which the matching cost volume is filtered by ACR-GIF-OW. Different from other methods adopted ACR-GIF, the proposed method takes the orthogonal weight of each point in the ACR into consideration. For improving the computational efficiency of the proposed method, a weighted aggregation computing method based on orthogonal weights is proposed. Moreover, a local stereo matching algorithm using ACR-GIF-OW is proposed as well. Experimental results demonstrate that, compared with that of ACR-GIF, the disparity accuracy of ACR-GIF-OW is significantly improved at the cost of a smaller growth of the time overhead, and the stereo matching algorithm proposed in this paper exhibits superior performance than those of other state-of-the-art local and nonlocal algorithms. In the future work, we will introduce the orthogonal weight in the disparity refinement to further improve the disparity accuracy.



---

*Source: 5556990-2021-05-07.xml*