filter_point_density {VoxR}R Documentation

Retains one point of the original point cloud within a voxel of given size.

Description

Retains one point of the original point cloud within a voxel of given size.

Usage

filter_point_density(data, res, message)

Arguments

data

a data.frame or data.table containing the x, y, z, ... coordinates of a point cloud.

res

numeric. The voxel resolution.

message

logical. If FALSE, messages are disabled. Default = TRUE.

Value

a data.frame or data.table with reduced point sensity.

Examples

#- import tls data
tls=data.table::fread(system.file("extdata", "Tree_t0.asc", package="VoxR"))

#- keep one point in 2cm voxels
filtered=VoxR::filter_point_density(tls,0.02)
rgl::open3d()
rgl::plot3d(filtered,add=TRUE)

#- keep one point in 10cm voxels
filtered=VoxR::filter_point_density(tls,0.1)
rgl::open3d()
rgl::plot3d(filtered,add=TRUE)

[Package VoxR version 1.0.0 Index]