index.vue
12.4 KB
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!--
* @Author: panda
* @Date: 2021-12-18 12:57:47
* @LastEditTime: 2022-02-14 15:32:50
* @LastEditors: Please set LastEditors
* @Description: 算法配置
* @FilePath: /sdc-face/src/views/Algo/index.vue
-->
<template>
<div class="algobox">
<el-row :gutter="10">
<div class="leftbox">
<div class="video-box">
<div class="video-title">标注图像</div>
<div class="video-play">
<roicontent
:dtype="drawtype"
:bgUrl="roiimg"
:rois="roidata"
ref="rois"
@roiset="saveConfig"
@imgLoad="imgload"
></roicontent>
</div>
<div class="about-set">
<div class="setbtn-box">
<el-checkbox v-model="checked">规则设置</el-checkbox>
<span class="title" v-show="!checked"
>当前高度为3米进门线为宽松模式</span
>
<span v-show="checked">
<el-popover
placement="bottom"
width="320"
style="margin: 0 20px"
v-model="shapevisible"
>
<div style="text-align: left; margin: 0">
<el-radio
v-model="shape"
label="polygon"
style="margin-right: 20px"
@change="selectShape('polygon','recxysets')"
>多边形</el-radio
>
<el-radio
v-model="shape"
label="rect"
@change="selectShape('rect','recxysets')"
>矩形</el-radio
>
</div>
<div style="color:#ccc;font-size:12px">
选择多边形绘制,可以通过鼠标根据实际场景任意选定锚点,最后通过闭合实现多边形区域绘制。
</div>
<el-button slot="reference" @click="selectShape('rect','recxysets')" class="" size="mini" :class="{'isactive':active=='recxysets'}">识别区域</el-button>
</el-popover>
<el-popover
placement="bottom"
width="260"
style="margin-right: 20px"
v-model="todoorvisible"
>
<div style="text-align: left; margin: 0; color: #ccc">
用鼠标完成进门方向绘制,箭头方向表示人的进入方向。
</div>
<el-button slot="reference" @click="selectShape('arrow','directionxysets')" :class="{'isactive':active=='directionxysets'}"
size="mini">进门方向</el-button
>
</el-popover>
<el-popover
placement="bottom"
width="260"
v-model="linevisible"
>
<div style="text-align: left; margin: 0">
<el-select
v-model="doorLine"
placeholder="请选择"
size="mini"
>
<el-option label="宽松模式" :value="1"></el-option>
<el-option label="严格模式" :value="2"></el-option>
</el-select>
<div style="text-align: left; margin: 0; color: #ccc">
请用鼠标标定门的位置,如果您选择了严格模式,则只有人的轨迹跨过这条线才会被计数,如果选择了宽松模式,则人走到线附近也会被计数。
</div>
</div>
<el-button slot="reference" @click="selectShape('line','linexysets')" size="mini" :class="{'isactive':active=='linexysets'}"
>进门线</el-button
>
</el-popover>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="primary" :disabled="disabled" @click="saveRoi()" size="mini"
>保存</el-button
>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="defalut" @click="resetRoi()" size="mini"
>全部清空</el-button
>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="defalut" @click="refresh()" size="mini"
>刷新</el-button
>
</span>
</div>
<div class=""></div>
</div>
</div>
</div>
<!-- 客流算法设置 -->
<div class="rightbox">
<div class="set-box">
<div class="header">客流算法</div>
<div class="set-content">
<advancedSet
@closeadv="closeadvancedModal"
@saveconfig="saveConfig"
:advconfig="algoform"
v-show="advvisbale"
></advancedSet>
<el-form ref="form" :model="algoform" label-width="70px">
<div>
<el-tooltip
class="item tipinfo"
effect="dark"
content="人头尺寸大小"
placement="right"
>
<i class="el-icon-question" style="color:#ccc"></i>
</el-tooltip>
<el-form-item label="人头尺寸:" class="algosetfrom">
<el-slider
class="algoslider"
input-size="mini"
v-model="algoform.zoomscale"
:min="defalutConfig.zoomscalemin"
:max="defalutConfig.zoomscalemax"
:step="defalutConfig.zoomstep"
@change="senDataChange"
show-input
:show-tooltip="false"
>
</el-slider>
</el-form-item>
</div>
<div>
<el-tooltip
class="item tipinfo"
effect="dark"
content="敏感度越高则人越容易被检出,同时也容易出现吴检!"
placement="right"
>
<i class="el-icon-question" style="color:#ccc"></i>
</el-tooltip>
<el-form-item label="敏感度:">
<el-slider
class="algoslider"
input-size="mini"
v-model="algoform.sensitivity1"
@change="senDataChange"
:min="0"
:max="100"
:step="1"
show-input
:show-tooltip="false"
>
</el-slider>
</el-form-item>
</div>
<div class="topset">
<el-button type="text" @click="advclick">高级</el-button>
</div>
</el-form>
</div>
</div>
</div>
</el-row>
</div>
</template>
<script>
import roicontent from "./roi.vue";
import advancedSet from "./advancedSet.vue";
export default {
components: {
roicontent,
advancedSet,
},
data() {
return {
checked: false,
doorLine: 1,
shape: "rect",
disabled:false,
advvisbale: false,
shapevisible: false,
roiimg: "",
drawtype: "react",
linevisible: false,
todoorvisible: false,
headersize: "",
Sensibility: "",
active:'',
roidata:[{roi:{}}],
algconfigData:{},
algoform: {
zoomscale: 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
zoomscalemin: 0.5, //最小人头尺寸 [0,1000] step=5
zoomscalemax: 8, //最大人头尺寸 [0,1000] step=5
sensitivity1: 20, //敏感度1 [0,100] step=1
sensitivity2: 40, //敏感度2 [0,100] step=1
sensitivity3: 20, //敏感度3 [0,100] step=1
displaymode: 1, //模式选择 0:录像 1:经典 2:调试 3:展示
tracethreshold: 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
preframenum: 30, //轨迹预测帧数 [1,100] step=1
trackmotionthreshold: 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
trackshapethreshold: 0.5, //轨迹形态阀值 [0,1] step=0.1 alg:x100
removesimilarity: 75, //去重相似度 [10,100] step=0.01 alg:x100
removetime: 15, //去重时间 [0,1200] step=1
facelum: 0.5, //人脸亮度 [0,1] step=0.01 alg:x100
facequalitythreshold: 3.5, //人脸质量阀值 [0,5] step=0.1 alg:x100
maxage: 70, //最大年龄 [1,100] step=1
minage: 1, //最小年龄 [1,100] step=1
genderthreshold: 0.5, //男女阀值 [0,1] step=0.01 alg:x100
facecaptureinterval: 3, //人脸抓取间隔 [1,20] step=1
incoefficient: 1, //走入参数 [0.1,10] step=0.01 alg:x100
outcoefficient: 1, //走出参数 [0.1,10] step=0.01 alg:x100
},
defalutConfig: {
zoomstep: 0.1,
zoomscalemin: 0.5, //最小人头尺寸 [0,1000] step=5
zoomscalemax: 8, //最大人头尺寸 [0,1000] step=5
},
};
},
methods: {
senDataChange() {
this.saveConfig('config',this.algoform)
},
advclick() {
this.advvisbale = true;
},
/**
* @description: 设置ROI绘制图形及类型
* @param {*} val 图形类型
* @param {*} type 绘制类型
* @return {*}
*/
selectShape(val,type) {
this.$refs.rois.setDrawType(val,type);
this.active = type;
},
headeDataChange() {},
closeadvancedModal() {
this.advvisbale = false;
},
/**
* @description: 刷新
* @param {*}
* @return {*}
*/
refresh(){
this.getConfig('refresh')
},
/**
* @description: 获取配置参数
* @param {*}
* @return {*}
*/
getConfig(type){
this.$api.getAlgo().then(res => {
this.algconfigData = res;
this.algoform = res.scene.config.json.face;
this.roidata = res.scene.rois
if(type == 'refresh'){
this.$refs.rois.resetRoi();
this.$refs.rois.capImg();
}
})
},
/**
* @description: 保存算法配置
* @param {*} data 保存数据
* @return {*}
*/
saveConfig(type,data){
this.disabled = true;
let info = "";
if(type == 'config') {
this.algconfigData.scene.config.json.face = data;
info = "参数配置成功!"
} else if(type == 'roi') {
info = "标定配置成功!"
}
this.$api.setAlgo(this.algconfigData).then(res => {
if(res.success) {
this.getConfig('refresh');
// this.algconfigData.scene.config = this.algoform;
this.$message({
message: info,
type: 'success'
});
}
})
},
imgload(){
console.log('============loadingsuccess========')
this.disabled = false;
},
/**
* @description: 保存ROI设置
* @param {*}
* @return {*}
*/
saveRoi(){
this.$refs.rois.saveRoi()
},
resetRoi(){
this.$refs.rois.resetRoi()
this.disabled = false;
},
},
created(){
this.getConfig()
}
};
</script>
<style scoped>
.algobox {
margin-top: 10px;
}
.video-box {
text-align: left;
}
.leftbox {
float: left;
width: 860px;
}
.rightbox {
width: 335px;
float: left;
margin-left: 10px;
}
.video-play {
height: 500px;
background: #333;
}
.video-box .video-title {
height: 40px;
line-height: 40px;
border: 1px solid rgba(134, 132, 132, 0.5);
padding-left: 20px;
background: rgba(142, 228, 251,1);
}
.about-set {
text-align: left;
height: 40px;
line-height: 40px;
padding-left: 10px;
border: 1px solid rgba(134, 132, 132, 0.5);
}
.set-box .header {
height: 40px;
line-height: 40px;
background: rgba(142, 228, 251,1);
text-align: left;
padding-left: 10px;
width: 100%;
}
.set-content {
position: relative;
}
.setbtn-box .title {
font-size: 14px;
color: #409eff;
padding-left: 10px;
}
.tipinfo {
float: left;
padding-top: 10px;
width: 20px;
}
.algosetfromitem {
position: relative;
float: left;
}
.algoslider {
float: left;
width: 245px;
}
.topset {
text-align: right;
color: #000;
}
.isactive{
background: #409eff;
color: #fff;
}
</style>