filter_noise: Statistical filtering of a point cloud.

Description Usage Arguments Value Examples

View source: R/filter_noise.R

Description

Implements the Statistical Outliers Removal (SOR) filter available in CloudCompare. Computes the distance of each point to its k nearest neighbours and considers a point as noise if it is further than the average distance (for the entire point cloud) plus sigma times the standard deviation away from other points.

Usage

1
filter_noise(data, k, sigma, store_noise, message)

Arguments

data

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

k

numeric. The number of nearest neighbours to use. Default = 5.

sigma

numeric. The multiplier of standard deviation to consider a point as noise. Default = 1.5.

store_noise

logical. Should the noisy points be retained ? Default = FALSE.

message

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

Value

If store_noise = TRUE the input data is returned with an additional field ("Noise") where points that are classified as noise points are labaled with 2 and the points not classified as noise are labeled as 1. If store_noise = FALSE only the points that were not classified as noise are returned.

Examples

1
2
3
4
5
6
7
8
9
#- import tls data
tls=data.table::fread(system.file("extdata", "Tree_t0.asc", package="VoxR"))

#- run noise filter
clean=VoxR::filter_noise(tls,store_noise = TRUE)

#- plot the result (noise in red)
rgl::open3d()
rgl::plot3d(clean,col=clean$Noise,add=TRUE)

VoxR documentation built on Nov. 16, 2020, 9:14 a.m.