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

Description Usage Arguments Value Examples

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