VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Stereo Matching Demo App

Stereo Matching Demo user guide.

Introduction

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.

Pipeline Details

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.

Installation and Usage

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.

Executing the Stereo Matching Demo

./nvx_demo_stereo_matching [options]

Command Line Options

This topic provides a list of supported options and the values they consume.

-s, --source

Note
The V4L platform has a permissions issue. The hardware decoder is used and the demo must be executed with super user permissions, i.e., with sudo.

-c, --config

-h, --help

Operational Keys