Learn R Programming

imager (version 0.14)

imgradient: Compute image gradient

Description

Light interface for get_gradient. Refer to get_gradient for details on the computation.

Usage

imgradient(im, axes, scheme = 3)

Arguments

im
an image of class cimg
axes
direction along which to compute the gradient. Either a single character (e.g. "x"), or multiple characters (e.g. "xyz")
scheme
numerical scheme (default '3')

Value

  • an image or a list of images, depending on the value of "axes"

Examples

Run this code
grayscale(boats) %>% imgradient("x") %>% plot
imgradient(boats,"xy") #Returns a list

Run the code above in your browser using DataLab