Package 'lidRalignment'

Title: ALS MLS and TLS forest plot alignment
Description: Alignment of forest plots point clouds (ALS, ULS, MLS, TLS), including complex cases with significant misalignments.
Authors: Jean-Romain Roussel [aut, cre]
Maintainer: Jean-Romain Roussel <[email protected]>
License: GPL (>= 2)
Version: 1.1.1
Built: 2026-06-01 17:12:40 UTC
Source: https://github.com/r-lidar/lidRalignment

Help Index


AlignmentScene R6 Class for Point Cloud Alignment

Description

The 'AlignmentScene' R6 class provides methods for aligning two 3D point clouds plots, typically from terrestrial (MLS/TLS) or aerial (ALS/UAV) LiDAR sources. It implements a multi-step alignment process with coarse, fine, and extra-fine alignment stages.

Methods

Public methods


Method new()

Create a new AlignmentScene object.

Usage
AlignmentScene$new(fref, fmov, radius = 20, verbose = TRUE)
Arguments
fref, fmov

character, path to the las laz file with the point cloud to align. fref is the reference point cloud, fmov is the point cloud to be aligned

radius

clip radius. The routine does not align the full point cloud but clip before to compute the registration matrix

verbose

logical

Returns

A new 'AlignmentScene' object.


Method print()

print

Usage
AlignmentScene$print()

Method set_radius()

Set clip radius

Usage
AlignmentScene$set_radius(radius)
Arguments
radius

numeric.


Method set_ref_is_ground_based()

Tell the pipeline if the reference point cloud is ground-based (TLS, MLS)

Usage
AlignmentScene$set_ref_is_ground_based(val = TRUE)
Arguments
val

logical


Method set_mov_is_ground_based()

Tell the pipeline if the moving point cloud is ground-based (TLS, MLS)

Usage
AlignmentScene$set_mov_is_ground_based(val = TRUE)
Arguments
val

logical


Method prepare()

First function to run. It reads the point cloud, extract features, and performs raw alignment

Usage
AlignmentScene$prepare()

Method coarse_align()

Second function to run. It perform a brute force alignment

Usage
AlignmentScene$coarse_align(res = 2, max_offset = 10, debug = FALSE)
Arguments
res

numeric. Subsampling resolution. Keep it as is.

max_offset

numeric. Maximum translation possible. Increase if the point cloud are strongly missaligned on XY.

debug

logical. Displays rendering for debugging


Method fine_align()

Third function to run. It perform an ICP alignment

Usage
AlignmentScene$fine_align(overlap = "auto", ...)
Arguments
overlap

numeric trimmed ICP overlap. Can be 10, 20, 30, 40 to 100.

...

unused


Method extra_fine_align()

Fourth function to run. It perform an ICP alignment on the trunks

Usage
AlignmentScene$extra_fine_align(...)
Arguments
...

unused


Method align()

Full pipeline

Usage
AlignmentScene$align(res = 2, max_offset = 8)
Arguments
res

numeric. Subsampling resolution. Keep it as is.

max_offset

numeric. Maximum translation possible. Increase if the point cloud are strongly missaligned on XY.


Method plot()

Plot alignment

Usage
AlignmentScene$plot(
  which = c("raw", "coarse", "fine", "extra"),
  compare_to = which
)
Arguments
which

string. The alignment level to plot

compare_to

string. The alignment level to plot and to compare


Method get_registration_matrix()

Get the registration matrix. This matrix is more or less accurate as a function of the level of registration performed

Usage
AlignmentScene$get_registration_matrix()

Method clone()

The objects of this class are cloneable with this method.

Usage
AlignmentScene$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Extract Translation and Rotation from a Transformation Matrix

Description

Prints translation and rotation angles from a 4x4 transformation matrix.

Usage

rtm_info(M)

Arguments

M

A 4x4 transformation matrix.

Value

None (prints results).


Apply a Transformation Matrix to a LAS Object

Description

Applies a 4x4 transformation matrix to a LAS point cloud. The function can handle both LAS objects and LAS file paths, transforming the point cloud data accordingly.

Usage

transform_las(las, M, crs = NULL)

Arguments

las

A LAS object or a character string representing the file path to a LAS file.

M

A 4x4 transformation matrix.

crs

Optional CRS to assign to the transformed LAS. Can be the epsg code, the wkt string or a sf crs object.

Value

A transformed LAS object. If a file path is provided for las, a new LAS file is created and returned.