| | |
| | | } |
| | | |
| | | // 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") |
| | | } |
| | |
| | | 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)) |
| | | } |