Learn R Programming

ForestTools (version 0.1.5)

TreeTopFinder: Treetop Finder

Description

Implements the variable window filter algorithm (Popescu & Wynne, 2004) for detecting treetops from a canopy height model.

Usage

TreeTopFinder(CHM, winFun, minHeight = NULL, maxCells = 2e+06,
  maxWinDiameter = 30, verbose = FALSE)

Arguments

CHM

Canopy height model. Either in raster format, or a path directing to a raster file. A character vector of multiple paths directing to a tiled raster dataset can also be used.

winFun

function. The function that determines the size of the window at any given location on the canopy. It should take the value of a given CHM pixel as its only argument, and return the desired radius of the circular search window when centered on that pixel.

minHeight

numeric. The minimum height value for a CHM pixel to be considered as a potential treetop. All CHM pixels beneath this value will be masked out.

maxCells

numeric. If the number of raster cells (i.e.: pixels) for the CHM exceeds this value, the TileScheme function will be applied internally to break apart the CHM into tiles to speed up processing.

maxWinDiameter

numeric. This parameter sets a cap on the maximum window size. If an improperly calibrated function is set for winFun, it may produce overly large windows that would perform poorly and significantly slow processing time. This setting can be disabled by setting to NULL.

verbose

logical. Print progress to console if set to TRUE.

Value

SpatialPointsDataFrame. The point locations of detected treetops. The object contains two fields in its data table: height is the height of the tree, as extracted from the CHM, and winRadius is the radius of the search window when the treetop was detected. Note that winRadius does not necessarily correspond to the radius of the tree's crown.

References

Popescu, S. C., & Wynne, R. H. (2004). Seeing the trees in the forest. Photogrammetric Engineering & Remote Sensing, 70(5), 589-604.

See Also

SegmentCrowns SpatialStatistics

Examples

Run this code
# NOT RUN {
# Set function for determining variable window radius
winFunction <- function(x){x * 0.06 + 0.5}

# Set minimum tree height (treetops below this height will not be detected)
minHgt <- 2

# Detect treetops in demo canopy height model
ttops <- TreeTopFinder(CHMdemo, winFunction, minHgt)
# }

Run the code above in your browser using DataLab