Disparity map for dense trees

Hey there. I’m currently trying to make a depth map for some images of trees that I have, but I haven’t been able to make a good one yet.

Here’s an example of the images I’m trying to make a depth map for: orchard trees

If anyone needs the full dataset, I can provide a link.

I’m currently using Stereo_BM with the following parameters:

numDisparities: 256
preFilterSize: 5
preFilterCap: 61
setBlockSize: 9

I’ve tried all kinds of combinations of parameters, but nothing really gives a nice output. Here’s an example of the best outputs I’m getting.


I want to make a continuous depth map spanning multiple images, but the outputs I’m getting are way too noisy, and the ICP algorithm I’m using can’t find enough pairs to stitch the images together.

My question is, am I using the right tool? Should I be using something other than StereoBM for this kind of image? Or is this image not likely to produce a very good depth map no matter what, because of all the leaves? I’d like to add that I’ve also tried StereoSGBM, which gives a very similar output.

I’m very new to all of this, so I’d appreciate any help. Thanks!