image_to_mat {pliman}R Documentation

Convert an image to numerical matrices

Description

Given an object image, converts it into three matrices (RGB) and a data frame where each column corresponds to the RGB values.

Usage

image_to_mat(image, parallel = FALSE, workers = NULL, verbose = TRUE)

Arguments

image

An image object.

parallel

Processes the images asynchronously (in parallel) in separate R sessions running in the background on the same machine. It may speed up the processing time when image is a list. The number of sections is set up to 70% of available cores.

workers

A positive numeric scalar or a function specifying the maximum number of parallel processes that can be active at the same time.

verbose

If TRUE (default) a summary is shown in the console.

Value

A list containing three matrices (R, G, and B), and a data frame containing four columns: the name of the image in image and the R, G, B values.

Author(s)

Tiago Olivoto tiagoolivoto@gmail.com

Examples

library(pliman)
img <- image_pliman("sev_leaf.jpg")
dim(img)
mat <- image_to_mat(img)
dim(mat[[1]])

[Package pliman version 1.1.0 Index]