Blame view

src/reprocessing_module/snapshot_reprocessing.h 2.35 KB
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  /*
   * @Author: yangzilong
   * @Date: 2021-12-17 20:27:57
   * @Last Modified by: yangzilong
   * @Email: yangzilong@objecteye.com
   * @Description:
   */
  #pragma once
  
  #include "../ai_platform/det_obj_header.h"
  #include <vector>
  #include <string>
  #include <map>
  #include <bitset>
e721ea0f   Hu Chunming   删除无用的三方库
15
  #include "../ai_platform/common_header.h"
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
  #include "../util/vpc_util.h"
  
  // #define EXPANSION_PROPORTION 0.1
  #define EXPANSION_PROPORTION 0.25 
  #define FACE_EXPANSION_PROPORTION 0.5
  #define IMG_CHANNELS 3
  
  using namespace std;
  
  class DeviceMemory;
  
  typedef struct multi_obj_data_t{
  	long long id;
  	DeviceMemory *memPtr;
  	std::vector<video_object_info> objs;
  	string task_id;
  } multi_obj_data_t;
  
  
  struct OBJ_VALUE {
  	bool finishTracker;  //轨迹结束可以保存了
  	int frameCount;
  	bool isupdate;
  	int lost;
  	vpc_img_info snapShot;
  	vpc_img_info snapShotLittle;
  	sy_rect obj_pos;
  	double confidence;	   		//	置信度
  	float last_area;
  	float max_area;
  	OBJ_INDEX index;
  
  	bitset< EDGESIZE >  flags;   //标志位,标记快照框应该如何判断,left:0  top:1  right:2  bottom:3
  	sy_point landmark_point[25];//人脸关键点位置信息
  	sy_rect position;  			//检测实际目标框
  	//-added by zsh 220719 人脸姿态角-
  	float roll = 0.0; 
  	float yaw = 0.0;												
  	float pitch = 0.0;
  	//-------------------------------
  };
  
  struct OBJ_VALUES {
  	OBJ_VALUE snapShots[3]; //缓存三张抓拍图 0-轨迹首张 1-轨迹最佳 2-轨迹末张
  	bool exists[3] = {false, false, false}; //标识对应抓拍图是否存在
  };
  
  class snapshot_reprocessing
  {
  public:
  	//更新最优快照
  	snapshot_reprocessing(int devId);
  	~snapshot_reprocessing();
  
  	void screen_effective_snapshot(vector<onelevel_det_result> &_onelevel_det_result);
  
  	void update_bestsnapshot(vector<DeviceMemory*> vec_devMem, vector<onelevel_det_result> &ol_det_result);
  	map<OBJ_KEY, OBJ_VALUE> get_total_snapshot_info();
  
  	void release_finished_locus_snapshot(const string taskid, const int objid = -1, bool bRelease = true);   //-1为删除该路所有任务的快照图
  
  private:
  	bool best_snapshot_judge_algor(const OBJ_KEY& obj_key, const OBJ_VALUE& obj_value, int left, int top, int width, int height, int image_width, int image_height);
  
  private:
  	map<OBJ_KEY, OBJ_VALUE> total_snapshot_info;
  	map<OBJ_KEY, OBJ_VALUE> total_face_snapshot_info;
  	map<OBJ_KEY, OBJ_VALUES> total_village_snapshot_info;
  
  	map<string, set<int>> algor_index_table;
  };