Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.data.frame.cimg

Convert a pixel image to a data.frame


Description

This function combines the output of pixel.grid with the actual values (stored in $value)

Usage

## S3 method for class 'cimg'
as.data.frame(x, ..., wide = c(FALSE, "c", "d"))

Arguments

x

an image of class cimg

...

arguments passed to pixel.grid

wide

if "c" or "d" return a data.frame that is wide along colour or depth (for example with rgb values along columns). The default is FALSE, with each pixel forming a separate entry.

Value

a data.frame

Author(s)

Simon Barthelme

Examples

#First five pixels
as.data.frame(boats) %>% head(5)
#Wide format along colour axis
as.data.frame(boats,wide="c") %>% head(5)

imager

Image Processing Library Based on 'CImg'

v0.42.10
LGPL-3
Authors
Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.