This repository showcases examples of using the BGSLibrary, a comprehensive library for background subtraction in videos and image sequences. These examples are intended to help users understand how to integrate and utilize the BGSLibrary with OpenCV for various background subtraction tasks.
To use the examples in this repository, you must first build and install the BGSLibrary from source. Follow the installation instructions for your platform:
Quick start commands:
git clone --recursive https://github.com/andrewssobral/bgslibrary.git
cd bgslibrary/build
cmake ..
make -j $(nproc)
make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
By default, the BGSLibrary installs to /usr/local/bin/
for executables, /usr/local/lib/
for libraries, and /usr/local/include/
for include files.
Clone the examples repository and navigate to it:
git clone https://github.com/andrewssobral/bgslibrary-examples-cpp.git
cd bgslibrary-examples-cpp
To build and run an example, such as listing all algorithms:
make bgslibrary_list_algorithms
./bgslibrary_list_algorithms
To uninstall the BGSLibrary, you can use the following commands:
cd bgslibrary/build
cat install_manifest.txt | xargs echo rm | sh
rm -rf /usr/local/include/bgslibrary
rm -rf /usr/local/lib/cmake/BGSLibrary
This project uses configuration files stored in the config
directory. By default, all files in this directory are ignored except for .gitignore
and README.txt
, which provides details about the purpose of the directory.
Included examples demonstrate how to use the BGSLibrary for processing video from a camera, processing a sequence of images, and listing all available algorithms. Each example includes both a source file (.cpp
) and a build script (.sh
).
For any questions or issues, please refer to the BGSLibrary documentation or submit an issue on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.