find nearest neighbours for 2D and 3D point clouds

Description

find nearest neighbours for point clouds using a kd-tree search. This is just a wrapper of the function vcgKDtree from package Rvcg. Wwraps the function vcgKDtree from package 'Rvcg' (for backward compatibility )

Usage

1
mcNNindex(target, query, cores = parallel::detectCores(), k = k, ...)

Arguments

target

k x m matrix containing data which to search.

query

l x m matrix containing data for which to search.

cores

integer: amount of CPU-cores to be used. Only available on systems with OpenMP support.

k

integer: how many closest points are sought.

...

additional arguments - currently unused.

Value

l x k matrix containing indices of closest points.

See Also

closemeshKD

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require(rgl)
data(nose)
# find closest vertex on surface for each landmark
clost <- mcNNindex(vert2points(shortnose.mesh),shortnose.lm, k=1,
mc.cores=1)
## Not run: 
spheres3d(vert2points(shortnose.mesh)[clost,],col=2,radius=0.3)
spheres3d(shortnose.lm,radius=0.3)
wire3d(shortnose.mesh)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.