GoCV wraps OpenCV 4 for Go programs, covering capture, image processing, DNN, CUDA, OpenVINO, and contrib modules. It targets Linux, macOS, Windows, and Docker, with Android support in progress.
Overview
GoCV provides Go programmers access to the OpenCV computer vision library through bindings that track recent OpenCV releases. The goal stated in its docs is to keep Go as a first-class client alongside the OpenCV ecosystem, with structures mapped closely to OpenCV modules so filters and algorithms are easier to locate.
Typical code opens cameras or video sources, reads frames into Mat objects, runs classifiers or other processing, and shows results in a GUI window. Examples in the project include face detection, MJPEG streaming, object counting, and DNN-based tracking utilities runnable from the command line.
Installation requires a matching OpenCV build on the host; the project documents setup paths for Linux, macOS, Windows, and Docker. Optional CUDA acceleration uses Nvidia GPUs, and Intel OpenVINO is supported through separate guidance.
Because image memory is allocated in C code, Mat values must be closed explicitly to avoid leaks. GoCV offers an optional Mat profiler build tag to record allocation stack traces and debug long-running or server uses through standard profiling hooks.
Key features
- OpenCV 4 bindings with modular wrappers
- Video capture and GUI display helpers
- Cascade and DNN-based detection examples
- CUDA GPU acceleration support
- Intel OpenVINO toolkit integration
- Command-line example utilities
- Optional Mat allocation profiler
- Docker and desktop install guides
Use cases
- Live webcam processing in Go
- Face detection and object tracking
- MJPEG streaming from capture devices
- GPU-accelerated vision pipelines
- OpenVINO-backed inference workflows