GithubHelp home page GithubHelp logo

summertiger-yiyi / aligner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinruenz/aligner

0.0 0.0 0.0 14 KB

Aligner: Another pipeline for annotating object poses and labels for RGBD data

License: MIT License

Python 100.00%

aligner's Introduction

Aligner

Aligner is a tool to annotate the pose of known 3D objects in RGBD sequences. This information is useful to create datasets for evaluation or training purposes in domains such as object pose estimation. Its functionality is very similar to LabelFusion but aims to be more lightweight and easier to use.

The following steps are executed by Aligner automatically, asking for user-input when required:

  1. Recordings are extracted if necessary.
  2. Aligner computes the camera trajectory and a dense reconstruction.
  3. The user is asked to draw on each object in at least one frame. This annotation can be very rough and is only used to initialize the alignment later.
  4. Objects are aligned either automatically using 3D features or with user input (by selecting at least 3 correspondences) and a refinement is performed using ICP.

Note: Aligner uses a subdirectory in the output folder for each step. If a step needs to be repeated, simply delete the corresponding output files, otherwise the step is skipped during the next execution.

Example

In order to run Aligner, you need recordings in the klg format (or already extracted) and create a description for each sequences to let the software know which objects and camera calibration is used for which recording. An example is located in examples/sequences.toml. Settings, such as reconstruction parameters can be controlled via config.toml.

# TODO: Download example recording and meshes that work out of the box here
python3 aligner.py --run example/sequences.toml --config config.toml --data example/data

Useful commands:

  • Remove descriptions for all sequences (similar for other files)
find . -type f -iname sequence.toml -delete
  • Rename a parameter in descriptions for all sequences (similar for other files)
find . -type f -iname "sequence_filtered_new.toml" -exec sed -i s/poses_filtered_new.txt/poses_filtered.txt/g {} +

Data

Aligner generates the following files:

  • <data>/alignment/ A directory containing object to world space alignments, stored as 4x4 matrices in #.txt (where # is the object id).
  • <data>/annotations/ A directory containing #.png (16bit, # is frame index) frames which store the user provided masks.
  • <data>/frames/ A directory with color Color####.png and depth Depth####.png (16bit, , #### is frame index, in mm) frames.
  • <data>/reconstruction/ A directory containing model.ply and poses.txt.
  • <data>/recordings/ We usually place input sequences here, such as example-1.klg.

Workflow recommendations

  1. Only extract klg files and reconstruct trajectory and geometry (run in background for a while)
    enable_annotate_objects = false
    
  2. Only annotate objects
    show_intermediate_visualizations = false
    enable_annotate_objects = true
    enable_align_objects = false
    
  3. Only align objects
    enable_align_objects = true
    

Dependencies

Setup

Build script

git clone https://github.com/martinruenz/aligner.git
cd aligner

# dependencies
sudo apt install libsuitesparse-dev libudev-dev libjpeg-dev libusb-1.0-0-dev python3-tk liblz4-dev openctm-tools


mkdir third_party
cd third_party

# ElasticFusion
git clone https://github.com/mp3guy/ElasticFusion.git
cd ElasticFusion
mkdir -p deps
cd deps
## Pangolin
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ../ -DAVFORMAT_INCLUDE_DIR="" -DCPP11_NO_BOOST=ON
make -j8
cd ../..
## OpenNI2
git clone https://github.com/occipital/OpenNI2.git
cd OpenNI2
make -j8
cd ..
## EF
cd ../Core
mkdir build
cd build
cmake ../src
make -j8
cd ../../GUI
mkdir build
cd build
cmake ../src
make -j8
cd ../..

# ORB-SLAM2
git clone https://github.com/raulmur/ORB_SLAM2.git
cd ORB_SLAM2
wget -qO - https://github.com/raulmur/ORB_SLAM2/pull/585.diff | patch -p1
wget -qO - https://github.com/raulmur/ORB_SLAM2/pull/709.diff | patch -p1
./build.sh
cd ..

# Leave third_party
cd ..

# Collect symlinks to tools in ./third_party/bin
cd third_party
mkdir bin
cd bin
ln -s ../ElasticFusion/GUI/build/ElasticFusion ./
ln -s ../ORB_SLAM2/Examples/RGB-D/rgbd_tum orbslam2_rgbd_tum
cd ../..

Todos

Acknowledgements

This work has been supported by the SecondHands project, funded from the EU Horizon 2020 Research and Innovation programme under grant agreement No 643950.

aligner's People

Contributors

martinruenz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.