Learn R Programming

TreeLS (version 2.0.2)

tlsPlot: Plot TreeLS outputs

Description

Plot the outputs of TreeLS methods on the same scene using rgl.

Usage

tlsPlot(..., fast = FALSE, tree_id = NULL, segment = NULL)

add_segmentIDs(x, las, ...)

add_treeIDs(x, las, ...)

add_treeMap(x, las, ...)

add_treePoints(x, las, color_func = pastel.colors, ...)

add_stemPoints(x, las, ...)

add_stemSegments(x, stems_data_table, color = "white", fast = FALSE)

add_tlsInventory(x, inventory_data_table, color = "white", fast = FALSE)

Arguments

...

in tlsPlot: any object returned from a TreeLS method. In the add_* methods: parameters passed down to 3D plotting rgl functions.

fast

logical, use TRUE to plot spheres representing tree diameters or FALSE to plot detailed 3D cylinders.

tree_id

numeric - plot only the tree matching this tree id.

segment

numeric - plot only stem segments matching this segment id.

x

output from plot or tlsPlot

las

LAS object.

color_func

color palette function used in add_treePoints.

stems_data_table, inventory_data_table

data.table objects generated by stemSegmentation and tlsInventory.

color

color of 3D objects.

Examples

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

dmt = shapeFit(shape = 'circle', algorithm='ransac', n=20)
inv = tlsInventory(tls, d_method = dmt)

### quick plot
tlsPlot(tls, inv)

### customizable plots
x = plot(tls)
add_stemPoints(x, tls, color='red', size=3)
add_tlsInventory(x, inv, color='yellow')
add_segmentIDs(x, tls, color='white', cex=2, pos=4)
# }

Run the code above in your browser using DataLab