![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).
没有合适的资源?快使用搜索试试~ 我知道了~
cloudcompare.2.11.3
共2000个文件
h:598个
cpp:403个
png:368个
需积分: 0 48 下载量 129 浏览量
2022-03-27
20:29:19
上传
评论
收藏 34.63MB ZIP 举报
温馨提示
cloudcompare.2.11.3
资源详情
资源评论
资源推荐
收起资源包目录
cloudcompare.2.11.3 (2000个子文件)
CloudCompare.1 777B
ccViewer.1 409B
updateTranslations.bat 644B
compileFinalVersion.bat 422B
compile.bat 243B
run_moc.bat 135B
start.bat 29B
start.bat 25B
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 54KB
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
CCLib_doxygen_file 105KB
travis_snapcraft.cfg 2KB
ChangeLog 18KB
FindTBB.cmake 12KB
CMakeInclude.cmake 7KB
CMakePluginTpl.cmake 5KB
GDALSupport.cmake 3KB
CMakeExternalLibs.cmake 3KB
ffmpegSupport.cmake 3KB
CorkSupport.cmake 3KB
FindQuaZip.cmake 2KB
QuazipLibSupport.cmake 2KB
CMakeSetCompilerOptions.cmake 1KB
3DXSupport.cmake 1KB
LASLibSupport.cmake 1KB
CGALSupport.cmake 1KB
OculusSupport.cmake 1KB
ExportPCLDlls.cmake 1KB
AllSupport.cmake 853B
GamepadSupport.cmake 788B
DxfLibSupport.cmake 754B
ShapeLibSupport.cmake 690B
CMakePolicies.cmake 250B
COPYING 25KB
COPYING 1KB
qcustomplot.cpp 832KB
mainwindow.cpp 307KB
ccGLWindow.cpp 193KB
ccPointCloud.cpp 157KB
ccCompass.cpp 145KB
dl_dxf.cpp 141KB
ccCommandLineCommands.cpp 138KB
DgmOctree.cpp 131KB
ccMesh.cpp 112KB
DistanceComputationTools.cpp 97KB
E57Filter.cpp 82KB
ccCameraSensor.cpp 79KB
ccEntityAction.cpp 72KB
ccRasterizeTool.cpp 69KB
ccPropertiesTreeDelegate.cpp 65KB
distanceMapGenerationDlg.cpp 65KB
ccDBRoot.cpp 63KB
ShpFilter.cpp 61KB
PlyFilter.cpp 55KB
ccSectionExtractionTool.cpp 54KB
qBroomDlg.cpp 52KB
RegistrationTools.cpp 51KB
cc2DLabel.cpp 50KB
LASFilter.cpp 49KB
FBXFilter.cpp 46KB
distanceMapGenerationTool.cpp 46KB
PdmsTools.cpp 44KB
AsciiOpenDlg.cpp 42KB
ccPointPairRegistrationDlg.cpp 42KB
ManualSegmentationTools.cpp 40KB
LASFWFFilter.cpp 39KB
ccClippingBoxTool.cpp 39KB
BundlerFilter.cpp 39KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
小修勾
- 粉丝: 4314
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2001~2022年上市公司数字赋能指数.dta
- 2001~2022年上市公司数字赋能指数.xlsx
- 信息办公石大在线财务管理系统(含源码)-shidacaiwu.rar
- 信息办公电信计费系统完整代码-netctossconformity.rar
- matlab实现TD-SCDMA中初始同步捕捉DwPTS下行同步导频时隙的仿真.zip
- 信息办公玉玺学生信息管理系统-webapps.rar
- 信息办公基于struts的图书管理系统-struts-ts.rar
- 管家婆分销ERP V1 V3 A8II TOP V10.0.2最新全版本通用
- 信息办公基于Ajax+J2EE的MicroERP源码下载-microerp-0.1.rar
- 信息办公双鱼林jsp人事工资系统-wagesmanagesystem.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0