Description Usage Arguments Details Value Note Author(s) See Also Examples
computes polygon segments for TreeCrowns based on watershed algorithm
1 2 3 4 5 6 7 8 9 10 |
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). |
uses a MovingWindow of x*a+b to detect local maxima in a chm to compute TreeCrown Segments
parameter selection - use BestSegVal to automated detect best fitting parameters for a, b, h, MIN and filter.
returns a PolygonLayer with segments
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'.
Andreas Schönberg
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.