Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TEASER++: fast & certifiable 3D registration
# TEASER++: fast & certifiable 3D registration
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation Status](https://readthedocs.org/projects/teaser/badge/?version=latest)](https://teaser.readthedocs.io/en/latest/?badge=latest)
[<img src="https://github.com/MIT-SPARK/TEASER-plusplus/workflows/build/badge.svg">](https://github.com/MIT-SPARK/TEASER-plusplus/actions)
Expand Down Expand Up @@ -97,11 +97,11 @@ sudo apt install cmake libeigen3-dev libboost-all-dev
conda create -n teaser_test python=3.6 numpy
conda activate teaser_test
conda install -c open3d-admin open3d=0.9.0.0

git clone https://github.com/MIT-SPARK/TEASER-plusplus.git
cd TEASER-plusplus && mkdir build && cd build
cmake -DTEASERPP_PYTHON_VERSION=3.6 .. && make teaserpp_python
cd python && pip install .
cd ../.. && cd examples/teaser_python_ply
cd TEASER-plusplus
pip install .
cd examples/teaser_python_ply
python teaser_python_ply.py
```
You should see output similar to this:
Expand Down Expand Up @@ -137,19 +137,20 @@ Number of outliers: 1700
Time taken (s): 0.9492652416229248
```

### Reproduce the GIF Above
### Reproduce the GIF Above
Run the following script:
```shell script
sudo apt install cmake libeigen3-dev libboost-all-dev
conda create -n teaser_3dsmooth python=3.6 numpy
conda activate teaser_3dsmooth
conda install -c open3d-admin open3d=0.9.0.0
conda install scikit-learn
conda install scikit-learn

git clone https://github.com/MIT-SPARK/TEASER-plusplus.git
cd TEASER-plusplus && mkdir build && cd build
cmake -DTEASERPP_PYTHON_VERSION=3.6 .. && make teaserpp_python
cd python && pip install .
cd ../.. && cd examples/teaser_python_3dsmooth
cd TEASER-plusplus
pip install .

cd examples/teaser_python_3dsmooth
python teaser_python_3dsmooth.py
```
You should be able to see Open3D windows showing registration results:
Expand Down
2 changes: 0 additions & 2 deletions cmake/teaserppConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ get_filename_component(TEASERPP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(CMakeFindDependencyMacro)

find_dependency(Eigen3 3.3 REQUIRED)
find_dependency(OpenMP REQUIRED)

include("${TEASERPP_CMAKE_DIR}/teaserppTargets.cmake")

14 changes: 2 additions & 12 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,13 @@ Make sure you have compiled the project, then run:
Installing Python bindings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TEASER++ uses `pybind11 <https://github.com/pybind/pybind11>`_ to allow for minimal-effort interoperability between C++ and Python. To compile Python binding, run the following in the ``build`` folder you just created:
TEASER++ uses `pybind11 <https://github.com/pybind/pybind11>`_ to allow for minimal-effort interoperability between C++ and Python. To compile Python binding, run the following in the cloned repository you just created:

.. code-block:: sh

cmake -DTEASERPP_PYTHON_VERSION=3.6 ..
make teaserpp_python

You can replace ``3.6`` with the desired Python version you want to use TEASER++ with.

Then, in the `build` folder, there should be a folder named ``python``. You can use the following commands to install the binding with ``pip``:

.. code-block:: sh

cd python
pip install .

If you are using virtual environments or Anaconda, make sure to activate your environment before compiling and during ``pip install``. Make sure the targeted Python interpreter is the one in your desired environment, or otherwise there might be segmentation faults.
If you are using virtual environments or Anaconda, make sure to activate your environment before run ``pip install``.

Installing MATLAB Bindings
^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions teaser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ target_include_directories(teaser_registration
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
$<BUILD_INTERFACE:${spectra_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
)
if(NOT BUILD_SHARED_LIBS)
set_property(TARGET teaser_registration PROPERTY POSITION_INDEPENDENT_CODE 1)
endif()

find_package(OpenMP)
if(OpenMP_CXX_FOUND)
target_link_libraries(teaser_registration PUBLIC OpenMP::OpenMP_CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
target_link_libraries(teaser_registration PRIVATE OpenMP::OpenMP_CXX)
endif()

add_library(teaserpp::teaser_registration ALIAS teaser_registration)
Expand Down
7 changes: 3 additions & 4 deletions teaser/include/teaser/registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include <Eigen/SVD>
#include <Eigen/Geometry>

#include "omp.h"

#include "teaser/graph.h"
#include "teaser/geometry.h"

Expand All @@ -26,6 +24,8 @@

namespace teaser {

int teaser_default_max_threads();

/**
* Struct to hold solution to a registration problem
*/
Expand Down Expand Up @@ -418,7 +418,6 @@ class RobustRegistrationSolver {
* Note: the default values needed to be changed accordingly for best performance.
*/
struct Params {

/**
* A bound on the noise of each provided measurement.
*/
Expand Down Expand Up @@ -511,7 +510,7 @@ class RobustRegistrationSolver {
/**
* Number of threads used for the maximum clique solver
*/
int max_clique_num_threads = omp_get_max_threads();
int max_clique_num_threads = teaser_default_max_threads();
};

RobustRegistrationSolver() = default;
Expand Down
2 changes: 1 addition & 1 deletion teaser/src/certification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <Spectra/SymEigsShiftSolver.h>

#include "teaser/certification.h"
#include "teaser/linalg.h"
#include "linalg.h" // private header for testing

teaser::CertificationResult
teaser::DRSCertifier::certify(const Eigen::Matrix3d& R_solution,
Expand Down
2 changes: 2 additions & 0 deletions teaser/include/teaser/linalg.h → teaser/src/linalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <iostream>

#include <omp.h>

#include <Eigen/Core>
#include <Eigen/SparseCore>
#include <Eigen/Eigenvalues>
Expand Down
6 changes: 6 additions & 0 deletions teaser/src/registration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
#include <limits>
#include <iterator>

#include <omp.h>

#include "teaser/utils.h"
#include "teaser/graph.h"
#include "teaser/macros.h"

int teaser::teaser_default_max_threads() {
return omp_get_max_threads();
}

void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
const Eigen::RowVectorXd& ranges, double* estimate,
Eigen::Matrix<bool, 1, Eigen::Dynamic>* inliers) {
Expand Down
6 changes: 6 additions & 0 deletions test/teaser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ endif ()
# Executable for running unit tests
add_executable(all_tests ${TEST_SRCS})
target_link_libraries(all_tests ${TEST_LINK_LIBRARIES})
target_include_directories(all_tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../teaser/src)

find_package(OpenMP)
if(OpenMP_CXX_FOUND)
target_link_libraries(all_tests OpenMP::OpenMP_CXX)
endif()

gtest_add_tests(TARGET all_tests
TEST_LIST allTests)
Expand Down
2 changes: 1 addition & 1 deletion test/teaser/linalg-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <Eigen/Core>

#include "teaser/linalg.h"
#include "linalg.h"

TEST(LinalgTest, HatMap) {
{
Expand Down