title: FLANN
date: 2019/01/08 12:05:51
tags: Debug
categories: Debug
Introduction
FLANN - Fast Library for Approximate Nearest Neighbors
FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces. It contains a collection of algorithms we found to work best for nearest neighbor search and a system for automatically choosing the best algorithm and optimum parameters depending on the dataset.
FLANN is written in C++ and contains bindings for the following languages: C, MATLAB and Python.
Install
$ cd flann-1.8.4-src
$ mkdir build
$ cd build
$ cmake ..
$ make
Errors:
flann-1.8.4-src/src/cpp/flann/algorithms/kdtree_index.h:667:36: error: call to 'abs' is ambiguous
ElementType span = abs(point[i]-leaf_point[i]);
^~~
Debug:
kdtree_index.h
: insert #include <cmath>
https://stackoverflow.com/questions/1374037/ambiguous-overload-call-to-absdouble
Unit test
make test
Scanning dependencies of target dataset_sift10K.h5
Downloading from http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/sift10K.h5 to /Users/gwang/Documents/Kuaipan/Projects/REG/flann-1.8.4-src/test/sift10K.h5... done
[ 0%] Built target dataset_sift10K.h5
Scanning dependencies of target dataset_sift100K_byte.h5
Downloading from http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/sift100K_byte.h5 to /Users/gwang/Documents/Kuaipan/Projects/REG/flann-1.8.4-src/test/sift100K_byte.h5... done
[ 0%] Built target dataset_sift100K_byte.h5
Scanning dependencies of target dataset_cloud.h5
Downloading from http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/cloud.h5 to /Users/gwang/Documents/Kuaipan/Projects/REG/flann-1.8.4-src/test/cloud.h5... done
[ 0%] Built target dataset_cloud.h5
Scanning dependencies of target dataset_brief100K.h5
Downloading from http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/brief100K.h5 to /Users/gwang/Documents/Kuaipan/Projects/REG/flann-1.8.4-src/test/brief100K.h5... done
[ 0%] Built target dataset_brief100K.h5
Scanning dependencies of target dataset_sift100K.h5
Downloading from http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/sift100K.h5 to /Users/gwang/Documents/Kuaipan/Projects/REG/flann-1.8.4-src/test/sift100K.h5... done
[ 0%] Built target dataset_sift100K.h5
Scanning dependencies of target dataset_sift10K_byte.h5
Downloading from http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/sift10K_byte.h5 to /Users/gwang/Documents/Kuaipan/Projects/REG/flann-1.8.4-src/test/sift10K_byte.h5... done
[ 0%] Built target dataset_sift10K_byte.h5
Scanning dependencies of target flann_gtests
[ 0%] Built target flann_gtests
Scanning dependencies of target tests
[ 0%] Built target tests
[ 28%] Built target flann
Scanning dependencies of target pyunit_test_index_save.py
[ 42%] Running pyunit test(s) test_index_save.py
..............
----------------------------------------------------------------------
Ran 14 tests in 2.263s
OK
[ 42%] Built target pyunit_test_index_save.py
Scanning dependencies of target pyunit_test_nn_index.py
[ 57%] Running pyunit test(s) test_nn_index.py
....
----------------------------------------------------------------------
Ran 4 tests in 2.503s
OK
[ 57%] Built target pyunit_test_nn_index.py
Scanning dependencies of target pyunit_test_clustering.py
[ 71%] Running pyunit test(s) test_clustering.py
.........
----------------------------------------------------------------------
Ran 9 tests in 0.187s
OK
[ 71%] Built target pyunit_test_clustering.py
Scanning dependencies of target flann_gtest
[ 71%] Built target flann_gtest
Scanning dependencies of target pyunit_test_nn_autotune.py
[ 85%] Running pyunit test(s) test_nn_autotune.py
----------------------------------------------------------------------
Ran 5 tests in 424.571s
OK
[ 85%] Built target pyunit_test_nn_autotune.py
Scanning dependencies of target pyunit_test_nn.py
[100%] Running pyunit test(s) test_nn.py
...................
----------------------------------------------------------------------
Ran 19 tests in 3.686s
OK
[100%] Built target pyunit_test_nn.py
Scanning dependencies of target test
[100%] Built target test