User manual
Small Vision System User Manual 65
5.8 Stereo Processing Classses
svsStereoProcess
Stereo processing class
svsMultiProcess
Multiscale stereo processing class
The stereo processing classses perform stereo processing on stereo images encapsulated in an
svsStereoImage object. The results are stored in the stereo image object. All relevant parameters,
such as calibration information and stereo parameters, are also part of the stereo image object.
The processing class svsStereoProcess handles basic disparity calculation, as well as
conversion of the disparity image into 3D points.
The processing class svsMultiProcess extends stereo processing to perform multiple scale stereo
processing in computing the disparity image. Multiscale processing adds information from stereo
processing at reduced image sizes.
5.8.1 Stereo and 3D Processing
svsStereoProcess()
~svsStereoProcess()
bool CalcStereo(svsStereoImage *si)
bool Calc3D(svsStereoImage *si)
bool CalcPoint3D(int x, int y, svsStereoImage *si,
double *X, double *Y, double *Z)
CalcStereo() calculates a disparity image and stores it in si, assuming si contains a stereo
image pair and its haveDisparity flag is false. To recalculate the stereo results (having set new
stereo processing parameters), set the haveDisparity flag to false and call CalcStereo().
Calc3D() calculates a 3D point array from the disparity image of si. If si does not have a
disparity image, then it is first calculated, and then the point array is computed. The point array is stored
in the stereo image object, and the have3D flag is set.
For some applications, computing the whole 3D array is not necessary; only certain points are needed.
In this case, the function CalcPoint3D() is provided. This function returns true if the disparity at
image point x,y exists, and puts the corresponding 3D values into the X,Y,Z variables. Otherwise, it
returns false and does not change X,Y, or Z.
5.8.2 Multiscale Stereo Processing
svsMultiProcess()
~svsMultiProcess()
bool doIt
This multiscale class computes stereo disparity at the input image resolution, and also at a x2 reduced
image size, then combines the results. Multiscale processing adds additional information, filling in parts
of the disparity image that may be missed at the higher resolution.
The svsMultiProcess class subclasses svsStereoProcess, and is used in exactly the same
way. The boolean variable doIt turns the multiscale processing on or off.