rgbImageHist: Calculate a colour histogram for an RGB image data.frame

Description Usage Arguments Value References Examples

Description

This function calculates a colour histogram from a data.frame representing the pixels of an image as generated by imageToDataFrame .

Usage

1
rgbImageHist(rgbDataFrame, binResolution=25)

Arguments

rgbDataFrame

A data.frame representing the pixels of an image as generated by imageToDataFrame .

binResolution

How many sections to divide each dimension of colour space into.

Value

A colour histogram.

References

See: http://cns.bu.edu/~gsc/ColorHistograms.html

Examples

1
2
3
4
5
6
7
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])
rgbdf<-imageToDataFrame(img)
rgbhist<-rgbImageHist(rgbdf)

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