Learn R Programming

Rvision (version 0.4.2)

sepFilter2D: Image Filtering with a Separable Linear Filter

Description

sepFilter2D applies a separable linear filter to an image. First, every row of the image is filtered with the 1D kernel kernel_x. Then, every column of the result is filtered with the 1D kernel kernel_y.

Usage

sepFilter2D(image, kernel_x, kernel_y, in_place = FALSE)

Arguments

image

An Image object.

kernel_x

A vector representing the kernel along the x axis.

kernel_y

A vector representing the kernel along the y axis.

in_place

A logical indicating whether the change should be applied to the image itself (TRUE, faster but destructive) or to a copy of it (FALSE, the default, slower but non destructive).

Value

An Image object if in_place=FALSE. Otherwise, it returns nothing and modifies image in place.

See Also

Image, filter2D, split, merge

Examples

Run this code
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
k_edge_detection_x <- c(1, 2, 1)
k_edge_detection_y <- c(1, 0, -1)
balloon_edge <- sepFilter2D(balloon, k_edge_detection_x, k_edge_detection_y)
plot(balloon_edge)

# }

Run the code above in your browser using DataLab