| | |
| | | mapCameraImageIndex map[string]int |
| | | recvImageCount int |
| | | index int |
| | | images []imageWithID |
| | | images []*imageWithID |
| | | msgs []*work.MsgRS |
| | | } |
| | | |
| | |
| | | recvImageCount: 0, |
| | | index: 0, |
| | | mapCameraImageIndex: make(map[string]int), |
| | | images: make([]*gohumantrack.ImageHumanTracker, batchSize), |
| | | images: make([]*imageWithID, batchSize), |
| | | msgs: make([]*work.MsgRS, batchSize), |
| | | } |
| | | } |
| | |
| | | |
| | | if i, ok := t.mapCameraImageIndex[rMsg.Msg.Cid]; ok { |
| | | if i < t.batchSize { |
| | | t.images[i] = imageWithID{&img, rMsg.Msg.Cid} |
| | | t.images[i] = &imageWithID{&img, rMsg.Msg.Cid} |
| | | t.msgs[i] = &rMsg |
| | | } |
| | | } else { |
| | | if t.index < t.batchSize { |
| | | t.images[t.index] = imageWithID{&img, rMsg.Msg.Cid} |
| | | t.images[t.index] = &imageWithID{&img, rMsg.Msg.Cid} |
| | | t.msgs[t.index] = &rMsg |
| | | t.mapCameraImageIndex[rMsg.Msg.Cid] = t.index |
| | | } |
| | |
| | | } |
| | | |
| | | var pimg []*gohumantrack.ImageHumanTracker |
| | | for k, v := range t.images { |
| | | pimg = append(v.img) |
| | | logo.Infoln("batch~~~~~~Map index: ", k, " camera: ", v.id) |
| | | for k, v := range t.images[:] { |
| | | if v != nil{ |
| | | pimg = append(pimg, v.img) |
| | | logo.Infoln("batch~~~~~~Image index: ", k, " camera: ", v.id) |
| | | }else{ |
| | | pimg = append(pimg, nil) |
| | | } |
| | | } |
| | | res, err := t.tracker.ProcessImagePointer(pimg) |
| | | t.recvImageCount = 0 |