zhangmeng
2019-12-19 eb47f1055b958438069fe6a96867835843ca595e
gohumantrack/gohumantrack.go
@@ -23,7 +23,6 @@
   return imgs;
}
int fill_images(void *imgs, const int size, const int index, void *data, const int w, const int h, const int c){
   if(!imgs || !data || size <= index) return -1;
   c_img *images = (c_img*)imgs;
   images[index].data_ = (unsigned char*)data;
   images[index].w_ = w;
@@ -47,6 +46,7 @@
*/
import "C"
import (
   "analysis/logo"
   "errors"
   "fmt"
   "math"
@@ -153,8 +153,8 @@
   }
   cRet := C.process(h.handle, cImgs, C.int(h.batchSize), h.result)
   if cRet == nil {
      return nil, errors.New("create C results error")
   if cRet != 0 {
      return nil, fmt.Errorf("process error: %d", int(cRet))
   }
   var result []FgResult
@@ -178,17 +178,17 @@
   }
   defer C.free(cImgs)
   for k, v := range imgs {
      logo.Infoln("batch~~~~~~", k, " image: ", v)
      if v == nil {
         C.fill_images(cImgs, C.int(h.batchSize), C.int(k), nil, 0, 0, 0)
      } 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))
      }
   }
   cRet := C.process(h.handle, cImgs, C.int(h.batchSize), h.result)
   if cRet != 0 {
      return nil, fmt.Errorf("process error: %d", cRet)
      return nil, fmt.Errorf("process image pointer error: %d", int(cRet))
   }
   var result []FgResult