Description Usage Arguments Value Examples
counts pixel values according to their classes
1 2 3 4 5 6 7 8 9 10 | get_counts(
ids = c(1, 2),
position = NULL,
imageFiles = NULL,
buffersize = 1.5,
outPrefix = "classified_index_",
ext = ".tif",
path = tempdir(),
dropChars = 0
)
|
ids |
numeric. the ids used for the training |
position |
sp. spatialpoint object containing the centre target positions |
imageFiles |
raster* image/classification file |
buffersize |
numeric. radius in meters around position |
outPrefix |
character. out prefix string |
ext |
character. extension |
path |
character. output path |
dropChars |
numeric. number of characters that should be dropped at the end of the filename |
data frame containing the number of pixels per class
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 | ## Not run:
##- required packages
require(uavRst)
##- project root folder
setwd(tempdir())
##- get the rgb image, chm and training data
utils::download.file("https://github.com/gisma/gismaData/raw/master/uavRst/data/tutorial.zip",
"tutorial_data.zip")
unzip(zipfile = "tutorial_data.zip" ,
exdir = ".")
# read data
position <- raster::shapefile("position.shp")
imageFiles <-Sys.glob(paths = paste0("rgb*","tif"))
imageTrainStack<-lapply(imageFiles, FUN=raster::stack)
## get counts
df1<-get_counts(position = position,
ids = c(100,200),
imageFiles = imageFiles,
outPrefix = "",
ext = ".tif",
path = tempdir())
head(df1)
##+
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.