imageEntropy: Calculate the entropy of the image

Description Usage Arguments Details Value Examples

View source: R/cultural-analytics.r

Description

A function that calculates the entropy of the image based on its histogram.

Usage

1
imageEntropy(histogram)

Arguments

histogram

A histogram of the image pixel values, as calculated by the hist() function.

Details

The entropy of an image is a useful indicator of how visually complex the image is.

Value

A value representing the entropy of the image.

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])
histogram<-hist(imageToIntensity(img), breaks=0:255/255, plot=FALSE)
entropy<-imageEntropy(histogram)

CulturalAnalytics documentation built on May 21, 2017, 1:23 a.m.

Search within the CulturalAnalytics package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.