Description Usage Arguments Value Author(s) Examples
Tree segmentation based on a CHM, basically returns a vector data set with the tree crown geometries and a bunch of corresponding indices. After the segementation itself, the results are hole filled and optionally, it can be filtered by a majority filter.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | chmseg_GWS(
treepos = NULL,
chm = NULL,
minTreeAlt = 2,
minTreeAltParam = "chm_Q20",
minCrownArea = 3,
maxCrownArea = 100,
leafsize = 256,
normalize = 0,
neighbour = 1,
method = 0,
thVarFeature = 1,
thVarSpatial = 1,
thSimilarity = 0.002,
segmentationBands = c("chm"),
majorityRadius = 3,
parallel = 1,
giLinks = NULL
)
|
treepos |
raster* object |
chm |
raster*. Canopy height model in |
minTreeAlt |
numeric. The minimum height value for a |
minTreeAltParam |
character. code for the percentile that is used as tree height treshold. It is build using the key letters |
minCrownArea |
numeric. A single value of the minimum projected tree crown area allowed. Default 3 sqm |
maxCrownArea |
numeric. A single value of the maximum projected tree crown area allowed. Default 100 sqm. |
leafsize |
integer. bin size of grey value sampling range from 1 to 256 see also: SAGA GIS Help |
normalize |
integer. logical switch if data will be normalized (1) see also: SAGA GIS Help |
neighbour |
integer. von Neumanns' neighborhood (0) or Moore's (1) see also: SAGA GIS Help |
method |
integer. growing algorithm for feature space and position (0) or feature space only (1), see also: SAGA GIS Help |
thVarFeature |
numeric. Variance in Position Space see also: SAGA GIS Help |
thVarSpatial |
numeric. Variance in Feature Space see also: SAGA GIS Help |
thSimilarity |
mumeric. Similarity Threshold see also: SAGA GIS Help |
segmentationBands |
character. a list of raster data that is used for the segmentation. The canopy height model |
majorityRadius |
numeric. kernel size for the majority filter out spurious pixel |
parallel |
running parallel or not default = 1 |
giLinks |
list. of GI tools cli paths |
sp* object
Chris Reudenbach
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ## Not run:
##- required packages
require(uavRst)
require(link2GI)
##- linkages
##- create and check the links to the GI software
giLinks<-uavRst::linkGI(linkItems = c("saga","gdal"))
if (giLinks$saga$exist ) {
##- project folder
projRootDir<-tempdir()
##- create subfolders please mind that the pathes are exported as global variables
paths<-link2GI::initProj(projRootDir = projRootDir,
projFolders = c("data/","data/ref/","output/","run/","las/"),
global = TRUE,
path_prefix = "path_")
##- overide trailing backslash issue
path_run<-ifelse(Sys.info()["sysname"]=="Windows", sub("/$", "",path_run),path_run)
setwd(path_run)
unlink(paste0(path_run,"*"), force = TRUE)
##- get the data
data(chm_seg)
data(trp_seg)
##- tree segmentation
crowns_GWS <- chmseg_GWS( treepos = trp_seg[[1]],
chm = chm_seg[[1]],
minTreeAlt = 10,
neighbour = 0,
thVarFeature = 1.,
thVarSpatial = 1.,
thSimilarity = 0.003,
giLinks = giLinks )[[2]]
##- visualize it
raster::plot(crowns_GWS)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.