Calculate a colour histogram for an RGB image data.frame

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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.