andrewssobral / bgslibrary

A C++ Background Subtraction Library with wrappers for Python, MATLAB, Java and GUI on QT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why does the following three foreground people exist all the time?

JiananYuan opened this issue · comments

commented

Hi~ BGS is an excellent and nice work for CV research. I'm excited to run the example demo. However, when I select the AdaptiveSelectiveBackgroundLearning algorithm, the initial 3 people exist in all the video time. I mean, when the initial 3 people start moving to another place, the white foreground should move accordingly rather than keep in the same place. The 3 people region can be seen in the picture I marked below.

image

The project I currently do need to remove the initial white region. How can I fix this problem? Thx~

commented

Ah, I know that if the init frames don't contain moving people, then the effect is correct! But are there any solutions to solve the sutiation I mention above? Thank you!

The video url is https://github.com/opencv/opencv/blob/master/samples/data/vtest.avi

Hi @JiananYuan
Sorry for my delayed feedback to you,

In fact, the AdaptiveSelectiveBackgroundLearning algorithm isn't the good choice if you have initial objects moving in the initial frames. It works like the StaticFrameDifference algorithm.

For your case, the best is to select another algorithm that updates the background model constantly like GMM, KNN, PBAS and others.

image