This function obtains coordinates relative to the plot centre speciefied for Terrestrial Laser Scanner (TLS) and Mobile Laser Scanner (MLS) point clouds (supplied as LAS or LAZ files). Point clouds obtained from other devices/approaches (e.g. photogrammetry) can be also used, but the guarantee of good performance is likely to be lower. In addition, the point cropping process developed by Molina-Valero et al., (2019) is applied as a criterion for reducing point density homogeneously in space and proportionally to object size when TLS single-scans are provided.
normalize(las, normalized = NULL,
x.center = NULL, y.center = NULL,
x.side = NULL, y.side = NULL,
xpoly = NULL, ypoly = NULL,
max.dist = NULL, min.height = NULL, max.height = 50,
algorithm.dtm = "knnidw", res.dtm = 0.2,
csf = list(cloth_resolution = 0.5),
intensity = NULL, RGB = NULL,
scan.approach = "single",
voxel_size = NULL,
id = NULL, file = NULL, plot = TRUE,
dir.data = NULL, save.result = TRUE, dir.result = NULL,
save.las = NULL)
Data frame of normalized point cloud including the following columns (each row corresponds to one point):
Plot identification encoded as a character string or numeric in the argument id
.
File name identification encoded as character string or numeric, corresponding to the normalized and reduced point clouds saved. This coincides with the TXT file in the absolute path specified in dir.result
(if save.result
is set to TRUE
).
Cartesian (according to https://en.wikipedia.org/wiki/Cartesian_coordinate_system notation):
x
: x axis distance (m).
y
: y axis distance (m).
z
: height (m).
Cylindrical (according to https://en.wikipedia.org/wiki/Cylindrical_coordinate_system notation):
rho
: horizontal distance (m).
phi
: angular coordinate (rad).
z
: height (m).
Spherical (according to https://en.wikipedia.org/wiki/Spherical_coordinate_system notation):
r
: radial distance (m).
theta
: polar angle (rad).
phi
: azimuthal angle (rad)
Slope of the terrain (rad).
Intensity (only if point cloud has intensity values and specified in arguments).
Red (only if point cloud is colorized and specified in arguments).
Green (only if point cloud is colorized and specified in arguments).
Blue (only if point cloud is colorized and specified in arguments).
Green Leaf Algorithm (only if point cloud is colorized and specified in arguments).
selection probability assigned in point cropping process (0-1]. Only the farthest will have probability of 1.
final selection probability assigned in point cropping process. Selected (1) and discarded point (0).
Character string containing the name of LAS/LAZ file belonging to point cloud, including .las/.laz extensions (see ‘Examples’). Planimetric coordinates of point cloud data must be in local, representing TLS scan point the origin with Cartesian coordinates x and y as (0, 0).
Optional argument to establish as TRUE
when point cloud is already normalized.
Planimetric x center coordinate of point cloud data.
Planimetric y center coordinate of point cloud data.
x-side (m) of the plot when the plot is square or rectangular.
y-side (m) of the plot when the plot is square or rectangular.
Vector containing the x-coordinates of the vertices of the clipping polygon.
Vector containing the y-coordinates of the vertices of the clipping polygon.
Optional maximum horizontal distance (m) considered from the plot centre. All points farther than max.dist
will be discarded after the normalization process. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, all points will be used in processing, with max.dist
representing the farthest point.
Optional minimum height (m) considered from ground level. All points below min.height
will be discarded after the normalization process. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, all points will be used in processing, with min.height
representing the lowest point.
Optional maximum height (m) considered from ground level. All points above max.height
will be discarded after the normalization process. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, all points will be used in processing, with max.height
representing the highest point.
Algorithm used to generate the digital terrain model (DTM) from the TLS point cloud. There are two posible options based on spatial interpolation: ‘tin’ and ‘knnidw’ (see ‘Details’). If this argument is not specified by the user, it will be set to ‘knnidw’ algorithm.
Numeric parameter. Resolution of the DTM generated to normalize point cloud (see ‘Details’). If this argument is not specified by the user, it will be set to 0.2 m.
List containing parameters of CSF algorithm:
cloth_resolution
: by default 0.5.
Logical parameter useful when point clouds have LiDAR intesinty values.
Logical parameter useful when point clouds are colorized, thus including values of RGB colors. It is based on the Green Leaf Algorithm (GLA) (see ‘Details’).
Character parameter indicating TLS single-scan (‘single’) or TLS multi-scan approach or SLAM point clouds (‘multi’) approaches. If this argument is not specified by the user, it will be set to ‘multi’ approach.
Defines the size of the 3D grid cells used for downsampling.
Optional plot identification encoded as character string or numeric. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, the plot will be encoded as 1.
Optional file name identification encoded as character string or numeric value. If it is null, file will be encoded as id
by default.
Optional logical which indicates whether or not the normalized point cloud will be plot. If this argument is not specified by the user, it will be set to TRUE
by default and, as consequence, the normalized point cloud will be plot.
Optional character string naming the absolute path of the directory where LAS files containing TLS point clouds are located. .Platform$file.sep
must be used as the path separator in dir.data
. If this argument is not specified by the user, it will be set to NULL
by default and, as a consequence, the current working directory of the R process will be assigned to dir.data
during the execution.
Optional logical which indicates whether or not the output files described in ‘Output Files’ section must be saved in dir.result
. If this argument is not specified by the user, it will be set to TRUE
by default and, as consequence, the output files will be saved.
Optional character string naming the absolute path of an existing directory where files described in ‘Output Files’ section will be saved. .Platform$file.sep
must be used as the path separator in dir.result
. If this argument is not specified by the user, and save.result
is TRUE
, it will be set to NULL
by default and, as a consequence, the current working directory of the R process will be assigned to dir.result
during the execution.
Optional logical which indicates whether or not the imput point cloud must be saved in dir.result
as LAZ file.
At the end of the normalization process, if the save.result
argument is TRUE
, the function will save the reduced point cloud as TXT file and encoded according to file
argument. The format is the same as data frame described in ‘Value’, except for a prob
column, which is removed because all points selected after the point cropping process have a final selection probability of 1. The data frame is written without row names in dir.result
directory using the vroom_write
function in the vroom package.
Juan Alberto Molina-Valero and Adela Martínez-Calvo.
Relative coordinates are obtained by means of a normalization process, generating a digital terrain model (DTM) from the TLS point cloud, with the ground height set at 0 m. The DTM is generated by spatial interpolation of ground points classified with the CSF algorithm (Zhang et al., (2016)). Two algorithms are available for that purpose: (i) spatial interpolation based on a Delaunay triangulation, which performs a linear interpolation within each triangle (‘tin’); (ii) spatial interpolation using a k-nearest neighbour (KNN) approach with inverse-distance weighting (IDW) (‘knnidw’). Note that normalization process is based on lidR package functions: classify_ground, grid_terrain and normalize_height.
The point cropping process reduces the point cloud density proportionally to the likelihood that objects will receive points according to their distance from TLS and their size, which is determined by angle aperture (the farther they are, the lower the density is). The result is an approximately homogeneous point cloud in three-dimensional space (for more details see Molina-Valero et al., (2019)).
The Green Leaf Algorithm (GLA) is calculated according to Louhaichi et al., (2001)as follows:
Those points with values below 0 are clasified as woody parts, thus retained for tree detection in further functions.
Liang, X., Hyyppä, J., Kaartinen, H., Lehtomäki, M., Pyörälä, J., Pfeifer, N., ... & Wang, Y. (2018). International benchmarking of terrestrial laser scanning approaches for forest inventories. ISPRS journal of photogrammetry and remote sensing, 144, 137-179. tools:::Rd_expr_doi("https://doi.org/10.1016/j.isprsjprs.2018.06.021")
Louhaichi, M., Borman, M. M., & Johnson, D. E. (2001). Spatially located platform and aerial photography for documentation of grazing impacts on wheat. Geocarto International, 16(1), 65-70. tools:::Rd_expr_doi("https://doi.org/10.1080/10106040108542184")
Molina-Valero J. A., Ginzo-Villamayor M. J., Novo Pérez M. A., Álvarez-González J. G., & Pérez-Cruzado C. (2019). Estimación del área basimétrica en masas maduras de Pinus sylvestris en base a una única medición del escáner laser terrestre (TLS). Cuadernos de la Sociedad Espanola de Ciencias Forestales, 45(3), 97-116. tools:::Rd_expr_doi("https://doi.org/10.31167/csecfv0i45.19887").
Zhang, W., Qi, J., Wan, P., Wang, H., Xie, D., Wang, X., & Yan, G. (2016). An easy-to-use airborne LiDAR data filtering method based on cloth simulation. Remote Sensing, 8(6), 501. tools:::Rd_expr_doi("https://doi.org/10.3390/rs8060501").
tree.detection.single.scan
, tree.detection.multi.scan
, tree.detection.several.plots
.
# \donttest{
# Establishment of working directories (optional)
# By default here we propose the current working directory of the R process
dir.data <- getwd()
dir.result <- getwd()
# TLS SINGLE-SCAN APPROACH
# Loading example TLS data (LAZ file) to dir.data
download.file("https://www.dropbox.com/s/17yl25pbrapat52/PinusRadiata.laz?dl=1",
destfile = file.path(dir.data, "PinusRadiata.laz"),
mode = "wb")
# Normalizing the whole point cloud data without considering arguments
# Note that in the case of TLS single-scans, the coordinates of the plot center
# must be specified by the x.center and y.center arguments, which are
# x.center = 0 and y.center = 0 in this case
pcd <- normalize(las = "PinusRadiata.laz",
id = "PinusRadiata",
x.center = 0, y.center = 0,
dir.data = dir.data, dir.result = dir.result)
# MLS OR TLS MULTI-SCAN APPROACHES
# Loading example MLS data (LAZ file) to dir.data
download.file(
"www.dropbox.com/scl/fi/es5pfj87wj0g6y8414dpo/PiceaAbies.laz?rlkey=ayt21mbndc6i6fyiz2e7z6oap&dl=1",
destfile = file.path(dir.data, "PiceaAbies.laz"),
mode = "wb")
# Normalizing the whole point cloud data without considering arguments
pcd <- normalize(las = "PiceaAbies.laz",
id = "PiceaAbies",
scan.approach = "multi",
dir.data = dir.data, dir.result = dir.result)
# }
Run the code above in your browser using DataLab