How do I provide custom disparity search range in StereoSGBM for each pixel?
Hello, I am computing disparity in OpenCV using StereoSGBM algorithm. Among various parameters which we need to provide, one parameter is minD and maxD, which signifies the disparity range along epipolar line where our algorithm needs to search for a potential match. I have custom minimum and maximim disparity values for each pixel of the image. Meaning, llet's say the pixel of consideration has co-ordinates (10. 10). And I know that the maximum possible disparity could not be more than 16. I will search only upto (26,10) in corresponding right image. Similary, I have custom minimum and maximum disparity values for each pixel of the image. So How do I provide such custom disparity search range? I tried to dig into SGBM code of OpenCV and found the for loop where disparity search is being carried out. However I am unable to understand what changes need to be made in original code to get such behavior. Any help regarding this would be highly appreciated. Thank you in advance.
It would be helpful if you would describe the reason why you need this. What is your use case? Often, to avoid feedback issues, it is better to do a constant "reinitialization" or a "single-shot". How is it that you already know so much about the depth of your scene? The only thing I can think of is a foreground object fixed with respect to the camera as the camera moves throughout the scene.
I have a predicted disparity map coming from some other pipeline. I would be refining this map by incorporating certain error model and will compute new disparity around a small region of my disparity value in the predicted disparity map.