createBackground {trackdem}R Documentation

Background detection

Description

createBackground detects the still background, containing all motionless pixels (non particles). Three different methods to detect the background can be used.

Usage

createBackground(colorimages, method = "mean")

Arguments

colorimages

Array of class 'TrDm' containing all images, obtained by loadImages.

method

Use method='mean' to calculate the mean value for each pixel and color. Use method='powerroot' to deflate dark values (note, this can only be used for dark particles on a light background). Use method='filter' to replace pixels in which movement has occurred with the mode of neighboring values. Note that method='filter' is computationally more intensive.

Value

Array of class 'TrDm' and 'colorimage' containing detected 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")
plot(stillBack)

## End(Not run)

[Package trackdem version 0.7.2 Index]