-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
887 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
.. _filters.teaser: | ||
|
||
filters.teaser | ||
============== | ||
|
||
The **TEASER filter** uses the Truncated least squares Estimation And | ||
SEmidefinite Relaxation (TEASER) algorithm to calculate a **rigid** | ||
transformation that best aligns two datasets. The first input to the ICP filter | ||
is considered the "fixed" points, and all subsequent points are "moving" | ||
points. The output from the filter are the "moving" points after the calculated | ||
transformation has been applied, one point view per input. The transformation | ||
matrix is inserted into the stage's metadata. | ||
|
||
|
||
Examples | ||
-------- | ||
|
||
.. code-block:: json | ||
[ | ||
"fixed.las", | ||
"moving.las", | ||
{ | ||
"type": "filters.teaser" | ||
}, | ||
"output.las" | ||
] | ||
To get the ``transform`` matrix, you'll need to use the ``--metadata`` option | ||
from the pipeline command: | ||
|
||
:: | ||
|
||
$ pdal pipeline teaser-pipeline.json --metadata teaser-metadata.json | ||
|
||
The metadata output might start something like: | ||
|
||
.. code-block:: json | ||
{ | ||
"stages": | ||
{ | ||
"filters.teaser": | ||
{ | ||
"centroid": " 583394 5.2831e+06 498.152", | ||
"composed": " 1 2.60209e-18 -1.97906e-09 -0.374999 8.9407e-08 1 5.58794e-09 -0.614662 6.98492e -10 -5.58794e-09 1 0.033234 0 0 0 1", | ||
"converged": true, | ||
"fitness": 0.01953125097, | ||
"transform": " 1 2.60209e-18 -1.97906e-09 -0.375 8.9407e-08 1 5.58794e-09 -0.5625 6.98492e -10 -5.58794e-09 1 0.00411987 0 0 0 1" | ||
} | ||
To apply this transformation to other points, the ``centroid`` and | ||
``transform`` metadata items can by used with ``filters.transformation`` in | ||
another pipeline. First, move the centroid of the points to (0,0,0), then apply | ||
the transform, then move the points back to the original location. For the | ||
above metadata, the pipeline would be similar to: | ||
.. code-block:: json | ||
[ | ||
{ | ||
"type": "readers.las", | ||
"filename": "in.las" | ||
}, | ||
{ | ||
"type": "filters.transformation", | ||
"matrix": "1 0 0 -583394 0 1 0 -5.2831e+06 0 0 1 -498.152 0 0 0 1" | ||
}, | ||
{ | ||
"type": "filters.transformation", | ||
"matrix": "1 2.60209e-18 -1.97906e-09 -0.375 8.9407e-08 1 5.58794e-09 -0.5625 6.98492e -10 -5.58794e-09 1 0.00411987 0 0 0 1" | ||
}, | ||
{ | ||
"type": "filters.transformation", | ||
"matrix": "1 0 0 583394 0 1 0 5.2831e+06 0 0 1 498.152 0 0 0 1" | ||
}, | ||
{ | ||
"type": "writers.las", | ||
"filename": "out.las" | ||
} | ||
] | ||
.. note:: | ||
The ``composed`` metadata matrix is a composition of the three transformation steps outlined above, and can be used in a single call to ``filters.transformation`` as opposed to the three separate calls. | ||
.. seealso:: | ||
:ref:`filters.transformation` to apply a transform to other points. | ||
Options | ||
-------- | ||
nr | ||
Radius to use for normal estimation. [Default: **0.02**] | ||
fr | ||
Radius to use when computing features. [Default: **0.04**] | ||
fpfh | ||
Use FPFH to find correspondences? [Default: **true**] | ||
.. include:: filter_opts.rst | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#cmake_minimum_required(VERSION 3.1...3.15) | ||
#project(pdalteaser) | ||
|
||
find_package(OpenMP QUIET REQUIRED) | ||
set_package_properties(OpenMP PROPERTIES | ||
TYPE OPTIONAL | ||
URL "https://www.openmp.org" | ||
PURPOSE "TEASER++ support") | ||
mark_as_advanced(CLEAR OpenMP_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR OpenMP_LIBRARIES) | ||
if(NOT OpenMP_CXX_FOUND) | ||
message(FATAL_ERROR "This project requires the OpenMP library.") | ||
endif() | ||
|
||
find_package(teaserpp REQUIRED) | ||
set_package_properties(teaserpp PROPERTIES | ||
TYPE OPTIONAL | ||
URL "https://teaser.readthedocs.io/en/latest/" | ||
PURPOSE "TEASER++ support") | ||
mark_as_advanced(CLEAR teaserpp_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR teaserpp_LIBRARIES) | ||
if (NOT teaserpp_FOUND) | ||
message(FATAL_ERROR "This project requires the TEASER++ library.") | ||
endif() | ||
|
||
#find_package(PDAL REQUIRED CONFIG) | ||
#if (NOT PDAL_FOUND) | ||
# message(FATAL_ERROR "This project requires the PDAL library, and will not be compiled.") | ||
#endif() | ||
|
||
find_package(PCL 1.9 REQUIRED COMPONENTS common features kdtree) | ||
set_package_properties(PCL PROPERTIES | ||
TYPE OPTIONAL | ||
URL "https://pointclouds.org/" | ||
PURPOSE "TEASER++ support") | ||
mark_as_advanced(CLEAR PCL_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR PCL_LIBRARIES) | ||
if (NOT PCL_FOUND) | ||
message(FATAL_ERROR "This project requires the Point Cloud Library.") | ||
endif() | ||
|
||
#include_directories(${PDAL_INCLUDE_DIRS}) | ||
#add_library(pdal_plugin_filter_teaser SHARED TeaserFilter.cpp) | ||
#link_directories(${PDAL_LIBRARY_DIRS}) | ||
#target_link_libraries(pdal_plugin_filter_teaser ${PDAL_LIBRARIES} teaserpp::teaser_registration teaserpp::teaser_features OpenMP::OpenMP_CXX ${PCL_LIBRARIES}) | ||
|
||
PDAL_ADD_PLUGIN(filter_libname filter teaser | ||
FILES | ||
filters/TeaserFilter.cpp | ||
LINK_WITH | ||
teaserpp::teaser_registration | ||
teaserpp::teaser_features | ||
OpenMP::OpenMP_CXX | ||
${PCL_LIBRARIES} | ||
INCLUDES | ||
${CMAKE_CURRENT_LIST_DIR} | ||
) | ||
|
||
if (WITH_TESTS) | ||
PDAL_ADD_TEST(pdal_filters_teaser_test | ||
FILES | ||
test/TeaserFilterTest.cpp | ||
LINK_WITH | ||
${filter_libname} | ||
INCLUDES | ||
"${PDAL_VENDOR_DIR}/eigen" | ||
) | ||
endif() |
Oops, something went wrong.