image_to_mat {pliman} | R Documentation |
Convert an image to a data.frame
Description
Given an object image, converts it into a data frame where each row corresponds to the intensity values of each pixel in the image.
Usage
image_to_mat(img, parallel = FALSE, workers = NULL, verbose = TRUE)
Arguments
img |
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 |
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 |
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 2.1.0 Index]