Learn R Programming

TreeLS (version 2.0.2)

stemSegmentation: Stem segmentation

Description

Measure stem segments from a point cloud with assigned stem points. Stem segmentation methods are prefixed by sgt.

Usage

stemSegmentation(las, method = sgt.ransac.circle())

Arguments

las

LAS object.

method

stem segmentation algorithm. Currently available: sgt.ransac.circle, sgt.ransac.cylinder, sgt.irls.circle, sgt.irls.cylinder and sgt.bf.cylinder.

Value

signed data.table of stem segments.

Random Sample Consensus (RANSAC) Algorithm

The RANdom SAmple Consensus algorithm is a method that relies on resampling a data set as many times as necessary to find a subset comprised of only inliers - e.g. observations belonging to a desired model. The RANSAC algorithm provides a way of estimating the necessary number of iterations necessary to fit a model using inliers only, at least once, as shown in the equation: k = log(1 - p) / log(1 - w^n)k = log(1 - p) / log(1 - w^n) where:

  • k: number of iterations

  • p: confidence level, i.e. desired probability of success

  • w: proportion of inliers expected in the full dataset

  • n: number of observations sampled on every iteration

The models reiterated in TreeLS usually relate to circle or cylinder fitting over a set of 3D coordinates, selecting the best possible model through the RANSAC algorithm

For more information, checkout this wikipedia page.

Iterative Reweighted Least Squares (IRLS) Algorithm

irls circle or cylinder estimation methods perform automatic outlier assigning through iterative reweighting with M-estimators, followed by a Nelder-Mead optimization of squared distance sums to determine the best circle/cylinder parameters for a given point cloud. The reweighting strategy used in TreeLS is based on Liang et al. (2012). The Nelder-Mead algorithm implemented in Rcpp was provided by kthohr/optim.

Least Squares Circle Fit

The circle fit methods applied in TreeLS estimate the circle parameters (its center's XY coordinates and radius) from a pre-selected (denoised) set of points in a least squares fashion by applying either QR decompostion, used in combination with the RANSAC algorithm, or Nelder-Mead simplex optimization combined the IRLS approach.

The parameters returned by the circle fit methods are:

  • X,Y: 2D circle center coordinates

  • Radius: 2D circle radius, in point cloud units

  • Error: model circle error from the least squares fit

  • AvgHeight: average height of the stem segment's points

  • N: number of points belonging to the stem segment

Least Squares Cylinder Fit

The cylinder fit methods implemented in TreeLS estimate a 3D cylinder`s axis direction and radius. The algorithm used internally to optimize the cylinder parameters is the Nelder-Mead simplex, which takes as objective function the model describing the distance from any point to a modelled cylinder`s surface on a regular 3D cylinder point cloud:

D_p = |(p - q) a| - rDp = abs((p - q) x a) - r

where:

  • Dp: distance from a point to the model cylinder`s surface

  • p: a point on the cylinder`s surface

  • q: a point on the cylinder`s axis

  • a: unit vector of cylinder`s direction

  • r: cylinder`s radius

The Nelder-Mead algorithm minimizes the sum of squared Dp from a set of points belonging to a stem segment - in the context of TreeLS.

The parameters returned by the cylinder fit methods are:

  • rho,theta,phi,alpha: 3D cylinder estimated axis parameters (Liang et al. 2012)

  • Radius: 3D cylinder radius, in point cloud units

  • Error: model cylinder error from the least squares fit

  • AvgHeight: average height of the stem segment's points

  • N: number of points belonging to the stem segment

  • PX,PY,PZ: absolute center positions of the stem segment points, in point cloud units (used for plotting)

Brute Force Cylinder Fit

The brute force cylinder fit approach estimates the axis rotation angles by brute force combined with 2D ransac circle fit. The coordinates of a point cloud representing a single cylinder are iteratively rotated up to a pre defined threshold, and for every iteration a circle is estimated after rotation is performed. The rotation that minimizes the circle parameters the most is used to describe the axis direction of the cylinder with the circle's radius.

The parameters returned by the brute force cylinder fit method are:

  • X,Y: 2D circle center coordinates after rotation

  • Radius: 3D circle radius, in point cloud units

  • Error: model circle error from the RANSAC least squares fit, after rotation

  • DX,DY: absolute rotation angles (in degrees) applied to the X and Y axes, respectively

  • AvgHeight: average height of the stem segment's points

  • N: number of points belonging to the stem segment

Details

All stem segmentation algorithms return estimations for every stem Segment of every TreeID (if the input LAS has multiple trees). For more details and a list of all outputs for each method check the sections below.

References

Liang, X. et al., 2012. Automatic stem mapping using single-scan terrestrial laser scanning. IEEE Transactions on Geoscience and Remote Sensing, 50(2), pp.661<U+2013>670.

Olofsson, K., Holmgren, J. & Olsson, H., 2014. Tree stem and height measurements using terrestrial laser scanning and the RANSAC algorithm. Remote Sensing, 6(5), pp.4323<U+2013>4344.

Conto, T. et al., 2017. Performance of stem denoising and stem modelling algorithms on single tree point clouds from terrestrial laser scanning. Computers and Electronics in Agriculture, v. 143, p. 165-176.

Examples

Run this code
# NOT RUN {
file = system.file("extdata", "pine.laz", package="TreeLS")
tls = readTLS(file) %>%
  tlsNormalize

tls = stemPoints(tls, stm.hough())
sgt = stemSegmentation(tls, sgt.ransac.circle(n=20))
tlsPlot(tls, sgt)
# }

Run the code above in your browser using DataLab