ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange

# Can the maximum stereo disparity of 128 be increased?

Hello,

I have built a high-resolution stereo camera (two Prosilica GC2450-C cameras running at full-res), and I'm obtaining beautiful point-clouds that require both min_disparity and disparity_range to be set to 128. Unfortunately, I need to lengthen the target object such that I need disparity_range higher than 128. I know the slider for disparity_range maxes out at 128 in stereo_image_proc, but I'm wondering if there's a way to hack around that maximum (or if 128 is a fundamental maximum in the stereo code). If it can be hacked, do you have suggestions for how to do so? I'm a mechanical engineer trying to code, so sorry if this is a noob question.

edit retag close merge delete

Sort by ยป oldest newest most voted

Solution: There's no inherent limit of 128 in the openCV stereo matching code on the maximum value for min_disparity or disparity_range. It's just a hard-coded maximum in stereo_image_proc.

To increase these limits, make the following code change in stereo_image_proc/cfg/Disparity.cfg and recompile stereo_image_proc. Disparity_range must always be an increment of 16 (probably the same for min_disparity, but not sure).

In the following code, all we did was change the range of min_disparity to [-1024, 1024].

Index: stereo_image_proc/cfg/Disparity.cfg

+++ stereo_image_proc/cfg/Disparity.cfg (working copy)
+gen.add("min_disparity", int_t, 0, "Disparity to begin search at, pixels (may be negative)", 0, -1024, 1024)
gen.add("disparity_range", int_t, 0, "Number of disparities to search, pixels", 64, 32, 128)

more