Blame view

tsl_aiplatform/ai_engine_module/VPTProcess.h 2.53 KB
85cc8cb9   Hu Chunming   原版代码
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
  /*******************************************************************************************
  * Version: VPT_x64_V2.0.0_20170705
  * CopyRight: 中科院自动化研究所模式识别实验室图像视频组
  * UpdateDate: 20170705
  * Content: 人车物监测跟踪
  ********************************************************************************************/
  #pragma once
  #include "opencv2/highgui/highgui.hpp"
  #include <iostream>
  #include "utools.h"
  #include "stl_aiplatform_header.h"
  #include <vector>
  #include "sort/Sort.h"
  
  using namespace std;
  
  // #define THRESHOLD 0.6
  #define THRESHOLD 0.45
  
  struct TaskTracker
  {
  	string TaskID;
  	double ratioWidth;
  	double ratioHeight;
  	Sort tracker;
  };
  
  
  typedef struct VPTProcess_PARAM
  {
  	int gpuid;              //指定显卡id
  	float threshold;
  	int max_batch;
  
  	char* serialize_file;
  	char* auth_license;
  	VPTProcess_PARAM() : gpuid(0), threshold(0.6), max_batch(20) {};
  }VPTProcess_PARAM;
  
  
  /*************************************************************************
  * FUNCTION: VPT_Init
  * PURPOSE: 初始化
  * PARAM:
  [in] vparam		参数
  * RETURN:	handle
  * NOTES:
  *************************************************************************/
  int VPT_Init(void *&handle, VPTProcess_PARAM vparam);
  
  
  /**
   * @brief 人车物检测跟踪
   *
   * @param handle [in]
   * @param batch_img [in]
   * @param batchsize [in]
   * @param result [in]
   * @param deleteObjectID [in]
   * @param unUsedResult [in]
   * @param class_label_count [in/out]
   * @return int -1:图像错误; 其他:检测到的个数
   */
  int VPT_Process_GPU(void * handle,  sy_img * batch_img, int batchsize, vector<onelevel_det_result>& result, vector<vector<int>>& deleteObjectID,
  				    vector<vector<onelevel_det_result>>& unUsedResult);
  
  
6e2b079e   Hu Chunming   编译通过
68
69
70
71
  int VPT_Process_GPU2(void * handle, sy_img * batch_img, vector<string>& tasklist,
  					vector<onelevel_det_result>& result, vector<vector<int>>& deleteObjectID, vector<vector<onelevel_det_result>>& unUsedResult);
  
  
85cc8cb9   Hu Chunming   原版代码
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  /*************************************************************************
  * FUNCTION: VPT_Release
  * PURPOSE: 资源释放
  * PARAM:
  [in] handle		- 处理句柄
  * RETURN:	NULL
  * NOTES:
  *************************************************************************/
  void VPT_Release(void * handle);
  
  
  
  void AddTaskTracker(void * handle, const string taskID, double rWidth =1, double rHeight=1);
  bool FinishTaskTracker(void * handle, const string taskID);
  void PauseTaskTracker(void * handle, const string taskID);
  void RestartTaskTracker(void * handle, const string taskID);
  void DrawTracker(void * handle, const int taskID, cv::Mat *img);