hybridgroup/gocv
Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO.
Mixed signals — read the receipts
weakest axisnon-standard license (Other); no tests detected
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 2w ago
- ✓15 active contributors
- ✓Other licensed
Show all 7 evidence items →Show less
- ✓CI configured
- ⚠Concentrated ownership — top contributor handles 69% of recent commits
- ⚠Non-standard license (Other) — review terms
- ⚠No test directory detected
What would change the summary?
- →Use as dependency Concerns → Mixed if: clarify license terms
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/hybridgroup/gocv)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/hybridgroup/gocv on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: hybridgroup/gocv
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/hybridgroup/gocv shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Mixed signals — read the receipts
- Last commit 2w ago
- 15 active contributors
- Other licensed
- CI configured
- ⚠ Concentrated ownership — top contributor handles 69% of recent commits
- ⚠ Non-standard license (Other) — review terms
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live hybridgroup/gocv
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/hybridgroup/gocv.
What it runs against: a local clone of hybridgroup/gocv — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in hybridgroup/gocv | Confirms the artifact applies here, not a fork |
| 2 | License is still Other | Catches relicense before you depend on it |
| 3 | Default branch release exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 43 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of hybridgroup/gocv. If you don't
# have one yet, run these first:
#
# git clone https://github.com/hybridgroup/gocv.git
# cd gocv
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of hybridgroup/gocv and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "hybridgroup/gocv(\\.git)?\\b" \\
&& ok "origin remote is hybridgroup/gocv" \\
|| miss "origin remote is not hybridgroup/gocv (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Other)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Other\"" package.json 2>/dev/null) \\
&& ok "license is Other" \\
|| miss "license drift — was Other at generation time"
# 3. Default branch
git rev-parse --verify release >/dev/null 2>&1 \\
&& ok "default branch release exists" \\
|| miss "default branch release no longer exists"
# 4. Critical files exist
test -f "cgo.go" \\
&& ok "cgo.go" \\
|| miss "missing critical file: cgo.go"
test -f "README.md" \\
&& ok "README.md" \\
|| miss "missing critical file: README.md"
test -f "Makefile" \\
&& ok "Makefile" \\
|| miss "missing critical file: Makefile"
test -f "calib3d.go" \\
&& ok "calib3d.go" \\
|| miss "missing critical file: calib3d.go"
test -f ".github/workflows/linux.yml" \\
&& ok ".github/workflows/linux.yml" \\
|| miss "missing critical file: .github/workflows/linux.yml"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 43 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~13d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/hybridgroup/gocv"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
GoCV is a Go language binding for OpenCV 4+ that brings production-grade computer vision capabilities to Go applications. It wraps OpenCV's C++ API through cgo, enabling image processing, video capture, face detection, DNN inference, and hardware-accelerated GPU compute (CUDA, OpenVINO) directly from Go code without calling external Python or C++ processes. Monolithic package structure: core bindings in root-level files (aruco.go/aruco.cpp, asyncarray.go/asyncarray.cpp, calib3d.go/calib3d.cpp etc.) with parallel Go/C++ pairs; specialized modules in subdirectories (cuda/, openvino/); 30+ Dockerfiles for various build configurations (static, CUDA 10-13, Alpine, FFmpeg, GStreamer); CI workflows in .github/workflows/ drive multi-platform testing.
👥Who it's for
Go backend engineers and systems programmers building real-time vision applications (surveillance, robotics, autonomous systems, video processing services) who need OpenCV's mature algorithms but want Go's deployment simplicity, concurrency, and static compilation. Contributors maintain bindings across Linux, macOS, Windows, and Docker.
🌱Maturity & risk
Production-ready and actively maintained. The project has extensive CI/CD across 4 platforms (linux.yml, macos.yml, windows.yml, docker.yml workflows), comprehensive module coverage (aruco, asyncarray, calib3d visible in file list), and tracks OpenCV 4.12.0 compatibility. Last activity visible in workflow files indicates ongoing maintenance, though exact commit recency is not shown in data.
Moderate risk: cgo bindings tightly couple Go releases to OpenCV C++ ABI stability—breaking OpenCV updates could require version bumps. Single GitHub organization (hybridgroup) maintains this, creating org-level dependency risk. Numerous CUDA/GPU Dockerfiles (13 variants) suggest high maintenance surface area. Dependency on system-level OpenCV installation (not vendored) complicates deployment.
Active areas of work
Unable to determine exact current work from file listing alone, but the breadth of Docker configurations (static-ffmpeg, static-gstreamer, GPU CUDA 10-13, OpenVINO variants) and multiple CI workflows suggest active development around hardware acceleration, container portability, and OpenCV version tracking. The CHANGELOG.md and ROADMAP.md would reveal specifics.
🚀Get running
git clone https://github.com/hybridgroup/gocv.git && cd gocv && go get ./... && make build (consult Makefile for exact build flags; pre-installed OpenCV 4+ and cgo-compatible C++ compiler required)
Daily commands: make build (from Makefile); or go build ./cmd/... for specific tools; Docker: docker build -f Dockerfile.opencv . for containerized OpenCV build; platform-specific setup in CONTRIBUTING.md required (brew install opencv on macOS, apt-get on Linux, vcpkg on Windows)
🗺️Map of the codebase
cgo.go— Core CGO bindings that bridges Go and OpenCV C++ library — all image processing calls depend on thisREADME.md— Installation and build instructions for OpenCV dependencies; required reading before contributing platform-specific codeMakefile— Build orchestration for OpenCV compilation and Go package linking across Linux, macOS, and Windowscalib3d.go— Primary module for calibration and 3D vision; largest single feature domain in the codebase.github/workflows/linux.yml— CI/CD pipeline definition; defines test matrix and binary compatibility standardscmd/hello/main.go— Canonical minimal example showing idiomatic GoCV usage patternsgo.mod— Module definition with Go 1.21 requirement and minimal indirect dependencies
🛠️How to make changes
Add a new OpenCV module wrapper
- Create Go file following naming convention:
modulename.go(e.g.,imgproc.go) (imgproc.go) - Create corresponding C++ bridge:
modulename.cppandmodulename.hwith C wrapper functions (imgproc.cpp) - Add CGO preamble in the .go file with
// #include <opencv2/imgproc.hpp>and link flags tocgo.go(cgo.go) - Implement idiomatic Go receiver methods using pointer receivers; mirror OpenCV's class methods as functions (
imgproc.go) - Create
modulename_test.gowith benchmark and unit tests (imgproc_test.go) - Add a minimal example in
cmd/myfeature/main.godemonstrating the new API (cmd/myfeature/main.go)
Add a new command-line example
- Create directory under
cmd/matching your feature name (cmd/newfeature/main.go) - Implement
main()function following patterns incmd/hello/main.goandcmd/facedetect/main.go(cmd/newfeature/main.go) - Reference existing GoCV module functions (e.g.,
gocv.IMRead,gocv.NewCapture) — no new bindings needed (cmd/newfeature/main.go) - Add README documenting prerequisites (model files, camera setup) in
cmd/newfeature/directory (cmd/newfeature/README.md)
Support a new platform or build variant
- Create new build tag variant or platform-specific cgo file (e.g.,
cgo_static_windows.gofor Windows static builds) (cgo_static_windows.go) - Add platform-specific Dockerfile if cross-compilation is complex (e.g.,
Dockerfile.opencv-ubuntu-24.04) (Dockerfile.opencv-ubuntu-24.04) - Create GitHub Actions workflow file in
.github/workflows/to validate builds (e.g.,.github/workflows/linux.yml) (.github/workflows/newplatform.yml) - Update Makefile with new platform-specific OpenCV build and linking commands (
Makefile) - Document installation steps for new platform in CONTRIBUTING.md (
CONTRIBUTING.md)
🔧Why these technologies
- Go + CGO — Type-safe bindings to C++ OpenCV with minimal GC pressure; Go concurrency model fits multi-frame processing pipelines
- OpenCV 4.x C++ core — Industry-standard, battle-tested computer vision algorithms; CUDA/OpenCL/OpenVINO acceleration paths; DNN module
- CUDA/GPU acceleration — Real-time video processing (30–60 FPS) requires parallelism; async arrays defer GPU work to non-blocking calls
- Docker multi-platform — OpenCV compilation is platform-specific and dependency-heavy; containers isolate build variants (static, CUDA 12, Alpine, etc.)
- GitHub Actions CI — Multi-platform validation (Linux x86_64/ARM, macOS Intel/ARM64, Windows MSVC) ensures binary compatibility across user environments
⚖️Trade-offs already made
-
CGO for all OpenCV calls vs. pure Go ports
- Why: CGO introduces C boundary crossings (~1–5 µs per call) but avoids reinventing 25+ years of OpenCV optimization and research
- Consequence: Tight inner loops (pixel-level operations) may benefit from batching calls; large batch operations (e.g., conv2d) hide CGO cost
-
Async GPU arrays as opt-in feature vs. automatic GPU upload
- Why: Explicit
asyncarray.Upload()gives control over GPU memory transfers and kernel synchronization points - Consequence: Developers must manually manage GPU memory; reduces surprise latency but increases API complexity
- Why: Explicit
-
Static linking variants (Dockerfile-static) vs. dynamic OpenCV libs
- Why: Static builds eliminate OpenCV dependency at runtime (single binary) but increase binary size by 200–500 MB
- Consequence: Useful for containerized/embedded deployments; not suitable for rapid iteration in development
-
Minimal Go dependencies (mjpeg, wasm-go-image-to-ascii only) vs. bundled helpers
- Why: Keeps GoCV lightweight and non-prescriptive about encoding, visualization, or network transports
- Consequence: Users must compose their own media I/O pipeline; cmd/ examples show common patterns
🚫Non-goals (don't propose these)
- Does not wrap all OpenCV APIs — only exposes frequently-used modules (calib3d, aruco, async arrays, contrib); users can extend via CGO
- Does not provide real-time GUI beyond OpenCV's built-in namedWindow (no cross-platform rich UI); examples use headless processing or external display
- Does not handle image encoding/streaming — relies on external libraries (mjpeg, GStreamer, FFmpeg) for video output
- Not a high-level ML framework — no PyTorch/TensorFlow integration; DNN module uses OpenCV's built-in inference
🪤Traps & gotchas
Requires system OpenCV 4+ installation (pkg-config or manual path via CGO_CPPFLAGS); cgo demands C++ compiler in PATH (g++, clang++, MSVC); Windows builds need vcpkg or pre-built OpenCV binaries; GPU (CUDA/OpenVINO) builds require additional toolkit installation; linking can fail silently if OpenCV headers/libs mismatch architecture (32-bit vs 64-bit); Docker builds are heavy (30+ variants) and can obscure native build issues; no go.mod vendoring of OpenCV—all C++ sourced from system or Docker build stage
🏗️Architecture
💡Concepts to learn
- cgo (Go C Foreign Function Interface) — GoCV's entire architecture depends on cgo to call OpenCV C++ functions; understanding cgo memory safety, calling conventions, and error handling is non-negotiable for any contribution
- Mat (Matrix / Image Container) — OpenCV's Mat is the fundamental data structure for images and tensors in GoCV; all image processing chains operate on Mat objects with specific memory layout and channels
- Cascade Classifiers (Haar/LBP) — Referenced in README face detection example; GoCV wraps OpenCV's CascadeClassifier for efficient multi-stage detection pipelines
- DNN Module (Deep Neural Networks) — GoCV supports OpenCV's DNN for inference; enables object detection, segmentation, and pose estimation from trained models (TensorFlow, PyTorch, ONNX)
- CUDA Memory Management (GPU Acceleration) — cuda/ module uses NVIDIA CUDA for GPU-resident Mat objects and kernels; critical for real-time video processing on Nvidia hardware
- ArUco Markers (Augmented Reality Markers) — GoCV includes full ArUco support (aruco.go, aruco_dictionaries.go) for pose estimation and spatial tracking; widely used in robotics and AR applications
- Video Capture & Codec Handling — VideoCapture in GoCV abstracts platform-specific camera/video APIs and codec negotiation; asyncarray.go suggests async frame retrieval patterns critical for real-time pipelines
🔗Related repos
opencv/opencv— The upstream C++ library that GoCV wraps; critical for understanding available algorithms and architecture decisionsopencv/opencv_contrib— Extended modules (ArUco, extra ML) that GoCV optionally binds; source of some advanced features visible in aruco_dictionaries.gogolang/go— Core language; cgo integration and release compatibility directly impact GoCV's build reliability and performance characteristicsintel-iot-devkit/openvino— Intel's inference engine that GoCV optionally integrates for hardware-accelerated DNN inference on Intel devicesNVIDIA/CUDA-Samples— NVIDIA CUDA documentation and examples; context for GoCV's cuda/ module and GPU-accelerated Dockerfile variants
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive CUDA version compatibility test workflow
The repo has 5 separate Dockerfile.opencv-gpu-cuda-* files (versions 10, 11, 11.2.2, 12, 13) and corresponding test Dockerfiles, but no unified CI workflow that tests across all CUDA versions. The linux.yml, macos.yml, and windows.yml workflows don't include CUDA testing. Adding a docker-based CI workflow would catch CUDA-specific regressions early and ensure the multiple CUDA versions remain compatible.
- [ ] Create .github/workflows/cuda-compatibility.yml that builds and tests against Dockerfile.test.gpu-cuda-10, cuda-11, cuda-11.2.2, cuda-12, and cuda-13
- [ ] Add matrix strategy to test against each CUDA version in parallel
- [ ] Run basic gocv tests (e.g., from calib3d_test.go, aruco_test.go) within each CUDA container
- [ ] Document CUDA version compatibility requirements in CONTRIBUTING.md
Add integration tests for OpenVINO support
The repo has Dockerfile.opencv-openvino and explicit OpenVINO support mentioned in the description, but there are no dedicated tests or CI workflow for OpenVINO functionality. Similar to CUDA, this needs validation to ensure OpenVINO integration remains functional across releases.
- [ ] Create a new *_openvino_test.go file (or extend existing DNN tests) with test cases for OpenVINO inference paths
- [ ] Add .github/workflows/openvino.yml that builds from Dockerfile.opencv-openvino and runs the new OpenVINO-specific tests
- [ ] Document OpenVINO-specific build requirements and test procedures in CONTRIBUTING.md
Implement test coverage for static build Dockerfiles
The repo has multiple static build Dockerfiles (Dockerfile-static, Dockerfile-static-alpine, Dockerfile.opencv-static, Dockerfile.opencv-static-alpine, Dockerfile.ffmpeg-static-alpine, Dockerfile.gstreamer-static-alpine) but no CI workflow validates these builds. Static builds are critical for deployment but easy to break; adding a workflow would prevent regressions.
- [ ] Create .github/workflows/docker-static-builds.yml that builds all static Dockerfiles in sequence
- [ ] Add simple smoke tests (e.g., run a basic gocv example binary) inside each built static image to validate functionality
- [ ] Document static build variations and use cases in README.md or a new STATIC_BUILDS.md file
- [ ] Reference the Dockerfile-static-builder to understand the multi-stage build pattern and ensure all variants follow it
🌿Good first issues
- Write integration tests for calib3d.go camera calibration functions (only aruco_test.go and asyncarray_test.go visible in file list; calib3d.cpp exists but test coverage not listed)
- Add OpenVINO examples to examples/ directory (openvino/ module mentioned but no runnable example files shown; pair with macos.yml and linux.yml CI to verify cross-platform)
- Document cgo binding patterns in CONTRIBUTING.md with before/after examples of a minimal new module (aruco.go is the pattern but not formally documented as a template for new contributors)
⭐Top contributors
Click to expand
Top contributors
- @deadprogram — 69 commits
- @diegohce — 11 commits
- @SoulPancake — 4 commits
- @swdee — 2 commits
- @amertahir — 2 commits
📝Recent commits
Click to expand
Recent commits
274ac8a— Release 0.43.0 (deadprogram)509fa27— windows: include all modules in build for CI tests (deadprogram)d42cdcb— build: use windows scripts for CI builds (deadprogram)b3d1c24— windows: split download and build scripts for easier usage/integration (deadprogram)96896bb— Fix bugs and memory leaks in yolov8 example (#1349) (swdee)fa88e5b— cuda: add implmentations for more arith functions (deadprogram)23902e7— imgproc: use same test values as OpenCV tests for TestMinAreaRect and TestMinAreaRect2f (deadprogram)dc01197— core: improve implementation for NewPointVectorFromPoints (deadprogram)1c1cd23— test: update tests for OpenCV 4.13 (deadprogram)6e25929— opencv: update to use OpenCV 4.13 within GoCV (deadprogram)
🔒Security observations
- High · Outdated Go Dependencies with Known Vulnerabilities —
go.mod. The go.mod file specifies github.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e, which is an extremely old version from 2014. This dependency is likely to contain multiple known security vulnerabilities and lacks security patches. Additionally, github.com/subeshb1/wasm-go-image-to-ascii v0.0.0-20200725121413-d828986df340 is from 2020 and may contain unpatched vulnerabilities. Fix: Update all dependencies to the latest stable versions. Run 'go get -u' to update dependencies and 'go mod tidy' to clean up. Regularly audit dependencies using 'go list -json -m all | nancy sleuth' or similar tools like Dependabot. - High · Missing Go Version Management —
go.mod, Dockerfile, .github/workflows/. The go.mod specifies 'go 1.21' but several Dockerfile configurations and CI/CD workflows may be using different Go versions without explicit version pinning across all build environments, creating potential for version inconsistencies and missing security patches. Fix: Pin Go version explicitly in all Dockerfile files using a specific patch version (e.g., golang:1.21.x-alpine). Ensure CI/CD workflows specify explicit Go versions. Use official golang images and keep them updated. - High · Base Docker Image Version Not Pinned —
Dockerfile. The Dockerfile uses 'FROM ghcr.io/hybridgroup/opencv:4.13.0' without specifying a complete image digest or tag. While a version tag is present, using floating tags could result in pulling a different image than intended if the tag is reassigned. Additionally, no health checks or security scanning is configured. Fix: Use complete image digests instead of tags (e.g., FROM ghcr.io/hybridgroup/opencv:4.13.0@sha256:...). Add HEALTHCHECK directives. Implement vulnerability scanning in CI/CD using tools like Trivy or Grype. - Medium · Insecure Dockerfile Build Pattern —
Dockerfile. The Dockerfile copies the entire repository content including potentially sensitive build artifacts, configuration files, and intermediate build products without explicit exclusion. The build context could include unintended files. Fix: Implement a .dockerignore file to exclude sensitive files, build artifacts, test data, and unnecessary files. Use multi-stage builds to minimize final image size and exclude build dependencies. Explicitly specify COPY constraints to only include necessary files. - Medium · Missing GOFLAGS Security Configuration —
Dockerfile, Makefile. The Go build process does not explicitly enable security-related build flags such as '-trimpath' or '-buildmode=pie'. This could leave debug information in binaries and reduce runtime protection mechanisms. Fix: Add security-related build flags: 'go build -ldflags="-s -w" -buildmode=pie -trimpath' to strip debug symbols, enable ASLR compatibility, and remove build path information from binaries. - Medium · No Image Signature Verification —
Dockerfile, GitHub Actions workflows. Docker images are pulled from ghcr.io without content trust/signature verification configured. There is no mechanism to verify image authenticity and integrity. Fix: Enable Docker Content Trust (DCT) by setting 'DOCKER_CONTENT_TRUST=1'. Sign images during build. Use cosign for image signing and verification. Document image verification procedures in CI/CD. - Medium · Insufficient Security Context in Dockerfile —
Dockerfile. The Dockerfile does not specify a non-root user, resource limits, or explicit security options. The container runs as root by default, which is a significant security risk. Fix: Add 'USER' directive to run as non-root user. Implement resource limits (memory, CPU). Use '--security-opt=no-new-privileges:true' in runtime. Consider adding 'HEALTHCHECK' and explicit error handling. - Low · Indirect Dependency Vulnerability Risk —
undefined. The go.mod has indirect dependencies (github.com/aybabtme/rgbterm and github.com/nfnt/resize) that are not actively maintained. These Fix: undefined
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.