From 0ea9f3f17bce70bf61a276f9531684460a3f3856 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 19 十二月 2019 13:54:20 +0800
Subject: [PATCH] dupate
---
work/sdk/humantrack.go | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/work/sdk/humantrack.go b/work/sdk/humantrack.go
index b5ccc61..209952e 100644
--- a/work/sdk/humantrack.go
+++ b/work/sdk/humantrack.go
@@ -38,8 +38,8 @@
recvImageCount: 0,
index: 0,
- images: make([]*gohumantrack.ImageHumanTracker, batchSize),
- msgs: make([]*work.MsgRS, batchSize),
+ images: make([]*gohumantrack.ImageHumanTracker, batchSize),
+ msgs: make([]*work.MsgRS, batchSize),
}
}
@@ -94,7 +94,7 @@
return
}
- hr := convert2ProtoHumanTrackResult(res)
+ hr := convert2ProtoHumanTrackResult(res[0])
result := protomsg.HumanTrackResult{Result: hr}
data, err := proto.Marshal(&result)
if err != nil {
@@ -106,7 +106,7 @@
if rMsg.Msg.Tasklab != nil {
id, name = rMsg.Msg.Tasklab.Taskid, rMsg.Msg.Tasklab.Taskname
}
- logo.Infoln("CAMERAID: ", rMsg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr[0]))
+ logo.Infoln("CAMERAID: ", rMsg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr))
}
@@ -140,12 +140,12 @@
}
}
if i, ok := t.mapCameraImageIndex[rMsg.Msg.Cid]; ok {
- if i < batchSize {
+ if i < t.batchSize {
t.images[i] = &img
t.msgs[i] = &rMsg
}
} else {
- if t.index < batchSize {
+ if t.index < t.batchSize {
t.images[t.index] = &img
t.msgs[t.index] = &rMsg
t.mapCameraImageIndex[rMsg.Msg.Cid] = t.index
@@ -181,7 +181,7 @@
if msg.Msg.Tasklab != nil {
id, name = msg.Msg.Tasklab.Taskid, msg.Msg.Tasklab.Taskname
}
- logo.Infoln("CAMERAID: ", msg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr[0]))
+ logo.Infoln("CAMERAID: ", msg.Msg.Cid, " TASKID: ", id, " TASKNAME: ", name, " Human Track COUNT: ", len(hr))
}
@@ -208,8 +208,8 @@
func convert2ProtoHumanTrackResult(obj gohumantrack.FgResult) []*protomsg.HumanTrack {
res := []*protomsg.HumanTrack{}
- for i := 0; i < int(v.FgNum); i++ {
- r := v.Fginfo[i]
+ for i := 0; i < int(obj.FgNum); i++ {
+ r := obj.Fginfo[i]
rect := protomsg.Rect{
Left: r.Left,
Right: r.Right,
--
Gitblit v1.8.0