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

Can the maximum stereo disparity of 128 be increased?

asked 2013-05-26 11:15:11 -0500

rdbrewer gravatar image

updated 2013-05-26 11:27:14 -0500


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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-05-30 14:58:34 -0500

rdbrewer gravatar image

updated 2014-11-18 01:34:53 -0500

Miquel Massot gravatar image

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)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-05-26 11:15:11 -0500

Seen: 706 times

Last updated: Nov 18 '14