normalize {lidR} | R Documentation |
Normalize point cloud
Description
Normalize elevation or intensity values using multiple methods.
Usage
normalize_height(las, algorithm, use_class = c(2L, 9L), dtm = NULL, ...)
unnormalize_height(las)
## S4 method for signature 'LAS,ANY'
e1 - e2
normalize_intensity(las, algorithm)
Arguments
las |
An object of class LAS or LAScatalog. |
algorithm |
(1) An algorithm for spatial interpolation. |
use_class |
integer vector. By default the terrain is computed by using ground points (class 2) and water points (class 9). Relevant only for a normalization without a raster DTM. |
dtm |
raster. If |
... |
|
e1 |
a LAS object |
e2 |
A raster representing a digital terrain model in format from |
Details
- normalize_height
Subtract digital terrain model (DTM) from a LiDAR point cloud to create a dataset normalized with the ground at 0. The DTM can be a raster, but it can also be computed on-the-fly. In this case the algorithm does not use rasterized data and each point is interpolated. There is no inaccuracy due to the discretization of the terrain and the resolution of the terrain is virtually infinite. A new attribute 'Zref' records the former elevation values, which enables the use of unnormalize_height to restore original point elevations.
- normalize_intensity
Normalize intensity values using multiple methods. The attribute 'Intensity' records the normalized intensity. An extra attribute named 'RawIntensity' records the original intensities.
Non-supported LAScatalog options
The option select
is not supported and not respected because it always preserves the file format
and all the attributes. select = "*"
is imposed internally.
Examples
LASfile <- system.file("extdata", "Topography.laz", package="lidR")
las <- readLAS(LASfile)
# ====================
# Normalize elevation
# ====================
# First option: use a raster as DTM
# --------------------------------------
dtm <- rasterize_terrain(las, 1, knnidw(k = 6L, p = 2))
nlas <- normalize_height(las, dtm)
# restore original elevations
las <- unnormalize_height(nlas)
# operator - can be used. This is equivalent to the previous
nlas <- las - dtm
# restore original elevations
las <- unnormalize_height(las)
# Second option: interpolate each point (no discretization)
# ---------------------------------------------------------
nlas <- normalize_height(las, tin())
# operator - can be used. This is equivalent to the previous
las <- unnormalize_height(nlas)
nlas <- las - tin()
## Not run:
# All the following syntaxes are correct
las <- normalize_height(las, knnidw())
las <- normalize_height(las, knnidw(k = 8, p = 2))
las <- las - knnidw()
las <- las - knnidw(k = 8)
las <- normalize_height(las, kriging())
las <- las - kriging(k = 8)
## End(Not run)
# ====================
# Normalize intensity
# ====================
# pmin = 15 because it is an extremely small file
# strongly decimated to reduce its size. There are
# actually few multiple returns
sensor <- track_sensor(las, Roussel2020(pmin = 15))
# Here the effect is virtually null because the size of
# the sample is too small to notice any effect of range
las <- normalize_intensity(las, range_correction(sensor, Rs = 2000))