![]() |
VisionWorks Toolkit ReferenceDecember 18, 2015 | 1.2 Release |
Stereo Matching Demo user guide.
nvx_demo_stereo_matching
is a simple stereo matching demo that uses Semi-Global Matching algorithm to evaluate disparity. It performs color conversion and downscaling prior to evaluating stereo for better quality and performance. The input images are expected to be undistorted and rectified. For more information on how to rectify the stereo pair, see OpenCV's Stereo Rectifation tutorial.
The pipeline can be illustrated by the following diagram:
(left frame) (right frame) | | [ScaleImage] (down) [ScaleImage] (down) | | [ColorConvert] (to gray) [ColorConvert] (to gray) | | +---------+ +----------+ | | [SemiGlobalMatching] | [ConvertDepth] (to 8-bit) | [ScaleImage] (up) | [Multiply] | (disparity image)
In the second step, the demo converts the disparity image into color output using the following pipeline:
(disparity image) | +------------------+------------------+ | | | [TableLookup] [TableLookup] [TableLookup] | | | (Red Channel) (Blue Channel) (Green Channel) | | | +------------------+------------------+ | [ChannelCombine] | (output image)
Color output is created using linear conversion of disparity values from [0..ndisp) interval into the HSV color space, where the smallest disparity (far objects) corresponds to [H=240, S=1, V=1] (blue color) and the largest disparity (near objects) corresponds to [H=0, S=1, V=1] (red color). The resulting HSV value is then converted to RGB color space for visualization.
nvx_demo_stereo_matching
is installed in the following directory:
/usr/share/visionworks/sources/demos/stereo_matching
For the steps to build sample applications, see the Samples and Demos section for your OS.
./nvx_demo_stereo_matching [options]
This topic provides a list of supported options and the values they consume.
--source=/path/to/image
for image--source=/path/to/video.avi
for video--source=/path/to/image_%04d_sequence.png
for image sequencesudo
.Description: Specifies the path to the configuration file.
The file contains the parameters of the stereo matching algorithm.
Usage:
./nvx_demo_stereo_matching --config=/path/to/config_file.ini
S
to switch between displaying the original frame, disparity image, and color output.Space
to pause/resume the demo.ESC
to close the demo.