stephanecharette / MoveDetect

Library to detect whether movement can be detected between two images or video frames.

Home Page:https://www.ccoderun.ca/programming/doxygen/movedetect/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is MoveDetect?

MoveDetect is a C++ library that detects movement in video frames and returns a "true" or "false" value.

MoveDetect introduction

License

MoveDetect is open source and published using the MIT license. Meaning you can use it in your commercial application. See license.txt for details.

How to Build MoveDetect

MoveDetect requires OpenCV. On Ubuntu:

sudo apt-get install cmake build-essential libopencv-dev
cd ~/src
git clone https://github.com/stephanecharette/MoveDetect.git
cd MoveDetect
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make package

Example Code

MoveDetect has many configuration settings to modify the detection threshold, and optionally draw the mask output, bounding boxes, and and contour lines.

MoveDetect with bounding boxes and contours

This is how to use it:

// include MoveDetect.hpp and link against MoveDetect and OpenCV
//
MoveDetect::Handler handler;
cv::VideoCapture video("movie.m4v");
while (true)
{
    cv::Mat frame;
    video >> frame;
    if (frame.empty())
    {
        break;
    }
    //
    const bool movement_detected = handler.detect(frame);
    if (movement_detected)
    {
        // ...
    }
}

C++ API Doxygen Output

The official MoveDetect documentation and web site is at https://www.ccoderun.ca/programming/doxygen/movedetect/.

Some links to specific useful pages:

About

Library to detect whether movement can be detected between two images or video frames.

https://www.ccoderun.ca/programming/doxygen/movedetect/

License:MIT License


Languages

Language:C++ 83.7%Language:CMake 9.5%Language:HTML 6.8%