normalize: Relative Coordinates and Density Reduction for...

View source: R/normalize.R

normalizeR Documentation

Relative Coordinates and Density Reduction for Terrestrial-Based Technologies Point Clouds

Description

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.

Usage

normalize(las, normalized = NULL,
          x.center = NULL, y.center = NULL,
          x.side = NULL, y.side = 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",
          id = NULL, file = NULL,
          dir.data = NULL, save.result = TRUE, dir.result = NULL)

Arguments

las

Character string containing the name of LAS file belonging to TLS point cloud, including .las extension (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).

normalized

Optional argument to establish as TRUE when point cloud is already normalized.

x.center

Planimetric x center coordinate of point cloud data.

y.center

Planimetric y center coordinate of point cloud data.

x.side

x-side (m) of the plot when the plot is square or rectangular.

y.side

y-side (m) of the plot when the plot is square or rectangular.

max.dist

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.

min.height

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.

max.height

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.dtm

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.

res.dtm

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.

csf

List containing parameters of CSF algorithm:

  • cloth_resolution: by default 0.5.

scan.approach

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.

intensity

Logical parameter useful when point clouds have LiDAR intesinty values.

RGB

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’).

id

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.

file

Optional file name identification encoded as character string or numeric value. If it is null, file will be encoded as id by default.

dir.data

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.

save.result

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.

dir.result

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.

Details

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.

Value

Data frame of normalized point cloud including the following columns (each row corresponds to one point):

id

Plot identification encoded as a character string or numeric in the argument id.

file

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).

Coordinates

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

Slope of the terrain (rad).

intensity

Intensity (only if point cloud has intensity values and specified in arguments).

R

Red (only if point cloud is colorized and specified in arguments).

G

Green (only if point cloud is colorized and specified in arguments).

B

Blue (only if point cloud is colorized and specified in arguments).

GLA

Green Leaf Algorithm (only if point cloud is colorized and specified in arguments).

prob

selection probability assigned in point cropping process (0-1]. Only the farthest will have probability of 1.

prob.select

final selection probability assigned in point cropping process. Selected (1) and discarded point (0).

Output Files

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.

Note

Note that max.dist, min.height and max.height arguments may be useful for optimizing computing time as well as for removing unnecessary and/or outlier points. These values may be selected more appropriately when inventory data are already available, or the user has some knowledge about autoecology of scanned tree species.

Note also that the linear interpolation algorithm (‘tin’ in this package) showed the highest accuracy in Liang et al., (2018) in DTM generation with single-scans. In this work a DTM resolution of 0.2 m was also considered adequately for square plots of 32 x 32 m.

Author(s)

Juan Alberto Molina-Valero and Adela Martínez-Calvo.

References

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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.3390/rs8060501")}.

See Also

tree.detection.single.scan, tree.detection.multi.scan, tree.detection.several.plots.

Examples




# 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

pcd <- normalize(las = "PinusRadiata.laz",

                 id = "PinusRadiata",

                 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)

  


FORTLS documentation built on Sept. 11, 2023, 5:09 p.m.