# NOT RUN {
# Retrieve the samples for Mato Grosso
# select band "ndvi"
samples_ndvi <- sits_select(samples_modis_4bands, bands = "NDVI")
# select a random forest model
rfor_model <- sits_train(samples_ndvi, sits_rfor(num_trees = 500))
# create a data cube based on the information about the files
data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
cube <- sits_cube(
source = "LOCAL",
name = "sinop-2014",
satellite = "TERRA",
sensor = "MODIS",
data_dir = data_dir,
delim = "_",
parse_info = c("X1", "X2", "tile", "band", "date")
)
# classify the raster image
probs_cube <- sits_classify(cube,
ml_model = rfor_model,
output_dir = tempdir(),
memsize = 4, multicores = 2
)
# smooth the result with a bayesian filter
bayes_cube <- sits_smooth(probs_cube,
type = "bayes", output_dir = tempdir()
)
# smooth the result with a gaussian filter
gauss_cube <- sits_smooth(probs_cube,
type = "gaussian", output_dir = tempdir()
)
# smooth the result with a bilateral filter
bil_cube <- sits_smooth(probs_cube,
type = "bilateral", output_dir = tempdir()
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab