panlei
2019-11-07 59dcc2bba3b294b2679beb4f177b835552798ed5
ruleserver/readyDataForRule.go
@@ -284,11 +284,12 @@
   size := 0.0            // 尺寸
   areaPoints := Json2points(a.AreaJson)
   widthScale := float64(arg.ImageWidth / 960)
   heigthScale := float64(arg.ImageHeight / 540)
   logger.Info("看看图片的width和height:",arg.ImageWidth,arg.ImageHeight)
   widthScale := float64(arg.ImageWidth) / 960
   heigthScale := float64(arg.ImageHeight) / 540
   for _, obj := range arg.Photo {
      //logger.Info("------------------看看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) {
      if  obj.Score >= threshold && float64(obj.Rects.Width*obj.Rects.Height) >= size && PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale) >= intersectionper {
         // 这步要备齐表达式里所需要的所有参数
         a.TargetNum++
         arg1 := structure.Arg{obj.Id,obj.Score, PgsInterPercent(areaPoints, obj.Rects, widthScale, heigthScale), float64(obj.Rects.Width * obj.Rects.Height), obj.IsYolo, obj.Rects, obj.Feature, obj.ThftRes, []*structure.BaseInfo{}}
@@ -298,6 +299,9 @@
      }
   }
   logger.Info("区域是:",areaPoints,"区域内目标数量为:",a.TargetNum,"---",len(a.FilterData))
   for _,tar := range a.FilterData  {
      logger.Info("具体目标的坐标为",tar.Id,tar.Location)
   }
   a.Time = time.Unix(time.Now().Unix(), 0).String()[11:16]
   a.KeepRight = arg.KeepRight
   a.IsStatic = arg.IsStatic