---
panlei
2019-07-29 2f6498f4cbffbe99c2d279360581e9df88ea460f
util/simpleCV.go
@@ -161,8 +161,8 @@
   //rook := gocv.IMRead("/home/user/workspace/ruleprocess/util/105.jpg",gocv.IMReadColor)
   defer rook.Close()
   yellow := color.RGBA{255, 255, 0, 0}
   red := color.RGBA{255, 0, 0, 0}
   green := color.RGBA{0, 255, 0, 0}
   // 分割区域id集合并根据id查询区域然后画框
   for _,result := range results  {
@@ -171,14 +171,14 @@
      for i := 0; i < len(polygonIds)-1; i++ {
         polygon := getPolygonById(polygonIds[i],cameraId)
         if polygon.Polygon != "[]" {
            DrawAPolygon(&rook,polygon.Polygon,red)
            DrawAPolygon(&rook,polygon.Polygon,yellow)
         }
      }
   }
   // 把目标框出来
   for _,result := range results  {
      for _,rect := range result.Location {
         gocv.Rectangle(&rook, image.Rect(int(rect.X), int(rect.Y), int(rect.X+rect.Width), int(rect.Y+rect.Height)), green, 1)
         gocv.Rectangle(&rook, image.Rect(int(rect.X), int(rect.Y), int(rect.X+rect.Width), int(rect.Y+rect.Height)), red, 1)
      }
   }
   //return nil,nil