recenter_las: Recenter 'LAS' object representing segmented tree based on...

View source: R/preprocessing.R

recenter_lasR Documentation

Recenter 'LAS' object representing segmented tree based on the bole location

Description

Function calculates the tree location using points below specified 'height' and recenters on 'X=0 Y=0'

Usage

recenter_las(las, height = 1)

Arguments

las

'LAS' object from 'lidR' package representing

height

consider only points where Z < height, if specified. Useful for considering only the tree bole, for centering. individually segmented tree. Set 'height = NULL' to recenter using all points.

Value

A 'LAS' object with X and Y coordinates recentered to (0, 0).

Examples

library(lidR)
las = readLAS(system.file("extdata", "tree_0744.laz", package="tReeTraits"))
# view histogram of original X/Y values
par(mfrow=c(1,2))
hist(las$X)
hist(las$Y)
las = recenter_las(las)
# view histogram of X/Y values centered on 0,0
hist(las$X)

hist(las$Y)

tReeTraits documentation built on Feb. 26, 2026, 1:07 a.m.