R/background_subtraction.R

background_subtraction <- function(image, background) {
  if (!all.equal(dim(image), dim(background))) {
    stop("The video and the background image do not have the same dimensions.")
  }
  
  abs(image - background)
}
swarm-lab/videotrackR documentation built on May 30, 2019, 9:37 p.m.