zhangmeng
2019-12-19 f0edb888cd3ca4ba4cdb1631a520787b28350d5f
update
1个文件已修改
4 ■■■■ 已修改文件
gohumantrack/gohumantrack.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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"
@@ -178,12 +178,12 @@
    }
    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)