| | |
| | | // 把sdk从数据帧上提取的按照区域分类归置 |
| | | func SdkDataFormat(cameraId string, arg *SdkData, cameraPolygons []protomsg.CameraPolygon) { |
| | | for _, polygon := range cameraPolygons { |
| | | //log.Println("++++++在这儿看一下区域啊", polygon) |
| | | //log.Println("++++++在这儿看一下区域啊:", polygon.Polygon) |
| | | areaMap := AreaMap{cameraId: cameraId, areaId: polygon.Id, areaJson: polygon.Polygon, triggerLine: polygon.TriggerLine, directionLine: polygon.DirectionLine} |
| | | // 为每个摄像机区域填充数据 |
| | | areaMap.CountAreaObjs(arg) |
| | |
| | | for _, taskRule := range taskRuleList { |
| | | ruleList := taskRule.GroupRules // 获取的是task下面的任务组 |
| | | taskId := taskRule.TaskId |
| | | //log.Println("------------本组任务下的规则组的数量:",len(ruleList)) |
| | | for i := 0; i < len(ruleList); i++ { |
| | | temp := ruleList[i].Rules // temp为一组完整规则 在此需要判断规则是否是联动规则 |
| | | if len(temp) > 0 { |
| | |
| | | } |
| | | |
| | | }() |
| | | log.Println("++++++++++++++++++++++++++++规则开始运行+++++++++++++++++++++++++") |
| | | log.Println("+++++++++++规则开始运行+++++++++++++++++当前规则--:",*groupRule) |
| | | resultSplice := []*LittleRuleResult{} |
| | | // 先过完条件规则 |
| | | for j := 0; j < len(groupRule.Rules); j++ { |
| | |
| | | |
| | | // } |
| | | for _, obj := range arg.Photo { |
| | | log.Println("------------------看看sdkData的Photo数据----------------", obj, "----顺便看看占比-----:", PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale)) |
| | | log.Println("------------------看看sdkData:",arg.SdkName,"的Photo数据----------------", obj, "----顺便看看占比-----:", PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale)) |
| | | if threshold <= obj.Score && size <= float64(obj.Rects.Width*obj.Rects.Height) && intersectionper <= PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale) { |
| | | // 这步要备齐表达式里所需要的所有参数 |
| | | a.targetNum++ |
| | |
| | | a.time = time.Unix(time.Now().Unix(), 0).String()[11:16] |
| | | a.keepRight = arg.KeepRight |
| | | a.isStatic = arg.IsStatic |
| | | log.Println("--------------------看看区域数据:",*a) |
| | | } |
| | | |
| | | // 将字符串格式的坐标序列化为Point格式 |