At every pixel: is this the boring unchanging background, or something new standing in front of it? Free-play with four real algorithms, watch the exact per-pixel formula live under your cursor, export working OpenCV code, then prove you understand it in three graded challenges.
Hover the video for a live pixel-math tooltip: I_t, B_t, |I_t−B_t|, and the exact foreground/background verdict.
Every method in this lab answers the same question differently: what should B_t (the background estimate) be? Differencing uses the last frame. Running average blends slowly. MOG2 and KNN each keep a richer memory per pixel.
If a static object sits still long enough, alpha slowly folds it into B_t as "the new normal." The instant it moves away, the true background behind it looks different from B_t — briefly flagged as foreground, even though nothing new actually arrived.
Every slider here maps directly onto a real OpenCV parameter — varThreshold, learningRate, history. Tuning it visually first, then reading the generated code, is exactly how these parameters get chosen in a real pipeline.
In Level 2 (Swaying Tree), you keep the algorithm on Frame Differencing and just lower the threshold to try to clean things up. What happens?