[OpenCV] How to start the camera with gocv?
How to start the camera with gocv?
1. install OpenCV for gocv. [how to install]
2. run gocv code [github]
package main
import ("gocv.io/x/gocv")
func main() {
webcam, _ := gocv.VideoCaptureDevice(0)
window := gocv.NewWindow("Hello")
img := gocv.NewMat()
for {
webcam.Read(&img)
window.IMShow(img)
window.WaitKey(1)
}
}
3. show camera

Comments
Post a Comment