Video Analysis底层库拆分,sdk的go封装
zhangzengfei
2020-01-11 8464662ccdff684afeeee3356d838e838a0a5d11
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs cgodefs.go
 
package gosdk
 
type CPOINT struct {
    X int32
    Y int32
}
type CRECT struct {
    Left   int32
    Top    int32
    Right  int32
    Bottom int32
}
type CIMAGE struct {
    Data      *uint8
    Width     int32
    Height    int32
    Channel   int32
    Pad_cgo_0 [4]byte
}
type CFaceAngle struct {
    Yaw        int32
    Pitch      int32
    Roll       int32
    Confidence float32
}
type CThftResult struct {
    Gender       int32
    Age          int32
    Race         int32
    Beauty_level int32
    Smile_level  int32
}
type CFacePos struct {
    RcFace      CRECT
    PtLeftEye   CPOINT
    PtRightEye  CPOINT
    PtMouth     CPOINT
    PtNose      CPOINT
    FAngle      CFaceAngle
    NQuality    int32
    PFacialData [512]uint8
}
type CFaceInfo struct {
    RcFace      CRECT
    PtLeftEye   CPOINT
    PtRightEye  CPOINT
    PtMouth     CPOINT
    PtNose      CPOINT
    FAngle      CFaceAngle
    NQuality    int32
    PFacialData [8192]uint8
    NFaceID     int64
}
type CObjInfo struct {
    RcObj CRECT
    Typ   int32
    Prob  float32
}
 
//track yolo objs info
type CObjTrackInfo struct {
    ObjInfo CObjInfo
    ID      uint64
}
 
type CPlateIDCfg struct {
    FastMemorySize int32 // DSP等的片内内存大小 单位K
    MemorySize     int32 // 普通内存大小 单位 M
    MinPlateWidth  int32 // 检测的最小车牌宽度,以像素为单位
    MaxPlateWidth  int32 // 检测的最大车牌宽度,以像素为单位
    MaxImageWidth  int32 // 最大图像宽度
    MaxImageHeight int32 // 最大图像高度
    IsFieldImage   uint8 // 是否是场图像
    MovingImage    uint8 // 识别运动or静止图像
    OrderOpt       uint8 // 输出顺序选项 0-置信度 1-自上而下 2-自下而上
    LeanCorrection uint8 // 是否启用车牌旋转功能,默认开启
    ImproveSpeed   uint8 // 0: 识别率优先 1:识别速度优先
    CarLogo        uint8 // 0: 不检测车标 1: 检测车标
    LotDetect      uint8 // 0: 不检测车位 1: 检测车位
    Shadow         uint8 // 0: 针对无阴影的车牌 1:针对有阴影的车牌,默认开启
    ShieldRailing  uint8 // 0: 屏蔽栏杆干扰, 1:不屏蔽栏杆干扰
    CarModel       uint8 // 0: 不识别车型, 1: 识别车型
    LocateTh       uint8 // 车牌定位阈值
    OCRTh          uint8 // 车牌识别阈值
 
    Individual       uint8 // 个性化车牌开启
    TwoRowYellow     uint8 // 双层黄色车牌开启
    ArmPolice        uint8 // 单层武警车牌开启
    ArmPolice2       uint8 // 双层武警车牌开启
    TwoRowArmy       uint8 // 双层军队车牌开启
    Tractor          uint8 // 农用车车牌开启
    Embassy          uint8 // 使馆车牌开启
    ChangNei         uint8 // 厂内车牌开启
    MinHang          uint8 // 民航车牌开启
    Consulate        uint8 // 领事馆车牌开启
    NewEnergy        uint8 // 新能源车牌开启
    OnlyTwoRowYellow uint8 // 只识别双层黄牌开启
    OnlyLocation     uint8 // 只定位车牌开启
}
 
type CPlateIDResult struct {
    License [16]uint8 // 车牌字符串 STRING
    Color   [8]uint8  // 车牌颜色 STRING
 
    NColor      int32 // 车牌颜色
    NType       int32 // 车牌类型
    NConfidence int32 // 整牌可信度
    NBright     int32 // 亮度评价
    NDirection  int32 // 车牌运动方向,0 unknown, 1 left, 2 right, 3 up, 4 down
 
    RcLocation          CRECT     // 车牌坐标
    PbyBits             [4]uint8  // 识别结果对应的图片的缓冲区 NO USE
    NTime               int32     // 识别耗时
    NCarBright          uint8     // 车的亮度
    NCarColor           uint8     // 车的颜色
    NCarLogo            uint8     // 车标类型
    NCarType            uint8     // 车辆类型
    PbyPlateBin         [4]uint8  // 车牌二值化结果(按bit存储)NO USE
    NBinPlateWidth      [2]uint8  // 二值化结果中车牌宽度 NO USE
    NBinPlateHeight     [2]uint8  // 二值化结果中车牌高度 NO USE
    Reserved            [70]uint8 // 保留
    RcLogoLocation      CRECT     // 车标坐标
    NCarModel           [2]uint8  // 车辆类型
    NCarModelConfidence [2]uint8  // 车型可信度
}
 
type CPlateIDCloudCfg struct {
    NImageMode int32 //0:为帧模式 1:为场模式
    NRecMode   int32 //识别模式,0:单张图片识别,1:视频检测+识别,2:视频多帧融合识别(注:1模式比2模式快,但识别率和捕获率比2低)
 
    NMinPlateWidth int32 //识别最小车牌宽度
    NMaxPlateWidth int32 //识别最大车牌宽度
 
    NImageWidth  int32 //图片宽度
    NImageHeight int32 //图片高度
 
    NMinHorAngle int32
    NMaxHorAngle int32 //水平矫正角度范围,支持最大角度为[-30°,30°]
    NMinVerAngle int32
    NMaxVerAngle int32 //垂直矫正角度范围,支持最大角度为[-30°,30°]
 
    //此些项针对车型识别有用,其余无用
    FExpLeftRightR float32 //车脸左右扩充(车牌的宽度)倍数 参考值为1.6
    FExpTopR       float32 //车脸上部扩充(车牌的高度)倍数 参考值为6.0
    FExpBottomR    float32 //车脸下部扩充(车牌的高度)倍数 参考值为1.5
}
 
type CPlateIDCloudResult struct {
    License     [20]uint8 //识别结果
    RcLocation  CRECT     //车牌位置
    X           [4]int32
    Y           [4]int32
    NConfidence int32 //车牌置信度
    NType       int32 //车牌类型
    NDirection  int32 //车辆运动方向 0:朝近运动,1:朝远运动,-1:未知
    NCarColor   int32 //车身主颜色
    NCarColor1  int32 //车身次颜色
    NBright     int32 //车辆深浅色
    PResultBits int32 //视频识别模式中抓拍的图片,视频模式识别下有效,需要开辟
 
    FramNo int32    //视频模式下帧号
    Time   [7]int32 //视频识别模式中抓拍此张图的时间
 
    //针对车脸识别应用此项,其余无用
    FaceImage    int32 //对应的车脸的图片,需要提前开辟内存,开辟个最大内存就可以,宽高可以都为1000
    FaceWidth    int32 //车脸宽度
    FaceHeight   int32 //车脸高度
    GrayFaceFlag int32 //车脸是否为灰度图
 
    CharLocation   [20]CRECT //车牌字符的位置(基于大图)
    CharConfidence [20]CRECT //字符识别置信度
    CharNum        int32     //车牌字符数目
}
 
type CVehicleITSResult struct {
    NPlateFlag      int32     //是否识别到车牌
    NColor          int32     //车辆颜色
    NType           int32     //车辆类型
    License         [20]uint8 //车牌号码
    NConfidence     int32     // 车牌可信度
    NCharNum        int32     // 未知
    NCharConfidence [20]int32 // 未知
 
    RcLocation    CRECT //车牌位置
    RcCarLocation CRECT //车辆位置
 
    VehicleType  [1024]uint8 //车辆类型 --总名称  jeep-大切诺基-2004
    VehicleBrand [1024]uint8 //车辆品牌 --jeep
    VehicleSub   [1024]uint8 //车辆子型号 --大切诺基
    VehicleType1 [1024]uint8 //车辆类型   轿车 货车  客车  面包车
 
    FVDConf    float32 //车辆检测置信度
    FConfdence float32 //车辆类型置信度
 
    NVehicleSubModel int32 //车型名称索引
    NVehicleBright   int32 //车辆深浅色
    NVehicleColor1   int32 //车身主颜色
    NVehicleColor2   int32 //车身辅颜色
 
    PCaptureImage [4]uint8 //视频模式识别下抓拍的图片数据
    NImageWidth   int32    //视频模式下抓拍图像宽度
    NImageHeight  int32    //视频模式下抓拍图像高度
}