subtractBackground: Background subtraction

Description Usage Arguments Value Author(s) Examples

Description

subtractBackground subtracts each image from a previously created still background. The objects created through the function contain all changing pixels (i.e. movement).

Usage

1
subtractBackground(bg, colorimages = NULL)

Arguments

bg

Array containing still background, as returned from createBackground.

colorimages

Array containing all frames, obtained by loadImages. Default is NULL, in this case the original images are used from the global environment.

Value

Returns array of class 'TrDm' and 'sbg' with same size as images, subtracted from background.

Author(s)

Marjolein Bruijning, Caspar A. Hallmann & Marco D. Visser

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## 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)

trackdem documentation built on Sept. 25, 2021, 1:07 a.m.