imageEntropy: Calculate the entropy of the image

Description Usage Arguments Details Value Examples

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 2, 2019, 5:24 p.m.