From 58a689cabf762c761912b4aa5873a96c2f36310d Mon Sep 17 00:00:00 2001
From: zhangmeng <zhangmeng@aiotlink.com>
Date: 星期四, 19 十二月 2019 16:18:40 +0800
Subject: [PATCH] up
---
gohumantrack/gohumantrack.go | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gohumantrack/gohumantrack.go b/gohumantrack/gohumantrack.go
index 76d3d5c..7ac52ba 100644
--- a/gohumantrack/gohumantrack.go
+++ b/gohumantrack/gohumantrack.go
@@ -172,7 +172,7 @@
}
// ProcessImagePointer process
-func (h *HumanTracker) ProcessImagePointer(imgs []*ImageHumanTracker, w, h, c int) ([]FgResult, error) {
+func (h *HumanTracker) ProcessImagePointer(imgs []*ImageHumanTracker, wid, hei, chn int) ([]FgResult, error) {
if len(imgs) != h.batchSize {
return nil, errors.New("input images count doesn't equalize to batchsize")
}
@@ -181,11 +181,11 @@
return nil, errors.New("create C images error")
}
defer C.free(cImgs)
+ fake := make([]byte, wid*hei*chn)
for k, v := range imgs {
logo.Infoln("batch~~~~~~", k, " image: ", v)
if v == nil {
- fake := make([]byte, w*h*c)
- C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&fake[0]), C.int(w), C.int(h), C.int(c))
+ C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&fake[0]), C.int(wid), C.int(hei), C.int(chn))
} else {
C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&v.Data[0]), C.int(v.Width), C.int(v.Height), C.int(v.Channel))
}
--
Gitblit v1.8.0