TreeSeg: Compute TreeCrown Segments

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/TreeSeg.R

Description

computes polygon segments for TreeCrowns based on watershed algorithm

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
TreeSeg(
  chm = NULL,
  a,
  b,
  h,
  MIN = 0,
  MAX = 1000,
  CHMfilter = 1,
  silent = FALSE
)

Arguments

chm

raster - Canopy Height Model RasterLayer.

a

numeric - single value for MovingWindow.

b

numeric - single value for MovingWindow.

h

numeric - maximum height of trees (in meter) to detect trees.

MIN

numeric - the minimum area for crowns. Smaller polygons are cropped.

MAX

numeric - the maximum area for crowns. Larger polygons are cropped.

CHMfilter

numeric - uses a sum filter on the chm with a MovingWindow of (x*x), which must be odd. Default=1 no filter.

silent

bolean - if TRUE the function will not print any progress messages (default=FALSE).

Details

uses a MovingWindow of x*a+b to detect local maxima in a chm to compute TreeCrown Segments

Value

returns a PolygonLayer with segments

Note

A 'brute force' segmentation with random parameters is not recommended. TreeSeg is mainly used to compute segments AFTER the validation of best fitting parameters with BestSegVal. Further to estimate the quality of the computed polygons it is recommended to use TreeSegCV for a x-fold CrossValdiation over x different subareas. For full workflow see the 'CENITH_Tutorial'.

Author(s)

Andreas Schönberg

See Also

BestSegVal,TreeSegCV

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# load packages
require(CENITH)
require(raster)
require(mapview)
# load data
chm <- raster::raster(system.file("extdata","lau_chm.tif",package = "CENITH"))
# take a look on the data
plot(chm)
# NOTE: the example should NOT show to get optimal results (for this see 'BestSegVal')
# start segmentation
x <- TreeSeg(chm,a=0.3,b=0.5,h=1)
length(x)# amount of trees
# compare result with chm
mapview(chm)+x
# clip min and or max polygons
y <-TreeSeg(chm,a=0.2,b=0.5,h=2,MIN=10,MAX=100)
length(y)# amount of trees
mapview(chm)+y

SchoenbergA/CENITH documentation built on Sept. 7, 2021, 9:54 a.m.