Question

I am trying to implement a simple background subtraction method for the detection of moving objects in a particular scene. The objective is to kind of segment out a particular motion out of a video to use it in another video.

The algorithm i am following is: 1. Take the first 25frames from the video and average them to get a background model. 2. Find the standard deviation of those 25frames and store the values in another image. 3. Now i am calculating the absolute difference between each frame and average background model pixel wise.

The output i am getting is kind of a transparent motion being highlighted in white (the absolute differencing is resulting in the transparency i think). I want to know whether my approach is right or not considering that i will be doing a segmentation upon this output as next step? And also i am getting no idea as to how to use the standard deviation image. Any help will be appreciated.

Please let me know if this is not the type of question that i should post in stack overflow. In that case any reference or links to other sites will be helpful.

Était-ce utile?

La solution

You said it looks like transparent.

This is what you saw right?→ See YouTube Video - Background Subtraction (approximate median)

enter image description here

The reason is you use the median value of all frames to create the background. What you saw in white in your video is the difference of your foreground(average image) and your background. Actually, median filtered background subtraction method is simple, but it's not a robust method.

You can try another background subtraction method like Gaussian Mixture Models(GMMs), Codebook, SOBS-Self-organization background subtraction and ViBe background subtraction method.

See YouTube Video - Background Subtraction using Gaussian Mixture Models (GMMs)

Autres conseils

You should take a look at that blog. http://mateuszstankiewicz.eu/?p=189 You will find a start of Answer. Moreover I think there is a specific module for video analysis in Opencv.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top