How to implement StereoSGBM to get a disparity map?

asked 2017-05-10 09:49:31 -0600

updated 2017-05-10 10:43:31 -0600

I am using opencv 3.2.0 and visual studio 2017. I have tried to get a disparity map with StereoSGBM. My code is below. This is not working. What is going wrong? How to use the StereoSGBM??

C:\fakepath\캡처1.PNG image description

edit retag flag offensive close merge delete

Comments

1

" But it didn't work, please let me know what is wrong" what does it mean?

LBerger gravatar imageLBerger ( 2017-05-10 10:10:04 -0600 )edit
1

I modified my question. :D I am Sorry. My English is not good.

Kyohoon Sim gravatar imageKyohoon Sim ( 2017-05-10 10:45:26 -0600 )edit

StereoSGBM can process color images. You don't need cvtColor. tsul and and tsur must be rectified images. you need a waitKey before return 0 if you want to see images. You have an example here and some tutorials about calibration here

LBerger gravatar imageLBerger ( 2017-05-10 11:00:38 -0600 )edit

your code is for opencv2.4, not for opencv3.2. (the api has changed a bit)

can you try again with the 3.2 stereo_match sample ?

berak gravatar imageberak ( 2017-05-10 12:39:15 -0600 )edit
1

Thank you for the answers!

Kyohoon Sim gravatar imageKyohoon Sim ( 2017-05-11 02:57:56 -0600 )edit