Radius searching of points based on FLANN C++
radius_search(
query,
ref,
radius,
max_neighbour,
same = FALSE,
build = "kdtree",
threads = 1L,
checks = 1L
)
A data.table
containing the set of query points where each row represent a point and each column a given coordinate.
A numeric
containing the set of reference points where each row represent a point and each column a given coordinate.
A numeric
describing the euclidean distance form the each query points.
An integer
specifying the maximun number of points to look around each query point for a given radius.
Logic. If TRUE
, it delete neighbors with distance of 0, useful when the k search is based on the same query.
A character
describing the search structure to be used: "kdtree", "kmeans", "linear".
An integer
specifying the number of threads to use for parallel processing. Experiment to see what works best for your data on your hardware. If 0, then the maximum allowable cores are used.
Number of checks during searching. Higher value gives better search precision but takes longer. See FLANN C++ manual for more details.
A data.table
with three columns describing the indices of the query and ref points and the distances.
This function is based on the FLAAN C++ Library (Muja and Lowe 2009) for a fast estimation of neighbors points. It is adapted from rflann (Muja, Lowe, Yee, 2018) to simplify the workflow with TLS data. If you use this function, please consider cite both documents.
Muja, M., Lowe, D.G. (2009). Fast approximate nearest neighbors with automatic algorithm configuration. VISAPP (1), 2(331-340), 2.
Muja, M., Lowe, D.G., Yee, J., (2018). rflann: Basic R Interface to the 'FLANN' C++ Library. R package version 1.6.0.
# NOT RUN {
#Point cloud
data("pc_tree")
#Radius search of 0.1
radius_search(pc_tree, pc_tree, radius = 0.1, 100, TRUE, "kdtree")
# }
Run the code above in your browser using DataLab