Plots a histogram of the intensity of an image's pixels

Share:

Description

This function calculates a histogram for the pixel values of an intensity map (a greyscale image) and plots it. It should not be called on a colour image.

Usage

1
plotIntensityHistogram(image, bins = 255, main = "", xlab = "Value", col = grey(0))

Arguments

image

An intensity map. A greyscale image created using imageToIntensity .

bins

The number of bins to use for the histogram.

main

The main title label.

xlab

The X axis label.

col

The R color to use for the histogram.

Value

The histogram (generated by hist() ).

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])
intensity<-imageToIntensity(img)
plotIntensityHistogram(intensity)

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