wangrong
2025-01-18 8b0e31121a9a29b92a41fc575138a2e9b4c12d8e
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
 
#include <vector>
#include <string>
#include <memory>
#include "../shapes/vp_point.h"
 
 
namespace vp_objects {
    // type of behaviour analysis
    enum class vp_ba_type {
        NONE = 0b00000000,       // none
        CROSSLINE = 0b00000001,  // cross line
        STOP = 0b00000010,       // enter stop status
        UNSTOP = 0b00000100,     // leave stop status
        JAM = 0b00001000,        // enter jam status
        UNJAM = 0b00010000,      // leave jam status
        GATHERING = 0b00100000,
        FALLDOWN = 0b01000000,
        WRONGDIRECTION =0b10000000
        /* more */
    };
 
    // result of behaviour analysis
    // BA logic can ONLY works on vp_frame_target
    class vp_ba_result
    {
    private:
        /* data */
    public:
        // type
        vp_ba_type type;
        // target ids which involved for this ba result, empty allowed.
        std::vector<int> involve_target_ids_in_frame;
        // region (or single line) involved for this ba result, empty allowed.
        std::vector<vp_objects::vp_point> involve_region_in_frame;
 
        // channel index of this ba result
        int channel_index;
        // frame index of this ba result
        int frame_index;
 
        // name of ba
        std::string ba_label = "not specified";
 
        // record image name if exist
        std::string record_image_name = "";
        // record video name if exist
        std::string record_video_name = "";
 
        vp_ba_result(vp_ba_type type, 
                    int channel_index,
                    int frame_index,
                    std::vector<int> involve_target_ids_in_frame, 
                    std::vector<vp_objects::vp_point> involve_region_in_frame,
                    std::string ba_label = "not specified",
                    std::string record_image_name = "",
                    std::string record_video_name = "");
        ~vp_ba_result();
 
        // get description for ba result
        virtual std::string to_string();
 
        // clone myself
        std::shared_ptr<vp_ba_result> clone();
    };
 
}