denoise_scene: Filters isolated points from a point cloud

Description Usage Arguments Details Value Examples

View source: R/Denoise.R

Description

Filters isolated points from a point cloud

Usage

1
denoise_scene(data, method, filter, k, store_noise)

Arguments

data

LAS file of a 3D point cloud.

method

character string. Defines the method to use for noise filtering. Can be "quantile", "sd" or "voxel". See details. Default = "sd".

filter

numeric. The intensity of the filter that depends on the method. See details.

k

numeric. The number of nearest neighbours to use to compute the mean nearest neighbour distance. Required only if method = "quantile" or "sd". Default = 5.

store_noise

logical. If TRUE, the surveyed points considered as noise are not removed from the data and a column "Noise" is added with a value of 1 indicating non-noisy points and a value of 2 indicating noisy points. Default = FALSE.

Details

method = "quantile"

the quantile-based method computes the distance of the k nearest neighbours for each surveyed point and considers points that fall in the last user defined quantile as noise. If quantile is used as the filtering method, the default is set to = 0.999.

method = "sd"

the standard deviation-based method computes the average distance of the k nearest neighbours of each surveyed point and considers points as noise if they are more than the average distance plus a number of times the standard deviation away from other surveyed points. The filter parameter sets the standard deviation multiplier. Default = 4. This filter is similar to the "SOR filter" available in CloudCompare.

method = "voxel"

the voxel-based method considers surveyed points as noise if they are the only surveyed point within a user defined voxel volume. The filter parameter sets the voxel size (i.e., voxel side length). Default = 0.5.

Value

The filtered data (if store_noise = FALSE) or the classified data (if store_noise = TRUE) with noisy points labeled as 2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#- import the tree_line_plot dataset
file <- system.file("extdata", "tree_line_plot.laz", package="viewshed3d")
tls <- lidR::readLAS(file,select="xyz")

#- remove duplicated points
tls <- lidR::filter_duplicates(tls)

#- filter noise with the quantile base method
data <- viewshed3d::denoise_scene(tls,
                                  method="quantile",
                                  filter=0.999,
                                  k=5,
                                  store_noise = TRUE)

lidR::plot(data,color="Noise",colorPalette=c("white","red")) # plot

#- filter noise with the standard deviation based method
data <- viewshed3d::denoise_scene(tls,
                                  method="sd",
                                  filter=4,
                                  k=5,
                                  store_noise = TRUE)

lidR::plot(data,color="Noise",colorPalette=c("white","red")) # plot

#- filter noise with the voxel based method
data <- viewshed3d::denoise_scene(tls,
                                  method="voxel",
                                  filter=0.5,
                                  store_noise = TRUE)
lidR::plot(data,color="Noise",colorPalette=c("white","red")) # plot

viewshed3d documentation built on April 4, 2021, 1:06 a.m.