Learn R Programming

Rvision (version 0.6.0)

spatialGradient: First Order Derivatives of an Image with the Sobel Operator

Description

spatialGradient calculates the first order derivative of an image in both x and y using a Sobel operator.

Usage

spatialGradient(image, k_size = 5)

Arguments

image

An Image object.

k_size

The half-size in pixels of the kernel (default: 5).

Value

A list containing two Image objects, one of for the derivative along the x axis and the other for the derivative along the y axis.

See Also

Image, sobel

Examples

Run this code
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_gradient <- spatialGradient(balloon, 5)

# }

Run the code above in your browser using DataLab