Description Usage Arguments Value Examples
This function converts the channels of a raster image to a data.frame with red, green and blue columns. Each row of the data.frame represents one pixel in the image. Rows of the image can be accessed as ranges of rows in the data.frame.
This format is used by the palette and colour histogram functions.
1 |
image |
An RGB raster image. |
A data frame with columns named“red”,“green” and “blue”.
1 2 3 4 5 6 | 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])
rgbs<-imageToDataFrame(img)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.