---
panlei
2019-12-17 3ff1af612ee690063dceb5aa9a6e9791e6d9a943
algorithm/personTrack/personTrack.go
@@ -108,16 +108,22 @@
   if esId == result["esId"].(string) || result["esId"].(string) == ""{ // 说明没比到相似的人,是新人
      logger.Info("没比到人")
      arg.Uuid = esId
   } else if result["esId"].(string) != esId && result["compare"].(bool){ // 比到了相似的人且在此摄像机下已经出现过,最后不能插入数据库
      logger.Info("比对出来的dataId:",result["esId"].(string))
   } else if result["esId"].(string) != esId && result["isHave"].(bool){ // 比到了相似的人且在此摄像机下已经出现过,最后不能插入数据库
      logger.Info("不许入库的数据")
      arg.Uuid = ""
   } else if result["esId"].(string) != esId && !result["compare"].(bool) { // 比到了相似的人但在此摄像机下未出现过,要插入数据库
   } else if result["esId"].(string) != esId && !result["isHave"].(bool) { // 比到了相似的人但在此摄像机下未出现过,要插入数据库
      logger.Info("准备入库的数据")
      base := structure.BaseInfo{TargetId:result["esId"].(string)}
      arg.Liker = append(arg.Liker, &base)
   }
}
func track (rule *protomsg.Rule,am *structure.AreaMap) structure.LittleRuleResult{
   defer func() {
      if err := recover();err != nil {
         logger.Error("追踪判断失败",err)
      }
   }()
   var threshold float32 = 60 // 默认阈值为70
   if th,err := strconv.ParseFloat(rule.SdkArgValue,32); err == nil {
      threshold = float32(th)