cimg.extract | R Documentation |
Various shortcuts for extracting colour channels, frames, etc
Extract one frame out of a 4D image/video
frame(im, index) imcol(im, x) imrow(im, y) channel(im, ind) R(im) G(im) B(im)
im |
an image |
index |
frame index |
x |
x coordinate of the row |
y |
y coordinate of the row |
ind |
channel index |
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
Simon Barthelme
#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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.