finds.dev← search

// the find

andrewssobral/bgslibrary

★ 2,275 · C++ · MIT · updated May 2026

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

BGSLibrary is a C++ collection of 43 background subtraction algorithms for detecting moving objects in video, built on top of OpenCV. It dates to 2012 but is still maintained, with Python bindings available via pip and a Pixi-based build system added recently. The target audience is CV researchers and engineers who want to benchmark multiple BGS approaches without reimplementing them.

43 algorithms under one factory interface means you can swap between FrameDifference, GMM variants, ViBe, SuBSENSE, and others with a one-line change — genuinely useful for benchmarking. The Pixi build path is a real quality-of-life improvement: it provisions OpenCV itself, so you are not fighting system library mismatches. The algorithm compatibility table across OpenCV versions is honest and specific, which saves hours of confusing runtime errors. The Python wrapper ships on PyPI, so Python users get `pip install pybgs` and a working `apply`/`getBackgroundModel` loop without touching CMake.

OpenCV 4 drops 16 of the 43 algorithms — nearly 40% of the library is dead on any modern OpenCV install, and there is no sign those gaps will be filled. The core codebase has not had a new algorithm added in years; the research frontier (deep-learning-based BGS) is entirely absent. Build friction is still real: `pip install pybgs` compiles from source and requires system OpenCV dev headers, which will silently fail on many machines. Documentation lives in a GitHub wiki that looks abandoned in places, and the QT GUI is the only non-deprecated graphical front end, which is a significant dependency to pull in for what is essentially a demo tool.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →