hull_diagnostic_plot: Diagnostic Plot of Crown Convex Hulls

View source: R/diagnostics.R

hull_diagnostic_plotR Documentation

Diagnostic Plot of Crown Convex Hulls

Description

Generates a 2D diagnostic plot to visualize the convex hulls and voxelized hulls of tree crowns in a LAS point cloud. Useful for checking results of crown segmentation.

Usage

hull_diagnostic_plot(las, res = 0.1)

Arguments

las

A 'LAS' object from the 'lidR' package. Must contain a column named 'Crown'.

res

Numeric. Resolution for voxelization in 'voxel_hull_2D()'. Default is 0.1.

Details

The function first filters points marked as crown ('Crown == 1') and then computes both the 2D convex hull and a voxelized 2D hull. The resulting plot overlays the voxel hull in color and the convex hull as a dashed outline.

Value

A 'ggplot' object displaying convex hulls (dashed) and voxel hulls (filled).

Examples

library(lidR)
file = system.file('extdata', file='tree_0744.laz', package='tReeTraits')
las <- readLAS(file)
las <- segment_crown(las)  # adds `Crown` column
hull_diagnostic_plot(las)

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