libSGM icon indicating copy to clipboard operation
libSGM copied to clipboard

What if i want to get the disparity of right image ?

Open NiuKeke opened this issue 5 years ago • 4 comments

Should i run it again with exchanged left and right image,if i want get the disparity of right image or i just use the right disparity which is generated by left base image? I think the both method are different.

NiuKeke avatar Apr 26 '19 07:04 NiuKeke

It is simple to do so.

With Out Editing LibSGM:- Flip the left and right image Horizontally and exchange the left, right image for the execute API and once you get the Output, Flip it again Horizontally.

Edit Source of LibSGM:- Edit the check_consistency.cu and validate the right disparity Edit the stereo_sgm.cpp where the check_consistency comes in and make sure you use d_right_disp as output

Personally, I would prefer the "With Out Editing LibSGM" method because of the fact that calculating right to left disparity from the cost of left to right disparity is not same (path aggregation might behave differently for the right to left when calculated from scratch).

mohanen avatar Apr 26 '19 07:04 mohanen

It is simple to do so.

With Out Editing LibSGM:- Horizontal Flip the left and right image and give switch the left image, right image input with right image, left image to the execute API and once you get the Output Flip it again Horizontally.

Edit Source of LibSGM:- Edit the check_consistency.cu and validate the right disparity Edit the stereo_sgm.cpp where the check_consistency comes in and make sure you use d_right_disp as output

Personally, I would prefer the "With Out Editing LibSGM" method because of the fact that calculating right to left disparity from the cost of left to right disparity is not same (path aggregation might behave differently for the right to left when calculated from scratch).

So ,if i want to use the disparity of the right image,the best method is to exchange left and right image,but which will increase the time

NiuKeke avatar Apr 26 '19 07:04 NiuKeke

By what means you denoting an increase in time.

And By the way Exchanging only will not help, cause when you exchange left right the direction of search or the range of the search (min and max) has to be modified, we don't have that flexibility here so we flip the image horizontally.

mohanen avatar Apr 26 '19 08:04 mohanen

By what means you denoting an increase in time.

And By the way Exchanging only will not help, cause when you exchange left right the direction of search or the range of the search (min and max) has to be modified, we don't have that flexibility here so we flip the image horizontally.

What do you mean by flipping the image horizontally? In fact, we don't know the correct direction of search or the range of the search (min and max) at the very start so i think that the both sides of current pixel will be the best direction of search .Is it correct?

NiuKeke avatar May 13 '19 05:05 NiuKeke