meanhsv: Compute mean HSV and RGB of image/object

Description Usage Arguments Value Author(s) Examples

Description

meanrgb returns the mean RGB values for the imageMatrix object. meanHSV returns the mean HSV values for the imageMatrix object.

Usage

1
2
meanrgb(imageMatrix)
meanhsv(imageMatrix)

Arguments

imageMatrix

an imageMatrix object

Value

A list with three elements corresponding to the HSV or RGB measures in the imageMatrix.

Author(s)

Solomon Messing <[last-name] at stanford dot edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Compare brightness of video still capture from MSNBC footage of Obama, with still capture from 
## an ad featuring the same footage (only Obama appears darker) that appeared in an ad on the Clinton 
## campaign website, causing a stir in the blogosphere.

data(Campaign2008)
 
clinton = new("imageMatrix", X = readPNG(system.file("extdata", "Clinton.png", package="ImageMetrics")), type = "rgba")
clintonface = new("imageMatrix", X = ObjSelect( image = clinton@X, poly= clintonpoly ), type = "rgb")

msnbc = new("imageMatrix", X = readPNG(system.file("extdata", "MSNBC.png", package="ImageMetrics")), type = "rgba")
msnbcface = new("imageMatrix", X = ObjSelect( image = msnbc@X, poly= msnbcpoly ), type = "rgb")

## Not run: 
plot(clinton)
plot(clintonface)
plot(msnbc)
plot(msnbcface)

## End(Not run)

meanhsv(clintonface)
meanhsv(msnbcface)

SolomonMg/ImageMetrics documentation built on May 27, 2019, 7:39 a.m.