This repository is an extension of Shichao Yang's CubeSLAM implementation which in turn is based on CubeSLAM: Monocular 3D Object SLAM, IEEE Transactions on Robotics 2019, S. Yang, S. Scherer PDF. It is the result of a collective effort by Andy Chen, Ezgi Cakir, and Leander Lauenburg during the cause of the practical course Advanced Topics of 3D computer vision. In addition to cleaning up, streamlining, and dockerizing CubeSLAM, we improved the work by adding dynamic object filtering, object class-dependent scaling, and embedding stream enrichments.
The project is written in C++ and based on ROS nodes. For a quick and easy installation we provide a Docker based setup as explained in the 'Quick Start' section.
- Clone this repo to
<your_path>/cubeslam/src/objectslam/. - Clone the Docker Ubuntu VNC repo.
- Replace the Dockerfile in the Docker Ubuntu VNC repo with the docker file provided in this repo.
- Open a terminal, navigate to the Docker Ubuntu VNC repo and run
sudo docker build -t at3dcv_2020. - After the image is build, run
sudo docker run -it --rm -p 6080:80 -v </your_path>/cubeslam/src/objectslam/:/mnt/ at3dcv_2020:latest. - Now open your browser and go to
http://127.0.0.1:6080/. - Accessing the Ubuntu instance via your browser open a terminal and run:
soure /opt/ros/kinetic/setup.bashcd /mnt/cubeslam/srcrun bash build.shcatkin_init_workspacesource /mnt/cubeslam/devel/setup.bashecho "source /mnt/cubeslam/devel/setup.bash" >> ~/.bashrc
- Make sure that the
ORBvoc.txtfile is located in theVocabularyfolder of theorb_object_slamfolder, with in your mountedobjectslamfolder. Should it not be present download the file from the orginal ORB_SLAM2 repo and place it into the mentioned folder. - Download this data folder containing the bag-file, bounding boxes, edge detections and convex hulls and place it, on the same level as the folder
cubeslam, in to a folderDatasets. - Open three terminals
- In each terminal run
soure /opt/ros/kinetic/setup.bash- `source /mnt/cubeslam/devel/setup.bash``
- Terminal one run:
roscore - Terminal two run:
rosbag play - 0.5 <path-to-datafolder>/freiburg3_walking_xyz.bag /camera/rgb/image_color:=/kitti/left/image_raw - Terminal tree run
- For mono: roslaunch
orb_object_slam tum_mono.launch - For RGB-D: roslaunch
orb_object_slam tum_rgbd.launch
- For mono: roslaunch
The whole data collection can be found here.
One of the main contributions of this repo is the generalization of the original CubeSLAM repo to be used with an arbitrary data set. This means, that the original repo was largely hard coded for the use of the Kitti sequence 2011_09_30_drive_0027.
For the example we choose the data set freiburg3_walking_xyz. We choose this set due to the challenging dynamic object, to test the robustness of the pipeline.
The data set can be found at the Dataset Download side of the chair of Computer Vision at TUM. We use the provided ROS bag-file to feed the data to the pipeline. The bag-file is already included in the data collection.
One of the main contributions of the original Paper is a method for the proposal of 3D cuboids, based one bounding boxes and edges detected in each frame. However, the relevant code in the original repo is not used and instead the author provided a text file that holds the optimal 3D cuboids for the frames of the names Kitti sequence. Therefore, we reversed engineered the format of the data needed for the calculation of the 3D cuboid proposals. We acquired the bounding boxes using Mask-RCNN and the edges using LSD edged detection. The bounding boxes as well as the detected edges are included in the data collection.
For each frame there is a file of the following format:
Object_class_obj_1 x_top_right_corner_obj_1 y_top_right_corner_obj_1 width_object_1 height_object_1 certainty_obj_1
Object_class_obj_2 x_top_right_corner_obj_2 y_top_right_corner_obj_2 width_object_2 height_object_2 certainty_obj_2
Object_class_obj_3 x_top_right_corner_obj_3 y_top_right_corner_obj_3 width_object_3 height_object_3 certainty_obj_3
...
For each frame there is a file of the following format:
x_0, y_0 ,x_1, y_1
x_0, y_0 ,x_1, y_1
Each row represents a single line.
Running the pipeline it became apparent that some cuboid proposals are quite off. We there for extended the cost function for the cuboid proposals by an additional term. The additional therm ensures, that in -
- 2D: The convex hulls of the instance segmentation mask provided by Mask-RCNN overlap with the 2D cuboid proposals.
- 3D: The vortices of the convex hulls, lifted to 3D using the depth map, lie insight the 3D cuboid proposals (the 2D proposals lifted to 3D based on ray intersection with the ground).
In both cases the convex hulls where acquired using opencv while the instance segmentation where acquired using Mask-RCNN. For each frame there exist a corresponding file containing the convex hulls of the detected segmentation masks. The format of the files is as follows:
x_1_obj_1, x_2_obj_1, x_3_obj_1, x_4_obj_1, x_5_obj_1, x_6_obj_1, x_7_obj_1, ..., x_n_obj_1
y_1_obj_1, y_2_obj_1, y_3_obj_1, y_4_obj_1, y_5_obj_1, x_6_obj_1, y_7_obj_1, ..., y_n_obj_1
x_1_obj_2, x_2_obj_2, x_3_obj_2, x_4_obj_2, x_5_obj_2, x_6_obj_2, x_7_obj_2, ..., x_n_obj_2
y_1_obj_2, y_2_obj_2, y_3_obj_2, y_4_obj_2, y_5_obj_2, x_6_obj_2, y_7_obj_2, ..., y_n_obj_2
..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...,
..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...,
x_1_obj_n, x_2_obj_n, x_3_obj_n, x_4_obj_n, x_5_obj_1n, x_6_obj_n, x_7_obj_n, ..., x_n_obj_n
y_1_obj_n, y_2_obj_n, y_3_obj_n, y_4_obj_n, y_5_obj_1n, x_6_obj_n, y_7_obj_n, ..., y_n_obj_n
