Distance between those two projected points is known as “disparity” and we can use the disparity value to calculate depth information, which is the distance between real-world point “P” and the stereo vision system.

disparity = uL – uR = f * b/z

depth = f * b/disparity

In reality, an actual stereovision setup is more complex and would look more like the typical system shown in Figure 4, but all of the same fundamental principles still apply.

alt
Figure 3. Simplified stereovision system.

The ideal assumptions made for the simplified stereovision system cannot be made for real-world stereovision applications. Even the best cameras and lenses will introduce some level of distortion to the image acquired, and in order to compensate, a typical stereovision system also requires calibration. The calibration process involves using a calibration target — for example, a grid of dots or a checkerboard — and acquiring images at different angles to calculate image distortion, as well as the exact spatial relationship between the two cameras.

In order to optimize the accuracy of a stereovision system setup, and accurately relate calculated image disparity to true depth data, there are several considerations and parameters to keep in mind.

For a simple stereo system, the depth of a point (z) is given by:

Z = f * b/d

where f is the focal length, b is the baseline, or distance between the cameras, and d the disparity between corresponding points.

When relating depth to disparity, it is important to note that as depth decreases, disparity increases exponentially, as illustrated in Figure 5.

alt
Figure 4. Typical stereovision system.

Depth resolution refers to the accuracy with which a stereovision system can estimate changes in the depth of a surface. Depth resolution is proportional to the square of the depth and the disparity resolution, and is inversely proportional to the focal length and the baseline, or distance between the cameras. Good depth resolution requires a large baseline value, a large focal length value, and a small depth value for a given disparity resolution.

Stereovision Applications

Stereovision is well suited to applications that require locating objects or obstacles, and this location data can be used to guide the movement of a robot or robotic arm. For navigating auto - nomous vehicles, depth information is used to measure the size and distance of obstacles for accurate path planning and obstacle avoidance. Stereovision systems can provide a rich set of 3D information for navigation applications, and can perform well even in changing light conditions.

alt
Figure 5. Disparity values as a function of depth, assuming a focal length of 8 mm, baseline of 10 cm, and pixel size of 7.5 microns.

A stereovision system is also useful in robotic industrial automation of tasks such as bin-picking or depalletization. A bin-picking application requires a robot arm to pick a specific object from a container that holds several different kinds of parts. A stereovision system can provide an inexpensive way to obtain 3D information and determine which parts are free to be grasped. It can also provide precise locations for individual products in a crate.

This article was written by Dinesh Nair, Chief Architect at National Instruments, Austin, TX. For more information, Click Here.