gleam: Gleam an Image

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/r_image_functions.R

Description

gleam will take an input image and "gleam" it. Gleam is one of many algorithms to to a color image greyscale. The gleam algorithm has been shown to be particularly effective in computer vision for detecting faces and objects. See Details for more information.

Usage

1
gleam(image, tau = (1/2.2), show = FALSE)

Arguments

image

Full path to the input image to be gleamed.

tau

Integer. The gamma-correction value. Each channel (RGB) in the image will be raised to this value. Defaults to 0.4545455.

show

Logical. Display the image after computing? Defaults to FALSE.

Details

This function uses EBImage to read in the image, extract the RGB colorspace, and then compute the gray values from the gleam algorithm.

The gleam algorithm can be formally stated as:

Gleam = 1/3(R' + G' + B')

Where R', G', and B' are the gamma-corrected color channels.

Value

Returns a a two-dimenstional array of gamma-corrected intensity pixel values equal to the width and height of the original image.

Author(s)

Daniel N. Albohn

See Also

See http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0029740 for detailed information on the benefits of using certain grayscale algorithms over others.

Examples

1
2
3
image <- system.file('extdata', 'obama.png', package = 'quantIm')
gleam_image <- gleam(image, show=TRUE)
...

d-bohn/quantIm documentation built on Jan. 23, 2021, 2:43 p.m.