Blame view

src/util/crop_process.h 1.59 KB
0b4cd5d5   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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  #ifndef ___CROP_PROCESS_H__
  #define ___CROP_PROCESS_H__
  
  #include <vector>
  #include "acl/ops/acl_dvpp.h"
  #include "../ai_platform/header.h"
  
  using namespace std;
  
  class DeviceMemory;
  
  typedef enum Result {
      SUCCESS = 0,
      FAILED = 1
  } Result;
  
  class DvppCropProcess {
  public:
      /**
      * @brief Constructor
      * @param [in] stream: stream
      */
      DvppCropProcess();
  
      /**
      * @brief Destructor
      */
      ~DvppCropProcess();
  
  public:
      /**
      * @brief  Process Batch Crop
      * @return result
      */
      Result ProcessBatchCrop(DeviceMemory *devMem, vector<video_object_info> objs);
  
      /**
      * @brief init reousce
      * @return result
      */
      Result init(int deviceId);
  
  
  private:
      /**
      * @brief  InitBatchCropInputDesc
      * @return Result
      */
      Result InitBatchCropInputDesc(DeviceMemory *devMem);
  
      /**
      * @brief  InitBatchCropOutputDesc
      * @return Result
      */
      Result InitBatchCropOutputDesc(vector<video_object_info> objs);
  
      /**
      * @brief  DestroyBatchCropResource
      */
      void DestroyBatchCropResource();
  
  
      void DestroyResource();
  
      /**
      * @brief init reousce
      * @return result
      */
      Result InitProcess();
  
  private:
      int32_t deviceId_;
      aclrtContext context_;
      aclrtStream stream_;
  
      acldvppChannelDesc *dvppChannelDesc_;
      acldvppResizeConfig *resizeConfig_;
  
      std::vector<void *> vecOutPtr_;
  
      acldvppBatchPicDesc *inputBatchPicDesc_;   // vpc input desc
      acldvppBatchPicDesc *outputBatchPicDesc_;  // vpc output desc
  
      uint32_t inputBatchSize_;
      uint32_t outputBatchSize_;
  };
  
  #endif  // ___CROP_PROCESS_H__