Learn R Programming

Rvision (version 0.4.2)

bilateralFilter: Edge-Preserving Noise Reduction with a Bilateral Filter

Description

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.

Usage

bilateralFilter(image, d = 5, sigma_color = 25, sigma_space = 25)

Arguments

image

An Image object.

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).

Value

An Image object.

See Also

Image, gaussianBlur

Examples

Run this code
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_noisy <- balloon + image(array(sample(0:30, nrow(balloon) * ncol(balloon), replace = TRUE),
                                       dim = c(nrow(balloon), ncol(balloon), 3)))
plot(balloon_noisy)
balloon_bilateral <- bilateralFilter(balloon_noisy, 25)
plot(balloon_bilateral)

# }

Run the code above in your browser using DataLab