Learn R Programming

Rbgs (version 0.2)

admedian: Adaptive meadian background subtraction algorithm

Description

This function performs background subtraction on input grayscale frames using adaptive median background subtraction algorithm.The algorithm depends upon the number of previous frames taken into consideration.

Usage

admedian(b, nf, thresh)

Arguments

b

3-D matrix containing grayscaled video frames.

nf

Number of previous frames to be taken into consideration.

thresh

threshold required to obtain foreground images. its value can be around 10 to 30 depending upon the accuracy of the result.

Value

A 3-D matrix of frames containing foreground obtained after background subtraction is applied(binary images).

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
videoURL <- system.file("extdata","daria_skip.avi",package = "Rbgs")
frames <- readvideoframe(videoURL,1,15)
bground<-admedian(frames,3,25) 
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab