User manual
Table Of Contents
- Introduction
- Getting started with smallv
- Stereo Geometry
- Calibration
- API Reference – C++ Language
Small Vision System User Manual 24
2.4 Stereo Processing and Parameters
In smallv, stereo processing takes place in conjunction with the input of stereo images. The basic
cycle is:
get stereo pair -> process pair -> display pair
The input is either from live video or the buffer (Sections 2.1 and 2.1.9). In freeze mode, the same pair is
processed continuously, so adjustments can be made in stereo parameters.
2.4.1 Stereo Function
Stereo processing is turned on by choosing Stereo from the Function drop list. The stereo
disparity image will appear in the right display. Stereo disparities are encoded by green: brighter green is a
higher disparity, and therefore closer to the cameras (see Section 2.4.4 for a technical description of
disparity).
Disparities represent the distance between the horizontal appearance of an object in the stereo images.
The stereo process interpolates this distance to 1/16 pixel, e.g., a disparity value of 45 represents a
displacement of 2 13/16 pixels. The maximum displacement currently supported is 80 pixels, so disparity
values range from 0 (no disparity) to 1280. Disparity values are returned as 16-bit (short) integers. The
values 0xFFFF and 0xFFFE are reserved for filtering results (Section 2.5)
If smallv is running on an MMX processor (Pentium or AMD) then stereo processing is much
faster, taking advantage of the parallel data operations. The processor is queried and the MMX box is
checked if the instructions are available. You can turn the MMX processing on and off by toggling the
box. But, if your system does not have MMX instructions, you will not be able to turn it on.
2.4.2 3D Transformation
A pixel in the disparity image represents range to an object. This range, together with the position of
the pixel in the image, determines the 3D position of the object relative to the stereo rig. SVS contains a
function to convert disparity values to 3D points. These points can then be displayed in a 3D viewer.
To take the current disparity image and display it in 3D, press the 3D Display button. An OpenGL
window will show the 3D points constructed from the disparity image, and you can change the viewpoint
of the window to see the 3D structure (Figure 2-7).
The coordinate system for the 3D image is taken from the optic center of the left camera of the stereo
rig. Z is along the optic axis, with positive Z in front of the camera. X is along the camera scan lines,
positive values to the right when looking along the Z axis. Y is vertical, perpendicular to the scan lines,
with positive values down.
The X and Y position of the viewpoint, as well as rotation around the Z axis, can be changed with the
sliders on the left side of the window. The scale of the image can be changed as well. Finally, the
viewpoint can be rotated around a point in the image, to allow good assessment of the 3D quality of the
stereo processing. The rotation point is selected automatically by finding the point closest to the left
camera, near the optic ray of that camera. To rotate the image around this point, put the mouse in the 3D
window, and drag the pointer while holding the left button down.