# A Method for Adapting Stereo Matching Algorithms to Real Environments
###### Abstract  
This study challenges the commonly used testbeds and benchmarks for testing stereo matching algorithms. Although the algorithms listed in the rankings based on these testbeds score exceptionally high, stereo matching technology still suffers from major drawbacks; as such, it is much less popular in commercial use than other technologies for 3D scanning, such as structured-light 3D scanners. One of the main problems is that the poor quality of the results is either blamed on an inappropriate stereo camera calibration or a bad stereo matching algorithm. However, this study shows that both of these steps need to be considered together. In this paper, a solution is proposed by integrating the problem of camera calibration with the execution of a stereo matching algorithm. This approach makes it possible to restore stereo matching as a technology that is competitive with other methods of 3D image acquisition.  
s +
Footnote †: journal: Medical  
that the stereo matching algorithms listed in the relevant rankings achieve error rates close to 0%. However, even if these algorithms are very good, the technology of stereo cameras is rarely commercially used. Such a conclusion can be drawn from the availability of different kinds of devices on the market. There are a large number of companies manufacturing LIDARs and structured-light 3D scanners. These companies include Pepperl+Fuchs Inc., Analog Devices, SICK AG, XenomatiX N.V., Innoviz Technologies Ltd., RIEGL Laser Measurement Systems GmbH, and many others [10]. Moreover, they offer a large variety of models. In the case of stereo cameras, there are only a few manufacturers with limited offerings: there is a company called StereoLabs offering four different models [11], and in 2024, Basler also included stereo cameras in its offerings [12]. However, many of them are based on active stereo matching, in which light patterns are emitted in order to perform the measurement. Companies also offer only stereo camera hardware without a stereo matching algorithm [13].  
The problem with datasets in such areas is that they are calibrated using exceptionally high precision, which is impossible to achieve when using stereo cameras in real environments. For example, the images included in the KITTI benchmark were calibrated every day during routine image acquisition [14]. This is reasonable when preparing a high-quality testbed. However, it is unacceptable for commercial use. Moreover, the calibration of stereo cameras deteriorates over time when they are actively used in their target environment [15].  
This study addresses the problem of designing stereo matching algorithms that are only suitable for testbeds. The main contributions of this paper are the following: (1) The author proposes a novel, additional module for existing stereo matching algorithms. This module adapts algorithms to real applications. (2) The paper introduces a testing method for stereo matching algorithms. The method is used to verify the usability of algorithms in real environments to a larger extent than those currently used in testbeds. (3) The author also presents the results of experiments using the proposed methods.