zhangmeng
2019-12-19 7435e86bcabdf7bc2aa9604b05851b5810b47380
update
1个文件已修改
14 ■■■■■ 已修改文件
gohumantrack/gohumantrack.go 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gohumantrack/gohumantrack.go
@@ -39,18 +39,16 @@
    }
    return ret;
}
void *process(void *handle, void *imgs, const int size, void *result){
int process(void *handle, void *imgs, const int size, void *result){
    c_img *images = (c_img*)imgs;
    c_fgRet *res = (c_fgRet *)result;
    int ret = c_human_tracker_process(handle, images, size, res);
    if (ret != 0)
        return NULL;
    return res;
    return c_human_tracker_process(handle, images, size, res);
}
*/
import "C"
import (
    "errors"
    "fmt"
    "math"
    "unsafe"
)
@@ -189,12 +187,12 @@
    }
    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", cRet)
    }
    var result []FgResult
    p := uintptr(cRet)
    p := uintptr(h.result)
    for i := 0; i < h.batchSize; i++ {
        j := *(*FgResult)(unsafe.Pointer(p))
        result = append(result, j)