User manual
Table Of Contents
- Introduction
- Getting started with smallv
- Stereo Geometry
- Calibration
- API Reference – C++ Language
Small Vision System User Manual 56
5.4.3 Rectification Information
bool isRectified; // have we done the rectification already?
bool haveRect; // true if the rectification params exist
svsRectParams rp; // rectification params, if they exist
The images contained in a stereo image object (left, right and left-color) can be rectified, that is,
corrected for intra-image (lens distortions) and inter-image (spatial offset) imperfections. If the images are
rectified, then the variable
isRectified will be true.
Rectification takes place in the
svsAcquireImage classes, which can produce rectified images
using the rectification parameters. The rectification parameters can be carried along with the stereo image
object, where they are useful in further processing, for example, in converting disparity images into a 3D
point cloud.
If rectification parameters are present, the
haveRect variable is true. The rectification parameters
themselves are in the
rp variable.
5.4.4 Disparity Image
bool haveDisparity; // have we calculated the disparity yet?
svsDisparityParams dp; // disparity image parameters
short *Disparity(); // returns the disparity image
The disparity image is computed from the stereo image pair by an svsStereoProcess object. It is
an array of short integers (signed, 16 bits) in the same frame size as the input stereo images. The image
size can be found in the
ip variable. It is registered with the left stereo image, so that a disparity pixel at
X,Y of the disparity image corresponds to the X,Y pixel of the left input image. Values of –1 and –2
indicate no disparity information is present: -1 is for low-texture areas, and –2 is for disparities that fail the
left/right check.
If the disparity image has been calculated and is present, then
haveDisparity is true. The
parameters used to compute the disparity image (number of disparities, horopter offset, and so on) are in
the parameter variable
dp.
The disparity image can be retrieved using the Disparity function. This function returns a pointer
to the disparity array, so it is very efficient. User programs should not delete this array, since it is managed
by the stereo object.
5.4.5 3D Point Array
bool have3D; // do we have 3D information?
int numPoints; // number of points actually found
float *X(), *Y(), *Z(); // 3D point arrays
The 3D point arrays are the 3D points that correspond to each pixel in the left input image. It has the
same size (width and height) as the input stereo images. The 3D point array is computed from the disparity
image using the external camera calibration parameters stored in
rp. An svsStereoProcess object
must be used to compute it.
Each point is represented by a coordinate (X,Y,Z) in a frame centered on the left camera focal point.
The Z dimension is distance from the point perpendicular to the camera plane, and is always positive for
valid disparity values. The X axis is horizontal and the positive direction is to the right of the center of the