imageToIntensity: imageToIntensity

Description Usage Arguments Details Value Examples

Description

Convert an image to an intensity map.

Usage

1
imageToIntensity(image, method="perceptual")

Arguments

image

An RGB raster image.

method

A string naming the method to use for colour conversion. "mean" - Use the mean of the red, green and blue channels. "perceptual"- Weight the red, green and blue channels perceptually.

Details

Many algorithms require an intensity map of the image rather than the full-colour version of the image. An intensity map is a greyscale version of the image.

Value

A greyscale image matrix.

Examples

1
2
3
4
5
6
library(CulturalAnalytics)
library(jpeg)
imgdir<-paste(system.file(package = "CulturalAnalytics"), "images", sep = "/")
imgs<-paste(imgdir, dir(path = imgdir, pattern = ".jpg"), sep = "/")
img<-readJPEG(imgs[1])
intensity<-imageToIntensity(img)

CulturalAnalytics documentation built on May 2, 2019, 5:24 p.m.