2

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.

2
  • Have you tried OpenCV's BackgroundSubtractorMOG2? Your method is like a toned down version of the one used there. Commented Jun 26, 2013 at 9:15
  • I am not trying to use any inbuilt libraries or functions of OpenCV because later i will have to port my entire program to different places where OpenCV might not be an option. Can you help me with relevant links where the process behind this MOG2 is described? maybe then i will be able to implement this myself. Thanks Commented Jun 26, 2013 at 9:22

3 Answers 3

2

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)

Sign up to request clarification or add additional context in comments.

1 Comment

Ya I used that method.. though a bit late, thanks for the link anyway :)
2

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.

Comments

0

Try these papers:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.