# Simplified High-Performance Cost Aggregation for Stereo Matching
## 4 Discussion  
Traditional local and non-local stereo matching algorithms require an efficient aggregation procedure, which is the most critical stage for generating accurate dense disparity maps. The aggregation weights in most stereo matching algorithms in the literature, unfortunately, are scenario specific. We re-examined the procedure of cost aggregation from the perspective of matrix operations and treated the aggregation as constraining the degree of difference between adjacent costs. By decoupling the aggregation procedure in the horizontal and vertical directions, we propose a new aggregation algorithm to effectively calculate a cost volume for stereo matching. This process is equivalent to multiplying the initial cost by two constant matrices. The aggregation algorithm requires two constant weight matrices that are only related to the image resolution and can be calculated beforehand. These matrices are mathematically proven to be independent of image texture and thus can be applied to different scene images of the same resolution. This algorithm can be used for integration with other schemes to provide both computational efficiency and stereo matching accuracy. We demonstrate its integration with the cross-scale scheme of [20,30]. Through numerical experiments using indoor and outdoor benchmark stereo image datasets, we demonstrate that the integrated scheme is not only computationally efficient but also provides disparity maps that are highly comparable to the most accurate algorithms in the literature. In the future, we will focus on real-time implementation of the proposed algorithm by using, for instance, GPU-based systems. Preprocessing techniques, such as the algorithm proposed in [33] for detecting and removing shadows, can be employed to further improve the accuracy of dense disparity maps. Conceptualization, Y.-Z.C. and C.Z. ; methodology, C.Z. and Y.-Z.C. ; software, C.Z. ; validation, Y.-Z.C. and C.Z. ; formal analysis, C.Z. ; investigation, Y.-Z.C. ; resources, Y.-Z.C. and C.Z. ; data curation, C.Z. ; writing--original draft preparation, C.Z. ; writing--review and editing,  
Figure 9: Disparity maps of remote sensing images. (**a**) Left image of the scene (**b**) Right image of the scene (**c**) Disparity maps obtained by the proposed algorithm. Y.-Z.C. ; visualization, C.Z. ; supervision, Y.-Z.C. ; project administration, Y.-Z.C. ; funding acquisition, Y.-Z.C. All authors have read and agreed to the published version of the manuscript. This research was funded by National Science and Technology Council, Taiwan, grant number 110-2221-E-182-034 and 111-2221-E-182-057; and Chang Gung Memorial Hospital, grant number CORPD2J0041 and CORPD2J0042. **Infrared Consent Statement:** Not applicable. **Data Availability Statement:** Data sharing not applicable. The Middlebury version 3 datasets are available at [[https://vision.middlebury.edu/stereo/data/scenes2014/](https://vision.middlebury.edu/stereo/data/scenes2014/)]([https://vision.middlebury.edu/stereo/data/scenes2014/](https://vision.middlebury.edu/stereo/data/scenes2014/)). The KITTI Vision Benchmark Suite datasets are available at [[https://www.cvlibs.net/datasets/kitti/](https://www.cvlibs.net/datasets/kitti/)]([https://www.cvlibs.net/datasets/kitti/](https://www.cvlibs.net/datasets/kitti/)). The multi-view remote sensing images are available at [[https://github.com/whuwuteng/benchmark_ISPRS2021](https://github.com/whuwuteng/benchmark_ISPRS2021)]([https://github.com/whuwuteng/benchmark_ISPRS2021](https://github.com/whuwuteng/benchmark_ISPRS2021)). These datasets were accessed on 15 February 2019. **Conflicts of Interest:** The authors declare no conflict of interest. **Nomenclature**