where \(\Omega \)  is a binary mask that is used to mask out missing regions (pixels that have depth values smaller than \(d_{min}\)  or greater than \(d_{max}\) ), \(d_i\)  and \(d_i^*\)  are the ground truth and the predicted depth value of a valid pixel \(i\)  respectively. For stereo matching, we calculate berHu loss [1]} on all outputs from each level \(l\)  and then compute the weighted summation. The stereo matching loss is defined as:
\(\mathcal {L}_{stereo} = \frac{1}{\Omega }\sum _{i\in \Omega } \sum _{l=1}^{N} \lambda _l \mathcal {L}_{berHu}(d_i,\;\;d_{i}^*)\) 
