Learn R Programming

Rbgs (version 0.2)

framediff: Frame difference background subtraction algorithm.

Description

This functions performs background subtraction on input grayscale frames using dynamic frame difference background subtraction algorithm.The algorithm subtracts the previous frame from the current frame. hence background model is continuously updated with the previous frame.

Usage

framediff(b, thresh)

Arguments

b

3-D matrix containing grayscaled video frames.

thresh

threshold required to obtain foreground images. Its value can be around 10-30 or more depending upon the accuracy.

Value

A 3-D matrix of frames containing foreground obtained after background subtraction is applied(binary images). @examples ##Save the URL of the video file into R session and then load videoframes videoURL <- system.file("extdata","jog.mp4",package = "Rbgs") frames <- readvideoframe(videoURL,90,110) foreground <- framediff(frames,20)