imageAreaNormalised: Get the factors required to scale the images to an area of...

Description Usage Arguments Value Examples

View source: R/cultural-analytics.r

Description

Calcluate the factors required to scale each image so that it has an area of 1.0 . This is useful for trying to use the areas of differently proportioned images to indicate values. The resulting values can be used as cex arguments.

Usage

1

Arguments

images

The images to generate the scale factors for.

Value

The scale factors required to scale the images to an area of 1.0 .

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(CulturalAnalytics)
library(jpeg)

# Get the images

imgdir<-paste(system.file(package = "CulturalAnalytics"), "images", sep = "/")
dirimgs<-paste(imgdir, dir(path = imgdir, pattern = ".jpg"), sep = "/")
imgs<-lapply(dirimgs, function(imgpath){readJPEG(imgpath)})

# Calculate the scale factors required to draw them sized 1.0 each
imageAreaNormalised(imgs)

CulturalAnalytics documentation built on May 31, 2017, 3:28 a.m.