subtractBackground: Background subtraction

subtractBackgroundR Documentation

Background subtraction

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

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

## 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 May 29, 2024, 7:43 a.m.