![nanoflann](https://raw.githubusercontent.com/jlblancoc/nanoflann/master/doc/logo.png)
# nanoflann
[![Build Status](https://travis-ci.org/jlblancoc/nanoflann.svg?branch=master)](https://travis-ci.org/jlblancoc/nanoflann)
## 1. About
*nanoflann* is a **C++11 [header-only](http://en.wikipedia.org/wiki/Header-only) library** for building KD-Trees of datasets with different topologies: R<sup>2</sup>, R<sup>3</sup> (point clouds), SO(2) and SO(3) (2D and 3D rotation groups). No support for approximate NN is provided. *nanoflann* does not require compiling or installing. You just need to `#include <nanoflann.hpp>` in your code.
This library is a *fork* of the [flann library](http://www.cs.ubc.ca/research/flann/) ([git](https://github.com/mariusmuja/flann)) by Marius Muja and David G. Lowe, and born as a child project of [MRPT](https://www.mrpt.org/). Following the original license terms, *nanoflann* is distributed under the BSD license. Please, for bugs use the issues button or fork and open a pull request.
Cite as:
```
@misc{blanco2014nanoflann,
title = {nanoflann: a {C}++ header-only fork of {FLANN}, a library for Nearest Neighbor ({NN}) with KD-trees},
author = {Blanco, Jose Luis and Rai, Pranjal Kumar},
howpublished = {\url{https://github.com/jlblancoc/nanoflann}},
year = {2014}
}
```
### 1.1. Obtaining the code
* Easiest way: clone this GIT repository and take the `include/nanoflann.hpp` file for use where you need it.
* macOS users can install `nanoflann` with [Homebrew](https://brew.sh) with:
```shell
$ brew install brewsci/science/nanoflann
```
or
```shell
$ brew tap brewsci/science
$ brew install nanoflann
```
* Linux users can install it with [Linuxbrew](https://linuxbrew.sh/) with: `brew install homebrew/science/nanoflann`
* List of [**stable releases**](https://github.com/jlblancoc/nanoflann/releases). Check out the [CHANGELOG](https://raw.githubusercontent.com/jlblancoc/nanoflann/master/CHANGELOG.txt)
Although nanoflann itself doesn't have to be compiled, you can build some examples and tests with:
sudo apt-get install build-essential cmake libgtest-dev libeigen3-dev
mkdir build && cd build && cmake ..
make && make test
### 1.2. C++ API reference
* Browse the [Doxygen documentation](http://jlblancoc.github.io/nanoflann/).
* **Important note:** If L2 norms are used, notice that search radius and all passed and returned distances are actually *squared distances*.
### 1.3. Code examples
* KD-tree look-up with `kdd_search()` and `radius_search()`: [pointcloud_kdd_radius.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/pointcloud_kdd_radius.cpp)
* KD-tree look-up on a point cloud dataset: [pointcloud_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/pointcloud_example.cpp)
* KD-tree look-up on a dynamic point cloud dataset: [dynamic_pointcloud_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/dynamic_pointcloud_example.cpp)
* KD-tree look-up on a rotation group (SO2): [SO2_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/SO2_adaptor_example.cpp)
* KD-tree look-up on a rotation group (SO3): [SO3_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/SO3_adaptor_example.cpp)
* KD-tree look-up on a point cloud dataset with an external adaptor class: [pointcloud_adaptor_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/pointcloud_adaptor_example.cpp)
* KD-tree look-up directly on an `Eigen::Matrix<>`: [matrix_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/matrix_example.cpp)
* KD-tree look-up directly on `std::vector<std::vector<T> >` or `std::vector<Eigen::VectorXd>`: [vector_of_vectors_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/vector_of_vectors_example.cpp)
* Example with a `Makefile` for usage through `pkg-config` (for example, after doing a "make install" or after installing from Ubuntu repositories): [example_with_pkgconfig/](https://github.com/jlblancoc/nanoflann/blob/master/examples/example_with_pkgconfig/)
* Example of how to build an index and save it to disk for later usage: [saveload_example.cpp](https://github.com/jlblancoc/nanoflann/blob/master/examples/saveload_example.cpp)
### 1.4. Why a fork?
* **Execution time efficiency**:
* The power of the original `flann` library comes from the possibility of choosing between different ANN algorithms. The cost of this flexibility is the declaration of pure virtual methods which (in some circumstances) impose [run-time penalties](http://www.cs.cmu.edu/~gilpin/c%2B%2B/performance.html#virtualfunctions). In `nanoflann` all those virtual methods have been replaced by a combination of the [Curiously Recurring Template Pattern](http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) (CRTP) and inlined methods, which are much faster.
* For `radiusSearch()`, there is no need to make a call to determine the number of points within the radius and then call it again to get the data. By using STL containers for the output data, containers are automatically resized.
* Users can (optionally) set the problem dimensionality at compile-time via a template argument, thus allowing the compiler to fully unroll loops.
* `nanoflann` allows users to provide a precomputed bounding box of the data, if available, to avoid recomputation.
* Indices of data points have been converted from `int` to `size_t`, which removes a limit when handling very large data sets.
* **Memory efficiency**: Instead of making a copy of the entire dataset into a custom `flann`-like matrix before building a KD-tree index, `nanoflann` allows direct access to your data via an **adaptor interface** which must be implemented in your class.
Refer to the examples below or to the C++ API of [nanoflann::KDTreeSingleIndexAdaptor<>](http://jlblancoc.github.io/nanoflann/classnanoflann_1_1KDTreeSingleIndexAdaptor.html) for more info.
### 1.5. What can *nanoflann* do?
* Building KD-trees with a single index (no randomized KD-trees, no approximate searches).
* Fast, thread-safe querying for closest neighbors on KD-trees. The entry points are:
* [nanoflann::KDTreeSingleIndexAdaptor<>](http://jlblancoc.github.io/nanoflann/classnanoflann_1_1KDTreeSingleIndexAdaptor.html)`::knnSearch()`
* Finds the `num_closest` nearest neighbors to `query_point[0:dim-1]`. Their indices are stored inside the result object. See an [example usage code](https://github.com/jlblancoc/nanoflann/blob/master/examples/pointcloud_kdd_radius.cpp#L119).
* [nanoflann::KDTreeSingleIndexAdaptor<>](http://jlblancoc.github.io/nanoflann/classnanoflann_1_1KDTreeSingleIndexAdaptor.html)`::radiusSearch()`
* Finds all the neighbors to `query_point[0:dim-1]` within a maximum radius. The output is given as a vector of pairs, of which the first element is a point index and the second the corresponding distance. See an [example usage code](https://github.com/jlblancoc/nanoflann/blob/master/examples/pointcloud_kdd_radius.cpp#L141).
* [nanoflann::KDTreeSingleIndexAdaptor<>](http://jlblancoc.github.io/nanoflann/classnanoflann_1_1KDTreeSingleIndexAdaptor.html)`::radiusSearchCustomCallback()`
* Can be used to receive a callback for each point found in range. This may be more efficient in some situations instead of building a huge vector of pairs with the results.
* Working with 2D and 3D point clouds or N-dimensional data sets.
* Working directly with `Eigen::Matrix<>` classes (matrices and vectors-of-vectors).
* Working with dynamic point clouds without a need to rebuild entire kd-tree index.
* Working with the distance metrics:
* `R^N`: Euclidean spaces:
* `L1` (Manhattan)
* `L2` (**squared** Euclidean norm, favoring SSE2 optimization).
* `L2_Simple` (**squared** Euclidean norm, for low-dimensionality data sets like point clouds).
没有合适的资源?快使用搜索试试~ 我知道了~
官网的最新版本cloudcompare2.13
共2000个文件
h:588个
cpp:415个
png:368个
需积分: 0 3 下载量 20 浏览量
2023-09-14
19:24:47
上传
评论
收藏 35.39MB ZIP 举报
温馨提示
本人已在cmake编译使用正常
资源推荐
资源详情
资源评论
收起资源包目录
官网的最新版本cloudcompare2.13 (2000个子文件)
CloudCompare.1 777B
compileFinalVersion.bat 422B
compile.bat 243B
run_moc.bat 135B
start.bat 29B
io.c 131KB
merge.c 119KB
shpopen.c 114KB
poly2.c 112KB
dbfopen.c 87KB
global.c 74KB
unzip.c 69KB
zip.c 68KB
geom2.c 65KB
rply.c 55KB
libqhull.c 51KB
shptree.c 48KB
geom.c 42KB
poly.c 40KB
rk_sobol.c 37KB
qset.c 33KB
stat.c 30KB
rboxlib.c 25KB
user.c 20KB
mem.c 20KB
safileio.c 10KB
rk_primitive.c 9KB
rk_mt.c 8KB
rk_isaac.c 7KB
getopt.c 7KB
random.c 6KB
list_primitive.c 4KB
sobol_example.c 3KB
isaac_example.c 3KB
randomkit_example.c 3KB
randomkit_test.c 2KB
usermem.c 2KB
userprintf.c 2KB
userprintf_rbox.c 2KB
.clang-format 1KB
Plugins.cmake 4KB
FFmpegSupport.cmake 4KB
CorkSupport.cmake 2KB
FindQuaZip.cmake 2KB
LibIGLSupport.cmake 2KB
FindLASzip.cmake 1KB
LASLibSupport.cmake 1KB
FileGLOBBER.cmake 1KB
ExportPCLDlls.cmake 1KB
COPYING 25KB
COPYING 1KB
qcustomplot.cpp 1.25MB
mainwindow.cpp 316KB
ccGLWindow.cpp 200KB
ccCommandLineCommands.cpp 176KB
ccPointCloud.cpp 166KB
dl_dxf.cpp 141KB
ccMesh.cpp 122KB
ccCompass.cpp 113KB
E57Filter.cpp 89KB
ccCameraSensor.cpp 81KB
ccEntityAction.cpp 80KB
ccPropertiesTreeDelegate.cpp 72KB
ccRasterizeTool.cpp 71KB
distanceMapGenerationDlg.cpp 67KB
ShpFilter.cpp 64KB
ccDBRoot.cpp 63KB
ccSectionExtractionTool.cpp 56KB
PlyFilter.cpp 56KB
ccClippingBoxTool.cpp 53KB
cc2DLabel.cpp 52KB
ccRasterGrid.cpp 52KB
qBroomDlg.cpp 51KB
ccGraphicalSegmentationTool.cpp 51KB
LASFilter.cpp 49KB
LASFWFFilter.cpp 46KB
AsciiOpenDlg.cpp 46KB
distanceMapGenerationTool.cpp 46KB
ccPointPairRegistrationDlg.cpp 45KB
FBXFilter.cpp 45KB
PdmsTools.cpp 44KB
BinFilter.cpp 39KB
BundlerFilter.cpp 39KB
qM3C2Process.cpp 37KB
ccGraphicalTransformationTool.cpp 36KB
ObjFilter.cpp 36KB
qAnimationDlg.cpp 36KB
qFacets.cpp 34KB
RansacShapeDetector.cpp 34KB
ccHObject.cpp 34KB
qCanupoProcess.cpp 34KB
dxfProfilesExporter.cpp 34KB
ccviewer.cpp 34KB
Bitmap.cpp 34KB
ccGenericMesh.cpp 34KB
ccTrace.cpp 33KB
AsciiFilter.cpp 33KB
ccComparisonDlg.cpp 33KB
qCanupoTools.cpp 31KB
qRANSAC_SD.cpp 30KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
听君一曲唯爱卿
- 粉丝: 2
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功