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.
framediff(b, thresh)
3-D matrix containing grayscaled video frames.
threshold required to obtain foreground images. Its value can be around 10-30 or more depending upon the accuracy.
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)