Skip to content

TheFrey222/stereo_dense_reconstruction

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dense 3D Reconstruction from Stereo

This is a ROS package for real-time 3D reconstruction from stereo images. Currently this version uses LIBELAS for generating dense disparity maps as a baseline. The method for generation of disparity maps can be changed based on user preferences.

This package serves as a visualization tool for dense disparity maps and point clouds. Additionally, a tool for transforming point clouds to a different reference frame is also included.

Usually, the point clouds are formed in the reference frame of the left camera. For ground robots, often the point clouds need to be transformed to a different frame e.g., a reference frame with the origin at the centre of rotation of the robot projected on to the ground plane. These transformations are hard to calculate mathematically - this tool can be used to find the transformations visually.

Dependencies

Stereo Calibration

In this version, the camera streams need to be already undistorted and rectified (preferably with Kalibr). The rectified calibration file (zero distortion and so on) need to be stored in a ".yaml" file as in Kalibr.

Compiling

Clone the repository in your workspace:

$ git clone https://github.com/TheFrey222/stereo_dense_reconstruction

Build package:

$ catkin_make

Running Dense 3D Reconstruction

$ ./bin/dense_reconstruction [OPTION...]
Usage: dense_reconstruction [OPTION...]
  -l, --left_topic=STR       Left image topic name
  -r, --right_topic=STR      Right image topic name
  -c, --calib_file=STR       Stereo calibration file name
  -d, --debug=NUM            Set d=1 for cam to robot frame calibration

This node outputs the dense disparity map as a grayscale image on the topic /camera/left/disparity_map and the corresponding point cloud on the topic /camera/left/point_cloud.

Point Cloud Transformation

The point cloud can be viewed on rviz by running:

$ rviz

To transform the point cloud to a different reference frame, the XR and XT matrices (rotation and translation) in the calibration file need to be changed. This can be done real-time by the running:

$ rqt_reconfigure

If you change the Euler Angles in rqt_reconfigure you should be able to see the point cloud transform. Don't forget to set d=1 when running the dense_reconstruction node. This prints out the new transformation matrices as you transform the point cloud.

License

This software is released under the GNU GPL v3 license.

About

Dense 3D reconstruction from stereo (using LIBELAS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 95.9%
  • C 3.8%
  • Other 0.3%