Stereo Vision Experiment

Introduction

For the Fontys University of Applied Science S5 project I was required to write an C++ program to detect objects in a space. The purpose of the experiment was to check if it was feasible to detect these objects in real-time.

Setup

For the experiment I used 2 Sitecom VP-004 camera's and our trusty lab PC. These camera's where placed 9cm apart and 1 meter form the objects (direction of red arrow):

The blue arrows indicate the direction of natural light sources (3 windows). The wall shown in the movies below was 4 meters behind the objects.

C++ program

The C++ program uses the videolab video components for Borland C++ builder to capture and process the data from the webcams. It also contains some settings the change parameters for maximum disparity, window size, minimum object size, error function, etc, etc.

Disparity Algorithm

The program uses the disparity algorithm as described by Luigi Di Stefanoa, Massimiliano Marchionni and Stefano Mattoccia in the paper: A fast area-based stereo matching algorithm. All credits should go to them, as I only translated their proposal to an actual C++ implementation.

Object detection Algorithm

The object detection algorithm works by dividing the disparity map in a 16×16 matrix and calculating the average disparity in every sub-area. After which a recursive function searches for adjacent areas with a average disparity large then the threshold. There area's would indicate an object are outlined.

Results

With some optimization the program is able to calculate 10 frames per second

Video showing 'real-time' calculation of the disparity map.

(If Flash is installed and JavaScript is activated, you can watch a video inside this web page.)



The following video is made with the same program. Only this time the data is saved as an AVI movie and speeded up to 6 FPS instead of 0.2 FPS:

(If Flash is installed and JavaScript is activated, you can watch a video inside this web page.)



Downloads

You can download the source code for this experiment here: stereo_vision.zip (3.2 MB)
Note: You also need to install the videolab components for Borland C++ Builder (also available for Microsoft Visual C++)

cplusplus/stereo_vision.txt · Last modified: 2009/04/27 14:29 (external edit)
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0