Ged C++ lib. Detection of small changes in video streams

€10,000.00

C++ Ged library for automatic detection of changes on videos. Designed for integration into commercial and industrial video processing applications.

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: LICENSE.

C++ Ged library for automatic detection of changes on videos. Designed for integration into commercial and industrial video processing applications.

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: LICENSE.

Overview

C++ Ged (Changes detector) library is designed for automatic detection of subtle changes on videos. The library is implemented in C++ (C++17 standard) and utilizes the OpenMP library (2.0 standard and newer, built in C++ compiler) to facilitate parallel computation. Besides the OpenMP runtime of the compiler it uses only the ObjectDetector (interface), Frame and ConfigReader libraries, which are separate repositories. The library works real-time on low-power CPU. The library is compatible with any processors and operating systems that support the C++ compiler (C++17 standard), provided the compiler has built-in support for the OpenMP (2.0 standard and newer) parallel computing language. The library processes video of different camera types (daylight, SWIR, MWIR and LWIR) and detects small-size and low-contrast objects against complex backgrounds. Each instance of the Ged C++ class performs frame-by-frame processing of one video data stream: the result of a frame also depends on the previous frames of the stream. The library inherits its interface from the ObjectDetector (provides interface for object detector) class, offering flexible and customizable parameters. The library is designed mainly for fixed cameras and for PTZ cameras while pan, tilt and zoom do not change. The library can also be used for object detection after the camera has been moved by an external command. The library is compatible with low-power CPUs.

Downloads

Documentation: GO TO DOCUMENATION

Demo application to check algorithms performance on your video (Windows x64): DOWNLOAD

Demo video

Simple interface

class Ged : public ObjectDetector
{
public:
    /// Get string of current library version.
    static std::string getVersion();

    /// Class constructor.
    Ged();

    /// Class destructor.
    ~Ged();

    /// Init object detector.
    bool initObjectDetector(ObjectDetectorParams& params) override;

    /// Set object detector param.
    bool setParam(ObjectDetectorParam id, float value) override;

    /// Get object detector param value.
    float getParam(ObjectDetectorParam id) override;

    ///  Get object detector params including list of detected objects.
    void getParams(ObjectDetectorParams& params) override;

    /// Get list of detected objects.
    std::vector<Object> getObjects() override;

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

    /// Perform detection.
    bool detect(cr::video::Frame& frame) override;

    /// Set detection mask.
    bool setMask(cr::video::Frame mask) override;

    /// Decode and execute command.
    bool decodeAndExecuteCommand(uint8_t* data, int size) override;

    /// This method retrieves the motion detection binary mask.
    bool getMotionMask(cr::video::Frame& mask);
};

Simple example

#include <cstdint>
#include <iostream>
#include <string>
#include <vector>
#include "Ged.h"
#include "VSourceFile.h"

int main()
{
    // Open video file "test.mp4". The video source library decodes the video
    // frames and plays the file in a loop.
    rapidpixel::VSourceFile videoSource;
    std::string initString = "test.mp4";
    if (!videoSource.openVSource(initString))
    {
        std::cout << "Can't open video file " << initString << std::endl;
        return -1;
    }

    // Create detector and set params.
    rapidpixel::Ged detector;
    if (!detector.setParam(rapidpixel::ObjectDetectorParam::MIN_OBJECT_WIDTH, 4) ||
        !detector.setParam(rapidpixel::ObjectDetectorParam::MAX_OBJECT_WIDTH, 96) ||
        !detector.setParam(rapidpixel::ObjectDetectorParam::MIN_OBJECT_HEIGHT, 4) ||
        !detector.setParam(rapidpixel::ObjectDetectorParam::MAX_OBJECT_HEIGHT, 96) ||
        !detector.setParam(rapidpixel::ObjectDetectorParam::SENSITIVITY, 10))
    {
        return -1;
    }

    // Video frame. NV12 is the pixel format of the decoders of the video source
    // library: the decoded frames are not converted.
    rapidpixel::Frame frame;
    frame.fourcc = rapidpixel::Fourcc::NV12;
    // Maximum time to wait for a video frame, milliseconds.
    const int32_t frameTimeoutMsec = 5000;

    // Main loop. The application stops if a call fails (stop it with Ctrl+C).
    while (true)
    {
        // Wait for the next video frame.
        if (!videoSource.getFrame(frame, frameTimeoutMsec))
        {
            std::cout << "No video frame" << std::endl;
            return -1;
        }

        // Detect objects.
        if (!detector.detect(frame))
        {
            std::cout << "Can't process video frame" << std::endl;
            return -1;
        }

        // Print detected objects.
        const std::vector<rapidpixel::Object> objects = detector.getObjects();
        std::cout << "Frame " << frame.frameId << ": " << objects.size()
                  << " objects" << std::endl;
        for (const rapidpixel::Object& object : objects)
        {
            std::cout << "    ID " << object.id << " x " << object.x << " y "
                      << object.y << " width " << object.width << " height "
                      << object.height << std::endl;
        }
    }
}