Description Usage Arguments Value Examples
This function produces a matrix of summaries for a list of images.
1 |
images |
A list of raster images |
A matrix of summary values for the images. Each row represents a single image. See the column names for what the values represent, they are the summaryHsv and sdHsv values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(CulturalAnalytics)
library(jpeg)
stripExtension<-function(filename){
sub("\\.[^.]+$", "", filename)
}
underscoresToSpaces<-function(source){
gsub("_", " ", source)
}
cleanFilename<-function(filepath){
filename<-basename(filepath)
name<-stripExtension(filename)
underscoresToSpaces(name)
}
imgdir<-paste(system.file(package = "CulturalAnalytics"),
"images/Claude_Monet/Haystacks", sep = "/")
imgPaths<-paste(imgdir, dir(path = imgdir, pattern = ".jpg"), sep = "/")
imgs<-lapply(imgPaths, function(path){readJPEG(path)})
imgNames<-cleanFilename(imgPaths)
imageSummariesData<-data.frame(name=imgNames,
imageSummaries(imgs),
stringsAsFactors=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.