subtractBackground | R Documentation |
subtractBackground
subtracts each image from a
previously created still background.
The objects created through the function contain all changing
pixels (i.e. movement).
subtractBackground(bg, colorimages = NULL)
bg |
Array containing still background, as returned from
|
colorimages |
Array containing all frames, obtained by
|
Returns array of class 'TrDm' and 'sbg' with same size as images, subtracted from background.
Marjolein Bruijning, Caspar A. Hallmann & Marco D. Visser
## Not run:
dir.create("images")
## Create image sequence
traj <- simulTrajec(path="images",
nframes=30,nIndividuals=20,domain="square",
h=0.01,rho=0.9,
sizes=runif(20,0.004,0.006))
## Load images
dir <- "images"
allFullImages <- loadImages (dirPictures=dir,nImages=1:30)
stillBack <- createBackground(allFullImages,method="mean")
allImages <- subtractBackground(stillBack)
plot(allImages)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.