bilateral_smooth {bayesEO} | R Documentation |
Smooth probability images with Gaussian filter
Description
Takes a classified image with probabilities, and reduces outliers and smoothens probability according to a Gaussian filter
Usage
bilateral_smooth(x, window_size = 5, sigma = 8, tau = 0.1)
Arguments
x |
SpatRaster object with probabilities images |
window_size |
Size of the neighborhood. |
sigma |
Standard deviation of the spatial Gaussian kernel |
tau |
Standard deviation of the class probs value |
Value
A SpatRaster object
Author(s)
Gilberto Camara, gilberto.camara@inpe.br
Examples
if (bayes_run_examples()) {
# select a file with probability values
data_dir <- system.file("/extdata/probs/", package = "bayesEO")
file <- list.files(data_dir)
# create a full path for the file
probs_file <- paste0(data_dir, "/", file)
# provide the labels
labels <- c("Water", "ClearCut_Burn", "ClearCut_Soil",
"ClearCut_Veg", "Forest", "Wetland")
# read the probs file
probs <- bayes_read(probs_file, labels)
# smooth the probability image
bilat <- bilateral_smooth(probs,
window_size = 5,
sigma = 8,
tau = 0.1
)
# plot the probability image
bayes_plot(bilat, scale = 0.0001)
}
[Package bayesEO version 0.2.1 Index]