I'm trying to learn about background subtraction. I am using this tutorial as reference. However, my frame rates have dropped and the video has become "choppy". Is there a fix for this? Thanks.
Asked
Active
Viewed 921 times
0
-
Just for reference, there is a similar issue with `cv::cuda::BackgroundSubtractorMOG` as well. – scap3y Feb 03 '14 at 08:24
1 Answers
0
I'm assuming when you say "choppy" you mean real time processing has become slow. The MOG model is pretty computationally expensive.
Do you need a MOG model though? MOG is good if you have pixels which can take more than one expected range of values, and yet are still background. For example, trees moving in the wind: sky color and also leaf color. If you just subtract consecutive frames you get a lot of variation, but the MOG model will treat both as background. So if your application is not like that, maybe you shouldn't use MOG.
If you do decide to use the MOG model, setting the maximum number of mixture components to something like 2 (if that makes sense for your application) will likely make it faster.

Diana
- 1,301
- 1
- 9
- 21
-
The thing is, the performance for me is degrading over time.. Why is this happening..? I was searching for a memory leak but there wasn't any. – scap3y Feb 04 '14 at 15:06
-
Thanks for the reply. The scenario that I have is that my background will be a of a room and my objective is to track a moving object in the background such as a person. I would like to only track that particular person. Do you think that the MOG model is good for this? – user3264245 Feb 05 '14 at 01:10