wangrong
2025-01-03 2c4b8838f89bebca97615c5f0bac2c58e0349771
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
 
#include <map>
#include <opencv2/freetype.hpp>
#include "../vp_node.h"
#include "../../objects/shapes/vp_point.h"
#include "../../objects/shapes/vp_line.h"
 
namespace vp_nodes {
    // osd node for behaviour analysis of stop
    class vp_ba_stop_osd_node: public vp_node
    {
    private:
        // support chinese font
        cv::Ptr<cv::freetype::FreeType2> ft2;
 
        // support multi channels
        std::map<int, std::vector<int>> all_total_stop;  // channel -> stop target ids
        std::map<int, std::vector<vp_objects::vp_point>> all_stop_regions;   // channel -> stop region
        std::map<int, int> all_stop_count;  // channel -> stop count
    protected:
        virtual std::shared_ptr<vp_objects::vp_meta> handle_frame_meta(std::shared_ptr<vp_objects::vp_frame_meta> meta) override;
    public:
        vp_ba_stop_osd_node(std::string node_name,  std::string font = "");
        ~vp_ba_stop_osd_node();
    };
}