panlei
2019-07-01 6e089538b182a064738a5d6ebcd60670efac63b0
util/simpleCV.go
@@ -93,6 +93,7 @@
   defer atom.Close()
   rook := gocv.NewMatWithSize(w, w, gocv.MatTypeCV8UC3)
   gocv.NewMatW
   defer rook.Close()
   black := color.RGBA{0, 0, 0, 0}
@@ -149,3 +150,32 @@
      }
   }
}
func DrawPolygon(){
   // draw the rook
   points := [][]image.Point{
      {
         image.Pt(w/4., 7*w/8.),
         image.Pt(3*w/4., 7*w/8.),
         image.Pt(3*w/4., 13*w/16.),
         image.Pt(11*w/16., 13*w/16.),
         image.Pt(19*w/32., 3*w/8.),
         image.Pt(3*w/4., 3*w/8.),
         image.Pt(3*w/4., w/8.),
         image.Pt(26*w/40., w/8.),
         image.Pt(26*w/40., w/4.),
         image.Pt(22*w/40., w/4.),
         image.Pt(22*w/40., w/8.),
         image.Pt(18*w/40., w/8.),
         image.Pt(18*w/40., w/4.),
         image.Pt(14*w/40., w/4.),
         image.Pt(14*w/40., w/8.),
         image.Pt(w/4., w/8.),
         image.Pt(w/4., 3*w/8.),
         image.Pt(13*w/32., 3*w/8.),
         image.Pt(5*w/16., 13*w/16.),
         image.Pt(w/4., 13*w/16.),
      },
   }
   gocv.FillPoly(&rook, points, white)
}