Skip to content

Detect motion on webcam video stream with cv::BackgroundSubtractorMOG2 algorithm and write it to a file

Notifications You must be signed in to change notification settings

vehlwn/MotionDetection

Repository files navigation

MotionDetection

This program reads video stream from a specified source and detects foreground motions on frames assuming static background. Stream fragments with motion will be written to a specieied folder.

For the description of configuration options see app.ini.

Dependencies:

  • Meson to build project;
  • OpenCV >= 4.6.0 for background subtractor algorithms;
  • Drogon for web server;
  • Boost >= 1.78.0 for logging, ranges ang alrogithms;
  • FFmpeg >= 5.1 for reading input files and writing output files.

Build

$ mkdir build && cd build
$ meson setup --buildtype release
$ meson compile
$ meson install
# Or install to alternative location:
$ meson setup --reconfigure --prefix install
$ meson install

# Alternative with drogon from subproject:
$ meson setup --buildtype release -D use_subproj_drogon=true
$ meson compile

# Alternative with conan:
$ conan build . --output-folder build --build=missing -s build_type=Release --profile profile-gcc.ini

# Alternative with conan in venv:
$ python -m venv venv
$ ./venv/bin/pip install -r requirements.txt
$ ./venv/bin/conan profile detect
$ ./venv/bin/conan build . --output-folder build --build=missing -s build_type=Release --profile profile-gcc.ini

About

Detect motion on webcam video stream with cv::BackgroundSubtractorMOG2 algorithm and write it to a file

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published