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

cimg.extract

Various shortcuts for extracting colour channels, frames, etc


Description

Various shortcuts for extracting colour channels, frames, etc

Extract one frame out of a 4D image/video

Usage

frame(im, index)

imcol(im, x)

imrow(im, y)

channel(im, ind)

R(im)

G(im)

B(im)

Arguments

im

an image

index

frame index

x

x coordinate of the row

y

y coordinate of the row

ind

channel index

Functions

  • frame: Extract frame

  • imcol: Extract a particular column from an image

  • imrow: Extract a particular row from an image

  • channel: Extract an image channel

  • R: Extract red channel

  • G: Extract green channel

  • B: Extract blue channel

Author(s)

Simon Barthelme

Examples

#Extract the red channel from the boats image, then the first row, plot
rw <- R(boats) %>% imrow(10)
plot(rw,type="l",xlab="x",ylab="Pixel value")
#Note that R(boats) returns an image
R(boats)
#while imrow returns a vector or a list
R(boats) %>% imrow(1) %>% str
imrow(boats,1) %>% str

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.