colorfulness: Quantify the colorfulness of an image.

Description Usage Arguments Details Value See Also Examples

Description

Quantify the colorfulness of a sRGB image using a bidimensional space form by the green/red and the blue/yellow axes of the CIE L*a*b* space, in other words, the lightness is excluded. In this bidimensional space, the algorithm creates a square with sides of 200 and centered in 0. Next, it compute how much area of this square is covered by the image pixels. The index is the percentage of cover.

Usage

1
2
3
4
colorfulness(x, mask = NULL, plot = FALSE, returnRaster = FALSE)

## S4 method for signature 'CanopyPhoto'
colorfulness(x, mask = NULL, plot = FALSE, returnRaster = FALSE)

Arguments

x

CanopyPhoto. Is the image that you want to know how colorful is.

mask

BinImage. The default value NULL means that all the pixels will be taking into account in the computations. If you provide a BinImage, it must have the same extent and resolution of x. All pixels from the image covered by pixels of the mask with value 1 will be taking into account in the computations.

plot

logical. By default it is FALSE, if TRUE a plot will be printed. See Details.

returnRaster

logical. By default it is FALSE, if TRUE this method returns the raster that you can see when plot is TRUE. See Details.

Details

When you request a plot with argument plot = TRUE, the colorfulness is returned but also a plot is sent to the active graphics Device. The plot shows the color of the image represented in a bidimensional space made by the axis a and b of the CIE L*a*b* space.

Value

numeric or Raster.

See Also

normalize, outOfDR.

Examples

1
2
3
4
5
6
7
8
x <- loadPhoto()
x <- normalize(x, 0, 255)
z <- makeZimage(ncol(x), lensPolyCoef(c(0.6427, 0.0346, -0.024491)))
m <- doMask(z, alim = asAngle(c(0, 10)), zlim = asAngle(c(30, 40)))
m <- doMask(z)
colorfulness(x, m, TRUE)
r <- colorfulness(x, m, TRUE, TRUE)
plotRGB(r)

GastonMauroDiaz/caiman documentation built on Jan. 22, 2022, 4:43 a.m.