lidRalignment
enables automatic alignment of forest plot point clouds from different sources, such as ALS with TLS or MLS, or TLS with MLS, or ALS with ALS in a unified pipeline. The package is robust to large alignment differences (e.g., 180 degrees of misalignment), noise, and leaf-on/leaf-off conditions. A full description of the internal pipeline details is available 📖 here.
You need the latest version of lidR
and lasR
:
install.packages(c('lidR', 'lasR', 'lidRalignment'), repos = 'https://r-lidar.r-universe.dev')
The alignment pipeline consists of four stages, progressing from raw to extra fine:
A full description of the internal pipeline details is availailable 📖 here.
library(lidR)
library(lidRalignment)
fref = "als_file.las"
fmov = "mls_file.las"
# Setup the pipeline. It is important to tell the object
# what we are aligning in order to perform or not
# the last extra fine alignment
alignment = AlignmentScene$new(fref, fmov)
alignment$set_ref_is_ground_based(FALSE)
alignment$set_mov_is_ground_based(TRUE)
# Run the alignment pipeline
alignment$align()
# Visualize the different level of alignment
alignment$plot("raw")
alignment$plot("coarse")
alignment$plot("fine")
alignment$plot("extra", compare_to = "fine")
# Get the final transformation matrix to register the entire point cloud.
M = alignment$get_registration_matrix()
crs = sf::st_crs(readLASheader(fref))
ofile = transform_las(fmov, M, crs)
alignment = AlignmentScene$new(fref, fmov)
alignment$set_ref_is_ground_based(FALSE)
alignment$set_mov_is_ground_based(TRUE)
alignment$prepare()
alignment$plot("raw")
alignment$coarse_align()
alignment$plot("coarse")
alignment$fine_align()
alignment$plot("fine")
alignment$extra_fine_align()
alignment$plot("extra", compare_to = "fine")