stereo-vision
SFM

Structure From Motion (SFM) module for estimation of estrinsics parameter and computation of depth map.

Structure From Motion (SFM) module for estimation of estrinsics parameter and computation of depth map.

Copyright (C) 2015 RobotCub Consortium

Author: Sean Ryan Fanello, Giulia Pasquale

Date: first release around 24/07/2013

CopyPolicy: Released under the terms of the GNU GPL v2.0.

Description

The module uses a complete Structure From Motion (SFM) pipeline for the computation of the extrinsics parameters between two different views. These parameters are then used to rectify the images and to compute a depth map using either the H. Hirschmuller Algorithm (CVPR 2006), implemented since Opencv 2.2, or LIBELAS (Library for Efficient Large-scale Stereo Matching). The Kinematics of the iCub is used to guess the current camera positions, then visual features are used to refine this model. Before starting, make sure you have calibrated the intrinsics parameters. For the stereo calibration see the module stereoCalib. This module provides six output ports: the first one is the disparity map in grayscale values, the second and the third port are the WorldImage, which are a 3-channels float images, where in each pixel are stored the three Cartesian and the Cylindrical coordinates with respect to robot root reference frame. The fourth port outputs the current keypoints match. Non valid points are handled with the special value (0,0,0). The last two ports output the rectified images used to compute the horizontal disparity map. In addition, a rpc port supports requests for 3D/2D points computation (see below).

Note
If you're going to use this module for your work, please quote it within any resulting publication: Fanello S.R., Pattacini U., Gori I., Tikhanoff V., Randazzo M., Roncone A., Odone F., Metta G., "3D Stereo Estimation and Fully Automated Learning of Eye-Hand Coordination in Humanoid Robots", Proceedings of IEEE-RAS International Conference on Humanoid Robots, Madrid, Spain, November 18-20, 2014.

Libraries

YARP libraries and OpenCV 2.4 (at least).
For better performance, we suggest you to run the module on a machine equipped with GPU functionality along with the SiftGPU library installed. This module now uses LIBELAS by default to compute the horizontal disparity map from the rectified left and right images. The source code of LIBELAS is compiled with the stereoVisionLib (with no particular dependences). The OpenMP accelerated version of the LIBELAS is used under UNIX systems, if OpenMP is available.

Parameters

–name SFM

–from stereoCalibFile

–context stereoCalibContext

–robot robotName

–leftPort /left:i

–rightPort /right:i

–outLeftRectImgPort /rect_left:o

–outRightRectImgPort /rect_right:o

–outDispPort /disp:o

–outMatchPort /match:o

–outWorldPort /world

–CommandPort comm

–skipBLF

–use_sgbm

If you use LIBELAS, there is the possibility of setting the following parameters:

–disp_scaling_factor 1.0

–elas_setting ROBOTICS

Here we list those LIBELAS parameters that can be passed to this module; see elas.h for the complete list of parameters, their definitions and default values.

–elas_subsampling

–elas_add_corners

–elas_ipol_gap_width 40

Also the following LIBELAS parameters can be modified by the user, however we stick with the values provided by the authors.

–elas_support_threshold 0.85

–elas_gamma 3

–elas_sradius 2

–elas_match_texture true

–elas_filter_median false

–elas_filter_adaptive_mean true

Ports Created

Input Data Files

None.

Output Data Files

None.

Tested OS

Linux (Ubuntu 9.04, Debian Squeeze) and Windows 7. Tested against OpenCV versions: 2.4.

Author
Sean Ryan Fanello, Giulia Pasquale