MotionMagnificator C++ lib. Fast library to emphasize motion on video for better detection

€4,000.00

MotionMagnificator C++ library version 3.0.0 is a versatile library that allows users to amplify subtle motion and temporal variations in digital video content.

LICENSE: We sell source code of this library as is, without future updates and technical support according to perpetual non-exclusive royalty-free license. You pay once and can use this library in your software and hardware products without limits. Please read the license agreement before purchasing: DOWNLOAD LICENSE. You can buy technical support service for this product.

Add To Cart
Technical support service
Options:

Purchase options

You can by this software online by card or you can buy the software by bank transfer. Bank transfer available only for companies. To buy software by bank transfer please send us request to info@constantrobotics.com. Also, you can buy technical support service for this product.

Downloads

Programmer’s manual: DOWNLOAD

Demo application to check algorithms performance on your video: DOWNLOAD

Overview

MotionMagnificator C++ library version is a versatile library that allows users to amplify subtle motion and temporal variations in digital video content. It allows camera system operators to detect moving objects that are not visible to the naked eye. Application area: perimeter security and drone detection. The library is implemented in C++ (C++17 standard). This library is suitable for various types of cameras (daylight, SWIR, MWIR and LWIR) and it provides robust magnification of movement for small objects. Each instance of the MotionMagnificator C++ class object performs frame-by-frame processing of a video data stream, processing each video frame independently. The library is designed only for not moving (or moving slowly) cameras or for PTZ cameras when observing in a certain sector. The library can work real-time on low power CPU. The library depends on open source VFilter library (provides interface as well as defines data structures for various video filters implementation, Apache 2.0 license). Additionally demo application depends on open source SimpleFileDialog (provides dialog to open files, Apache 2.0 license) and open source OpenCV library (provides functions to display video, Apache 2.0 license).

Demo video

VFilter compatible interface

class MotionMagnificator: public VFilter
{
public:

    /// Get string of current library version.
    static std::string getVersion();
    
    /// Initialize motion magnificator.
    bool initVFilter(VFilterParams& params) override;

    /// Set motion magnificator param.
    bool setParam(VFilterParam id, float value) override;

    /// Get motion magnificator param value.
    float getParam(VFilterParam id) override;

    /// Execute command.
    bool executeCommand(VFilterCommand id) override;

    /// Process frame.
    bool processFrame(cr::video::Frame& frame) override;
 
    /// Set magnification mask.
    bool setMask(cr::video::Frame mask) override;
    
    /// Decode and execute command.
    bool decodeAndExecuteCommand(uint8_t* data, int size) override;
}

Simple example

#include <opencv2/opencv.hpp>
#include "MotionMagnificator.h"

int main(void)
{
    // Open video file "test.mp4".
    cv::VideoCapture videoSource;
    if (!videoSource.open("test.mp4"))
        return -1;

    // Get frame size.
    int width = (int)videoSource.get(cv::CAP_PROP_FRAME_WIDTH);
    int height = (int)videoSource.get(cv::CAP_PROP_FRAME_HEIGHT);

    // Create frames.
    cv::Mat bgrImg;
    cr::video::Frame frameYuv(width, height, cr::video::Fourcc::YUV24);

    // Create motion magnificator object.
    cr::video::MotionMagnificator magnificator;

    // Main loop.
    while (true)
    {
        // Capture next video frame. Default BGR pixel format.
        videoSource >> bgrImg;
        if (bgrImg.empty())
        {
            // Set initial video position to replay.
            videoSource.set(cv::CAP_PROP_POS_FRAMES, 0);
            continue;
        }

        // Convert BGR to YUV for motion magnificator.
        cv::Mat yuvImg(height, width, CV_8UC3, frameYuv.data);
        cv::cvtColor(bgrImg, yuvImg, cv::COLOR_BGR2YUV);

        // Magnify movement with default params.
        magnificator.processFrame(frameYuv);

        // Conver result YUV to BGR to display.
        cv::cvtColor(yuvImg, bgrImg, cv::COLOR_YUV2BGR);

        // Show video.
        cv::imshow("VIDEO", bgrImg);

        // Wait ESC.
        if (cv::waitKey(1) == 27)
            return -1;
    }
    return 1;
}
Dehazer C++ lib. Fast video dehaze/defog algorithm
€300.00
ImageFlip C++ lib. Simple image flip implementation based on OpenCV
€3.00
DigitalZoom C++ lib. Digital zoom implementation based on OpenCV
€10.00