---
panlei
2019-07-01 1af9b1aa5c9592c4f7f681b5bfe24da6eeac62b7
util/simpleCV.go
@@ -14,7 +14,6 @@
   webcam, _ := gocv.OpenVideoCapture(url)
   window := gocv.NewWindow("Hello")
   img := gocv.NewMat()
   for {
      webcam.Read(&img)
      window.IMShow(img)
@@ -149,3 +148,35 @@
      }
   }
}
func DrawPolygon(){
   // draw the rook
   rook := gocv.NewMatWithSize(w, w, gocv.MatTypeCV8UC3)
   defer rook.Close()
   green := color.RGBA{0, 255, 0, 0}
   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, green)
}