| | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "basic.com/valib/logger.git" |
| | | "encoding/base64" |
| | | "encoding/json" |
| | | "github.com/golang/protobuf/proto" |
| | | uuid "github.com/satori/go.uuid" |
| | | "ruleprocess/ruleserver" |
| | |
| | | } |
| | | for _, polygon := range cameraPolygons { |
| | | //logger.Println("++++++在这儿看一下区域啊:", polygon.Polygon) |
| | | areaMap := structure.AreaMap{CameraId: cameraId, AreaId: polygon.Id, AreaJson: polygon.Polygon, TriggerLine: polygon.TriggerLine, DirectionLine: polygon.DirectionLine} |
| | | areaMap := structure.AreaMap{CameraId: cameraId, AreaId: polygon.Id,AreaJson: polygon.Polygon, TriggerLine: polygon.TriggerLine, DirectionLine: polygon.DirectionLine} |
| | | // 为每个摄像机区域填充数据 |
| | | CountAreaObjs(&areaMap,arg) |
| | | arg.AreaMapList = append(arg.AreaMapList, &areaMap) |
| | |
| | | logger.Info("--------------追踪之后人脸的个数:", len(faceParam.Faces)) |
| | | for _, info := range faceParam.Faces { |
| | | //logger.Info("_______________________________________________第一次看相似值:",info.Pos.FAngle.Confidence*100) |
| | | photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Pos.FaceID)) , Rects: rectFormat(info.Pos.RcFace), Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: info.Feats},structure.SourcePhoto{}} |
| | | photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Pos.FaceID)) , Rects: rectFormat(info.Pos.RcFace), Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: base64.StdEncoding.EncodeToString(info.Feats)},structure.SourcePhoto{}} |
| | | arg.Photo = append(arg.Photo, photoMap) |
| | | } |
| | | args.Sdkdata = append(args.Sdkdata, &arg) |
| | |
| | | return |
| | | } |
| | | for _, info := range Track.Result { |
| | | logger.Info("接收跟踪数据:",info.Id,info.Confidence,info.Feature) |
| | | photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Id)),Score: float64(info.Confidence)*100,Rects: rectFormat(info.RcHuman), Type: "track"},structure.SourcePhoto{}} |
| | | logger.Info("接收跟踪数据:",info.Id,info.Confidence) |
| | | b,_ := json.Marshal(info.Feature) |
| | | photoMap := structure.PhotoMap{structure.SourcePhoto{Id: strconv.Itoa(int(info.Id)),Score: float64(info.Confidence)*100,Rects: rectFormat(info.RcHuman), Type: "track",Feature: base64.StdEncoding.EncodeToString(b)},structure.SourcePhoto{}} |
| | | arg.Photo = append(arg.Photo, photoMap) |
| | | } |
| | | args.Sdkdata = append(args.Sdkdata, &arg) |
| | |
| | | for _, info := range faceParam.Faces { |
| | | percent := ruleserver.PgsInterPercent(Rect2Point(photomap.Rects),rectFormat(info.Pos.RcFace), 1, 1) |
| | | if percent > 99 { |
| | | photomap.AttachObj = structure.SourcePhoto{Id:strconv.Itoa(int(info.Pos.FaceID)),Rects: rectFormat(info.Pos.RcFace),Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: info.Feats} |
| | | photomap.AttachObj = structure.SourcePhoto{Id:strconv.Itoa(int(info.Pos.FaceID)),Rects: rectFormat(info.Pos.RcFace),Score: float64(info.Pos.FAngle.Confidence * 100), Type: "face", ThftRes: *(info.Result), Feature: base64.StdEncoding.EncodeToString(info.Feats)} |
| | | } |
| | | } |
| | | } |