'ForestTools' segmentation of individual tree crowns based on a canopy height model and initial seeding points (trees). Very fast algorithm based on the imagr watershed algorithm. Andrew Plowright: R package 'ForestTools'

chmseg_FT(
  treepos = NULL,
  chm = NULL,
  minTreeAlt = 2,
  format = "polygons",
  winRadius = 1.5,
  verbose = FALSE
)

Arguments

treepos

raster*. The positions of the estimated top of trees. The function will generally produce a number of crown segments equal to the number of treetops.

chm

raster*. Canopy height model in raster format. Should be the same that was used to create the input for treepos.

minTreeAlt

numeric. The minimum height value for a CHM pixel to be considered as part of a crown segment. All chm pixels beneath this value will be masked out. Note that this value should be lower than the minimum height of treepos.

format

character. Format of the function's output. Can be set to either 'raster' or 'polygons'.

winRadius

numeric the fixed radius written in the SPDF of the tree top file if not generated by Foresttools

verbose

to be quiet FALSE

Value

sp* object

Examples

 require(uavRst)
## get the data
 data(chm_seg)
 data(trp_seg)
## you may create the Foresttools tree tops
## otherwise the raster is transformed to a SPDF according to the FT format   
#trp <- ForestTools::vwf(chm_seg[[1]], winFun = function(x){x * 0.06 + 0.5}, minHeight = 2)
## segmentation
crownsFT <- chmseg_FT(chm = chm_seg[[1]],
                       treepos = trp_seg[[1]],
                       format = "polygons",
                       minTreeAlt = 23,
                       winRadius = 1.5,
                       verbose = FALSE)
#> Warning: Duplicate 'treeID' identifiers detected

## Visualisation
raster::plot(crownsFT)