GoCV The GoCV package provides Go language bindings for the OpenCV 4 computer vision library. The GoCV package supports the latest releases of Go and OpenCV (v4.0.0) on Linux, macOS, and Windows. We intend to make the Go language a "first-class" client compatible with the latest developments in the OpenCV ecosystem. GoCV also supports Intel OpenVINO . Check out the OpenVINO README for more info on how to use GoCV with the Intel OpenVINO toolkit. How to use Hello, video This example opens a video capture device using device "0", reads frames, and shows the video in a GUI window: package main import ( " gocv.io/x/gocv " ) func main () { webcam , _ := gocv. OpenVideoCapture ( 0 ) window := gocv. NewWindow ( " Hello " ) img := gocv. NewMat () for { webcam. Read (&img) window. IMShow (img) window. WaitKey ( 1 ) } } Face detect This is a more complete example that opens a v...
This page has information on how to install and use GoCV on macOS. Installing Install the GoCV package: go get -u -d gocv.io/x/gocv You can install OpenCV 4.0.0 using Homebrew. If you already have an earlier version of OpenCV (3.4.x) installed, you should probably remove it before installing the new version: brew uninstall opencv You can then install OpenCV 4.0.0: brew install hybridgroup /tools/ opencv This new Homebrew recipe will install only OpenCV 4.0.0 without all of the Python dependencies. pkgconfig Installation pkg-config is used to determine the correct flags for compiling and linking OpenCV. You can install it by using Homebrew: brew install pkgconfig How to build/run code Once you have installed OpenCV, you should be able to build or run any of the command examples: go run ./ cmd /version/main.go The version program should output the following: gocv version : 0 .18 .0 opencv lib version : 4 .0 .0 Cache builds If you are running a ve...
Comments
Post a Comment