imageToRgb: Convert an image's pixels to a vector of RGB objects.

Description Usage Arguments Value Examples

View source: R/cultural-analytics.r

Description

This function converts the channels of a raster image to a vector of colorspace library RGB objects. These objects can be processed using colorspace functions and vector processing functions.

Usage

1

Arguments

image

An RGB raster image

Value

A vector of colorspace RGB objects, one for each pixel in the image. Rows can be extracted from this as ranges within the vector.

Examples

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<-imageToRgb(img)


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.