## 2 Methods
### Matching Cost Aggregation Method
Cross-based support regions are constructed by expanding each pixel \(p\) to its neighbor pixels that have similar intensities with \(p\) in the horizontal and vertical directions, expressing as \(V(p)\) and \(H(p)\):  
\[V(p) =\left\{(x,y)\Big{|}x\in\left[x_{p}-l_{v}^{-},x_{p}+l_{v}^{+} \right],y=y_{p}\right\} \tag{9}\] \[H(p) =\left\{(x,y)\Big{|}y\in\left[y_{p}-l_{h}^{-},y_{p}+l_{h}^{+} \right],x=x_{p}\right\} \tag{10}\]  
where \(\left\{l_{v}^{-},l_{v}^{+},l_{h}^{-},l_{h}^{+}\right\}\) are the four arm lengths. Then the support region \(S(p)\) is generated by merging all of the pixels lying on the horizontal direction for each pixel \(q\) which belongs to the vertical direction \(V(p)\), as illustrated in Figure 4.  
\[S(p)=\bigcup_{q\in V(p)}H(q), \tag{11}\]  
One of the core issues in constructing the cross-based adaptive shape support window is how to design proper rules to expand the pixel \(p\) to its neighbors. [PERSON] et al. [19] used color similarity \(D_{c}(p,q)\) and constant color similarity threshold to construct the cross-based support window. This method cannot perform well in depth-discontinuous regions and low-texture regions at the same time. In order to perform better in both depth discontinuous and low-texture regions, [PERSON] et al. [14] used both color similarity \(D_{c}(p,q)\) and spatial distance \(D_{s}(p,q)\) to construct the support window. Two color similarity thresholds were set according to two spatial distance thresholds, as illustrated in Figure 5a. If the spatial distance is smaller than threshold \(L_{1}\), a larger color similarity threshold \(\tau_{1}\) is used. If the spatial distance is between \(L_{1}\) and \(L_{2}\), a smaller color similarity threshold \(\tau_{2}\) is used. We further improve the method in [PERSON] et al. [14] by calculating the color similarity threshold for each pixel adaptively. As illustrated in Figure 4, if we want to construct the adaptive support region of pixel \(p\), the color difference \(D_{c}(p,q)\) and the spatial distance \(D_{s}(p,q)\) between pixel \(p\) and \(q\) are first calculated. According to the spatial distance \(D_{s}(p,q)\), the pixel \(q\) is labeled as textured region pixel or textureless region pixel. If \(D_{s}(p,q)\) is larger than spatial distance threshold \(d_{Lim}\), the pixel \(q\) is labeled as textureless region pixel. Otherwise pixel \(q\) is labeled as textured region pixel. In the richly-textured regions, the color similarity thresholds should be larger and decrease with the increase of the spatial distance. In the textureless regions, the color similarity thresholds can be smaller and should decrease with the increase of the spatial distance. Based on these findings, we adaptively calculate the color similarity threshold for each pixel according to the following two rules:  
\[\text{Rule 1 }\tau^{large}(D_{s}(p,q))=-\frac{\tau_{1}}{L_{1}}\times D_{s}(p,q)+\tau_{1},\text{ if }D_{s}(p,q)\leq d_{Lim}.\]  
\[\text{Rule 2 }\tau^{small}(D_{s}(p,q))=-\frac{\tau_{2}}{L_{2}}\times D_{s}(p,q)+\tau_{2},\text{ otherwise.}\]  
In the above rules, \(L_{1}\) is a relatively small spatial distance constant and \(\tau_{1}\) is a relatively large color similarity constant for richly-textured regions. \(L_{2}\) is a relatively large spatial distance constant and \(\tau_{2}\) is a relatively small color similarity constant for low texture regions. \(\tau^{large}(D_{s}(p,q))\) and \(\tau^{small}(D_{s}(p,q))\) are the adaptively calculated color similarity threshold for richly-textured regions and textureless regions accordingly. Rule 1 is a restricted condition which ensures that limited area is included in the richly-textured regions. While Rule 2 is fulfilled to ensure as many points from the same depth as possible are included in the textureless regions. The adaptively calculated color similarity threshold is illustrated in Figure 5b. Figure 2:0 The cross-based support region construction for cost aggregation. Figure 2:1 The spatial distance thresholds and color similarity thresholds proposed by [PERSON] et al.