2

I have 2 stereo images with me and the quality of depth map depends on the BlockSize and DisparityRange parameters of the disparity function. Currently I fix them by trying few different values for it.

Is there a better way (code or matlab function) to fix these parameters, maybe also automatically?

Reference

Dima
  • 38,860
  • 14
  • 75
  • 115
Abhishek
  • 3,337
  • 4
  • 32
  • 51
  • @Abhishek You're question is fine. It's true, those parameter are hard to get. In general, blockSize is more user choice. Not too small to avoid noice and not too big to keep details. But for disparityRange, it's really depending on your scene. Most of the time stereo except small movement between camera. So your disparityRange should not be a big interval. – Vuwox Jun 11 '14 at 13:23
  • @AlexandreBizeau Thanks for the reply. I am aware of these facts. Just wanted to confirm about some code/function for automatically computing the best values. Thanks again for the reply :) – Abhishek Jun 11 '14 at 13:39
  • @Abhishek I don't know. Maybe, you can try with cross-validation. But for that you'll need an automatic function to compare image and a score function on those image. And I think, this doesn't exist. – Vuwox Jun 11 '14 at 13:44

1 Answers1

1

First question: which version of MATLAB are you using? Older releases have been using the simple block matching algorithm, which is not very robust. The latest release (R2014a) is using the Semi-Global Block Matching algorithm by default, which is much better.

'DisparityRange' depends on the distance from the camera to the objects of interest. Disparity is inversely proportional to distance from the camera, so if you want to reconstruct the objects that are close to the camera, you would need to increase the disparity range.

Increasing the 'BlockSize' helps if your scene has little texture.

Other things you could try is low-pass filter the input stereo images and/or apply the median filter to the output disparity map.

Dima
  • 38,860
  • 14
  • 75
  • 115
  • yeah I am using an old version, R2011b. I will surely try both the filters suggested by you. Thank you so much for a clear and simple reply. – Abhishek Aug 04 '14 at 14:32