im_moments: Get moment statistics of an image

View source: R/pictplot.R

im_momentsR Documentation

Get moment statistics of an image

Description

Get moment statistics of an image

Usage

im_moments(
  im,
  channel = 1:3,
  order = 1:4,
  space = "CIELAB",
  max_size = 1024,
  na.rm = FALSE
)

Arguments

im

an image

channel

color channel

order

order of the moment to be computed

space

color space, either "CIELAB" (default) or "RGB"

max_size

resize input image before calculation of moments

na.rm

logical. Should missing values be removed?

Value

a data frame of moment values

Examples

im_moments(regatta) # moments in CIELAB color space
im_moments(regatta, space = "RGB") # moments of RGB channels
im_moments(regatta, channel = 1) # L channel of CIELAB color space
im_moments(regatta, channel = "L") # same as above
im_moments(regatta, channel = 1, space = "RGB") # R channel of the input image
im_moments(regatta, channel = 2:3, order = c(2, 3)) # sd and skew in a and b channels
im_moments(regatta, channel = c("a", "b"), order = c(2, 3)) # same as above

tsuda16k/pictplot documentation built on March 1, 2023, 8:44 p.m.