# Matchability and Uncertainty-Aware Iterative Disparity Refinement for Stereo Matching
## 3 Methods  
The architecture of the MUIR proposed in this paper is shown in Figure 1, which employs the recurrent disparity refinement framework based on the RAFT-Stereo [12]. The stereo image pairs \(I_{\text{J}},I_{\text{r}}\in[0,255]^{3\times\lambda\text{i}\text{p}\times \text{i}\text{u}^{\text{m}\text{p}}}\) are scaled to \([-1,1]\) and then fed to the matchingfeature Extractor\({}^{\text{mtc}}\) and the contextual feature Extractor\({}^{\text{ctx}}\) to encode the matching features \(F_{1}^{\text{mtc}}\), \(F_{1}^{\text{mtc}}\in\mathbb{R}^{c^{\text{mtc}}\times h\times w}\) and the contextual feature map \(F^{\text{ctx}}\in\mathbb{R}^{c^{\text{mtc}}\times h\times w}\), where \(c^{\text{mtc}},c^{\text{ctx}}\) are the number of channels for the matching features and the contextual feature, respectively, and \(h^{\text{up}},w^{\text{up}}\) and \(h,w\) are the size of the input images and feature maps, respectively. The measure of visual similarity between matching features \(F_{1}^{\text{mtc}}\) and \(F_{r}^{\text{mtc}}\) is obtained using dot product to construct the matching correlation volume:  
\[C^{\text{mtc}}=\frac{1}{\sqrt{c^{\text{mtc}}}}\langle F_{1}^{\text{mtc}}(j),F_ {r}^{\text{mtc}}(j-d)\rangle\in\mathbb{R}^{h\times w\times w}, \tag{1}\]  
where \(d\) is disparity, \(j\in\{1,2,\ldots,w\}\) is the horizontal index of a matching feature, and \(\langle\cdot,\cdot\rangle\) denotes the inner product. The correlation volume slice \(C^{\text{mtc}}(\hat{D}_{t})\in\mathbb{R}^{(2r+1)\times h\times w}\) is obtained by bilinear sampling along the scaling dimension (last dimension) of \(C^{\text{mtc}}\) with a sampling window \(\hat{D}_{t}=\left\{d_{t}\mid d_{t}\in\left[\hat{d}_{t}-r,\hat{d}_{t}+r\right]\right\}\) centered on the estimated disparity \(\hat{d}_{t}\), where \(t\in\{1,2,\ldots,T\}\) is the index of current iteration, \(T\) is the total number of refinement iterations, and \(r\in\mathbb{Z}_{+}\) is the sampling window radius.  
During initialization, the initial disparity field's hidden state \(H_{1}\) and disparity \(\hat{d}_{1}\) are obtained through the simplified disparity field feature encoder\({}^{\text{mif}}\) and the Initializer in the UFI module (see Section 3.2.1). In each iteration, the matchability mask \(\hat{m}_{t-1}\in[0,1]^{h\times w}\) is decoded by the MUD module from the hidden state (see Section 3.1.1). Next, the \(\hat{m}_{t-1}\) is fed to the disparity field feature Encoder\({}^{\text{df}}\) and MGA modules to filter out the matching ambiguity noise and the unreliable hidden state (see Section 3.2.2), respectively. The hidden state \(H_{t}\) updated by the Iterator is fed to the residual Decoder\({}^{\text{disp}}\) to refine the estimated disparity: \(\hat{d}_{t}=\hat{d}_{t-1}+\Delta\hat{d}_{t}\). The \(H_{t}\) and \(\hat{d}_{t}\) are then utilized by the MUD to decode the next mask \(\hat{m}_{t}\) and uncertainty \(\hat{u}_{t}\). At the end of each iteration, the \(H_{t}\), \(\hat{d}_{t}\) and \(\hat{u}_{t}\) can optionally be fed to the joint upsampling block Upsampler\({}^{\text{d,u}}\) to obtain the upsampled disparity \(\hat{d}_{t}^{\text{tp}}\) and uncertainty \(\hat{u}_{t}^{\text{up}}\). The proposed iterative disparity refinement is completed after \(T\) iterations of the above process.