2b-t / stereo-matching

Stereo-image depth reconstruction with different matching costs and matching algorithms in Python using Numpy and Numba
MIT License
58 stars 8 forks source link

Support for multiple cameras in stereo matching #2

Open bobble-git opened 1 year ago

bobble-git commented 1 year ago

I'm having trouble extending this code for multiple camera . Can you suggest a fix.

2b-t commented 1 year ago

Hi @bobbie-git, to be honest when writing it now over five years ago I never really though of using it with multiple cameras. Should be doable though. So you would like to do multi-camera stereo matching with more than two input images, right? Do you have some example images for what the input looks like? What matching algorithm are you interested in implementing?

bobble-git commented 1 year ago

Yes, I want to use multiple images rather than two, currently using the Middlebury stereo dataset Cones Dataset, and want to perform interpolation to scale the cost volumes. I want to use SGM as the matching algorithm. and for the cost function I'm using the weighted census cost function

2b-t commented 1 year ago

I am pretty busy during the week but I might have a look at it over the weekend. Not sure if I will have time to extend it but pretty sure that I can give you a hint on how to do it.

bobble-git commented 1 year ago

image

I'm trying to recreate the results of this paper Iterative Guided Gaussian

This is the image I've obtained using four images of the cones dataset by modifying your code, I think it is working. Need to get rid of these occlusion errors on the left side of the image. They were not so exaggerated in the paper even though he used the extreme left and right images of the dataset. Any suggestions? Can it be related to the fact that they are using 16 directions in SGM instead of using 4 directions like in your code. Could you tell me how to extend it to 16 directions.

the main modifications I've done are in the stereo_matching.py. There is another file called interpolate.py that performs the scaling of the cost volumes to the highest size

Code for interpolate.py changes made in stereo_matcing.py