I am using the Matlab 2012 version with computer vision system toolbox. I have obtained the foreground mask for each frame in the video by system object i.e. vision.ForegroundDetector. For some pre-processing purpose I need the reference background image that is used by this system object for each instance of video. How can I obtain it? or Should I need to implement the foregroud detection algorithm myself?
Does this mean you would like the part of the background behind whatever the foreground object is? I don't think getting that is a feasible expectation from any foreground detection algorithm.
Say you have a video of a man standing behind a table, completely covering the table. Foreground detection can determine the man being the foreground object because of movement but there's no way to tell that there's a table behind the man given that there's no image evidence of the table existing.
If my understanding of your question is incorrect, please explain it some more.
Hope that helps.
If you assume that the background is the plain scene with no objects, and the foreground are objects that pass through (cars, people, etc.). You might assume that the background is the mode of all the frames. I think that a lot of people use Gaussian Mixture Models to do this kind of foreground/background discrimination.