<commit_before>.. _normal_distributions_transform:

How to use Normal Distributions Transform
-----------------------------------------

In this tutorial we will describe how to use the Normal Distributions Transform (NDT) algorithm to determine a rigid transformation between two large point clouds, both over 100,000 points.  The NDT algorithm is a registration algorithm that uses standard optimization techniques applied to statistical models of 3D points to determine the most probable registration between two point clouds.  For more information on the inner workings of the NDT algorithm, see Dr. <NAME>'s doctoral thesis, “The Three-Dimensional Normal Distributions Transform – an Efficient Representation for Registration, Surface Analysis, and Loop Detection.”

The code
--------

First, download the datasets `room_scan1.pcd
<http://dev.pointclouds.org/attachments/download/801/room_scan1.pcd>`_ and `room_scan2.pcd
<http://dev.pointclouds.org/attachments/download/802/room_scan2.pcd>`_ and save them to your disk.  These point clouds contain 360 degree scans of the same room from different perspectives.

Then, create a file in your favorite editor and place the following inside.  I used ``normal_distributions_transform.cpp`` for this tutorial.

.. literalinclude:: sources/normal_distributions_transform/normal_distributions_transform.cpp
   :language: cpp
   :linenos:

The explanation
---------------

Now, let's breakdown this code piece by piece.

.. literalinclude:: sources/normal_distributions_transform/normal_distributions_transform.cpp
   :language: cpp
   :lines: 5-6

These are the required header files to use Normal Distributions Transform algorithm and a filter used to down sample the data.  The filter can be exchanged for other filters but I have found the approximate voxel filter to produce the best results.
<commit_msg>updated the location of the data files<commit_after>.. _normal_distributions_transform:

How to use Normal Distributions Transform
-----------------------------------------

In this tutorial we will describe how to use the Normal Distributions Transform (NDT) algorithm to determine a rigid transformation between two large point clouds, both over 100,000 points.  The NDT algorithm is a registration algorithm that uses standard optimization techniques applied to statistical models of 3D points to determine the most probable registration between two point clouds.  For more information on the inner workings of the NDT algorithm, see Dr. <NAME>'s doctoral thesis, “The Three-Dimensional Normal Distributions Transform – an Efficient Representation for Registration, Surface Analysis, and Loop Detection.”

The code
--------

First, download the datasets `room_scan1.pcd
<http://svn.pointclouds.org/data/tutorials/room_scan1.pcd>`_ and `room_scan2.pcd
<http://svn.pointclouds.org/data/tutorials/room_scan2.pcd>`_ and save them to your disk.  These point clouds contain 360 degree scans of the same room from different perspectives.

Then, create a file in your favorite editor and place the following inside.  I used ``normal_distributions_transform.cpp`` for this tutorial.

.. literalinclude:: sources/normal_distributions_transform/normal_distributions_transform.cpp
   :language: cpp
   :linenos:

The explanation
---------------

Now, let's breakdown this code piece by piece.

.. literalinclude:: sources/normal_distributions_transform/normal_distributions_transform.cpp
   :language: cpp
   :lines: 5-6

These are the required header files to use Normal Distributions Transform algorithm and a filter used to down sample the data.  The filter can be exchanged for other filters but I have found the approximate voxel filter to produce the best results.

{'fraction_non_alphanumeric': 0.08443129873621942, 'fraction_numerical': 0.010217800484001076, 'mean_word_length': 4.232067510548523, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3518669', 'n_tokens_mistral': 941, 'n_tokens_neox': 880, 'n_words': 428}