# NOT RUN {
LASfile <- system.file("extdata", "Topography.laz", package="lidR")
las <- readLAS(LASfile, filter = "-inside 273450 5274350 273550 5274450")
# Add 20 artificial outliers
set.seed(314)
id = round(runif(20, 0, npoints(las)))
set.seed(42)
err = runif(20, -50, 50)
las$Z[id] = las$Z[id] + err
# Using SOR
las <- classify_noise(las, sor(15,7))
#plot(las, color = "Classification")
# Using IVF
las <- classify_noise(las, ivf(5,2))
# Remove outliers using filter_poi()
las_denoise <- filter_poi(las, Classification != LASNOISE)
# }
Run the code above in your browser using DataLab