Returns the crown points from a tree point cloud.
Usage
classify_crown_pc(
pc,
thresholdbranch = 1.5,
minheight = 1,
buttress = FALSE,
thresholdR2 = 0.001,
slice_thickness = 0.06,
thresholdbuttress = 0.001,
maxbuttressheight = 7,
concavity = 4,
dtm = NA,
r = 5,
how = "median",
arc_min_length_cm = NULL,
arc_min_angle = 18,
arc_tolerance = 0.05,
min_inner_buffer = 0.06,
inner_buffer_fraction = 0.5,
plot = FALSE,
plotcolors = c("#08aa7c", "#fac87f")
)Arguments
- pc
The tree point cloud as a data.frame with columns X,Y,Z. Output of
read_tree_pc.- thresholdbranch
Numeric value (default=1.5) that is multiplied with the diameter of the tree (calculated with
dbh_pcordab_pcwhen buttress =TRUE) which determines the cutt-off where a branch emerges and the crown begins.- minheight
Numeric value (default=1) with the minimum height at which the crown begins. Should be above the widest part of the buttresses for buttressed trees (value of 4 is recommended). For non-buttressed trees choose a lower value (such as 1).
- buttress
Logical (default=FALSE), indicates if the trees have buttresses (higher than breast height).
- thresholdR2
Numeric value (default=0.001). Parameter of the
dbh_pcfunction used to calculate the diameter at breast height. Only relevant when buttress == FALSE.- slice_thickness
Numeric value (default = 0.06). Parameter of the
dbh_pcfunction used to calculate the diameter at breast height. Only relevant when buttress == FALSE.- thresholdbuttress
Numeric value (default=0.001). Parameter of the
dab_pcfunction used to calculate the diameter above buttresses. Only relevant when buttress == TRUE.- maxbuttressheight
Numeric value (default=7). Parameter of the
dab_pcfunction used to calculate the diameter at breast height. Only relevant when buttress == TRUE.- concavity
Numeric value (default=4) concavity for the computation of the functional diameter using a concave hull based on
concaveman.- dtm
The digital terrain model as a data.frame with columns X,Y,Z (default = NA). If the digital terrain model is in the same format as a point cloud it can also be read with
read_tree_pc.- r
Numeric value (default=5) r which determines the range taken for the dtm. Should be at least the resolution of the dtm. Only relevant when a dtm is provided.
- how
Method used to summarise point-to-centre radii when estimating DBH with
dbh_pc. Use"mean"for the original ITSMe behaviour,"median"for the median radius, or a numeric value such as10to trim 5 percent of radii on each side before taking the mean. Only relevant when buttress == FALSE.- arc_min_length_cm
Optional numeric. Minimum arc length, in centimetres, represented by one angular sector when calculating arc coverage with
dbh_pc. If supplied, this is converted to degrees based on the fitted radius. Only relevant when buttress == FALSE.- arc_min_angle
Numeric. Minimum angular sector width in degrees used to calculate arc coverage with
dbh_pc. Default is 18, corresponding to 20 sectors. Only relevant when buttress == FALSE.- arc_tolerance
Numeric. Radial tolerance, in metres, around the fitted DBH circle. Points within radius +/- arc_tolerance are counted as supporting the fitted circle when calculating arc coverage with
dbh_pc. Only relevant when buttress == FALSE.- min_inner_buffer
Numeric. Minimum buffer distance, in metres, excluded from the fitted DBH radius before checking whether the inner circle is empty with
dbh_pc. Only relevant when buttress == FALSE.- inner_buffer_fraction
Numeric. Fraction of the fitted DBH radius used as buffer before checking whether the inner circle is empty with
dbh_pc. The effective buffer ismax(min_inner_buffer, inner_buffer_fraction * radius). Only relevant when buttress == FALSE.- plot
Logical (default=FALSE), indicates if the classified tree is plotted.
- plotcolors
list of two colors for plotting. Only relevant when plot = TRUE. The crown and trunk are colored by the first and second element of this list respectively.
Value
List with data.frame with the crown point cloud (part of the tree above the first branch) in crownpoints and data.frame with the trunk point cloud in trunkpoints. Also optionally (plot=TRUE) plots the crown vs non-crown points and in this case returns a list with the crown point cloud as first element, trunk point clouds as a second element and the plots as the third to fifth elements.
Details
The classification is based on the increased distance between the minimum and maximum X (and Y) coordinates of the tree points within a horizontal slice when the first branch is reached with increasing height. When the bottom of the point cloud is incomplete or obstructed you can choose to add a digital terrain model as an input which is used to estimate lowest point of the point cloud in order to obtain slices at the correct height of the tree.
Examples
if (FALSE) { # \dontrun{
# Read tree point cloud and extract the crown points
pc_tree <- read_tree_pc(PC_path = "path/to/point_cloud.txt")
crown_pc <- classify_crown_pc(pc = pc_tree)
# and plot the classification results
output <- classify_crown_pc(pc = pc_tree, plot = TRUE)
crown_pc <- output$crownpoints
# with non-default settings for a buttressed tree
crown_pc <- classify_crown_pc(pc = pc_tree, minheight = 4, buttress = TRUE)
} # }
