Selection of parameters for building a depth map
There is a calibrated stereopair with which I build a depth map using the StereoSGBM algorithm from the openCV library. The algorithm provides the ability to configure via the built-in parameters: setBlockSize, setDisp12MaxDiff, setMinDisparity, setNumDisparities, setSpeckleRange, setSpeckleWindowSize, setMode, etc. When using the standard example from opencv, the depth map is constructed excellent, but if you use your images then the depth map is built incorrectly.
Hence the question - how correctly to choose the values of the above parameters to build a depth map? Are there any instructions for selecting parameters? Are there any programs for automatically selecting these parameters?
Have you read original paper ?
These settings are all generally specific to the application. The variety of applications lead to a wide variety of choices for meeting requirements: illumination, contrast, collection of objects, resolution, depth of focus, motion blur, interfering objects, correct identification of objects of interest, noise, and performance considerations. It's good to tune all of them with an understanding of what each of them mean, to get the best results for the variety of intended scenes for which depth map is to be solved.