Description Usage Arguments Value Examples
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.
1 | plotIntensityHistogram(image, bins = 255, main = "", xlab = "Value", col = grey(0))
|
image |
An intensity map. A greyscale image created using |
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. |
The histogram (generated by hist()
).
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.