Ask Your Question
1

How do I provide custom disparity search range in StereoSGBM for each pixel?

asked 2017-08-28 07:33:59 -0600

dhaivat666 gravatar image

updated 2019-12-10 01:19:41 -0600

Akhil Patel gravatar image

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.

edit retag flag offensive close merge delete

Comments

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.

Der Luftmensch gravatar imageDer Luftmensch ( 2017-08-30 07:06:43 -0600 )edit

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.

dhaivat666 gravatar imagedhaivat666 ( 2017-08-30 11:54:50 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-12-03 00:51:24 -0600

jasonzhang gravatar image

sgbm cuda This program is based on the opencv sgbm algorithm, the effect is exactly the same. May help you

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-08-28 07:33:59 -0600

Seen: 682 times

Last updated: Dec 03 '18