panlei
2019-06-29 ee52bd0ed3a2e6f02476044f8a9df8a056537f89
区域传值改为值传递,指针传递有问题
1个文件已修改
5 ■■■■■ 已修改文件
ruleserver/ruleToformula.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruleserver/ruleToformula.go
@@ -168,7 +168,7 @@
        if item.CameraId == cameraId && item.Type != "line" {
            // 需要根据比例把前台画的区域的坐标转化为相应摄像机拍摄的图像的大小   x坐标分别*image.width/页面区域宽  y坐标分别*image.height/页面区域高
            // 前台宽高固定
            log.Println("------------符合条件的区域:",item)
            //log.Println("------------符合条件的区域:",item)
            cameraPolygons = append(cameraPolygons, item)
        }
    }
@@ -179,7 +179,7 @@
// 把sdk从数据帧上提取的按照区域分类归置
func SdkDataFormat(cameraId string, arg *SdkData, cameraPolygons []protomsg.CameraPolygon) {
    for _, polygon := range cameraPolygons {
        log.Println("++++++在这儿看一下区域啊", polygon)
        //log.Println("++++++在这儿看一下区域啊", polygon)
        areaMap := &AreaMap{cameraId: cameraId, areaId: polygon.Id, areaJson: polygon.Polygon, triggerLine: polygon.TriggerLine, directionLine: polygon.DirectionLine}
        // 为每个摄像机区域填充数据
        areaMap.CountAreaObjs(arg)
@@ -364,7 +364,6 @@
    // }
    for _, obj := range arg.Photo {
        log.Println("-------------------看看areajson-------------", a.areaJson)
        log.Println("------------------看看sdkData的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) {
            // 这步要备齐表达式里所需要的所有参数