bilateralFilter | R Documentation |
bilateralFilter
applies the bilateral filter to an image.
This filter can reduce unwanted noise very well while keeping edges fairly
sharp. However, it is very slow compared to most filters.
bilateralFilter(
image,
d = 5,
sigma_color = 25,
sigma_space = 25,
target = "new"
)
image |
An |
d |
The diameter in pixels of the filter neighborhood (default: 5). |
sigma_color |
The filter standard deviation in the color space (see Note; default: 25). |
sigma_space |
The filter standard deviation in the coordinate space (see Note; default: 25). |
target |
The location where the results should be stored. It can take 3 values:
|
If target="new"
, the function returns an Image
object. If target
is an Image
object, the function
returns nothing and modifies that Image
object in place.
A larger value of sigma_color
means that farther colors within
the pixel neighborhood will be mixed together, resulting in larger areas of
semi-equal color.
A larger value of sigma_space
means that farther pixels will
influence each other as long as their colors are close enough. When
d > 0
, it specifies the neighborhood size regardless of
sigma_space
. Otherwise, d
is proportional to sigma_space
.
Simon Garnier, garnier@njit.edu
Image
, gaussianBlur
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
rnd <- image(array(sample(0:30, nrow(balloon) * ncol(balloon), replace = TRUE),
dim = c(nrow(balloon), ncol(balloon), 3)))
changeBitDepth(rnd, "8U", target = "self")
balloon_noisy <- balloon + rnd
balloon_bilateral <- bilateralFilter(balloon_noisy, 25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.