{"id":37185750,"url":"https://github.com/elliot727/gocvkit","last_synced_at":"2026-01-14T21:31:48.068Z","repository":{"id":327104098,"uuid":"1107525519","full_name":"Elliot727/gocvkit","owner":"Elliot727","description":"The OpenCV framework Go was waiting for Zero boilerplate • Hot reload • Zero leaks • Actually fun to use","archived":false,"fork":false,"pushed_at":"2025-12-02T15:08:00.000Z","size":31,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-04T08:40:56.221Z","etag":null,"topics":["computer-vision","golang","opencv"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elliot727.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-01T09:03:25.000Z","updated_at":"2025-12-02T15:08:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Elliot727/gocvkit","commit_stats":null,"previous_names":["elliot727/gocvkit"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Elliot727/gocvkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliot727%2Fgocvkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliot727%2Fgocvkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliot727%2Fgocvkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliot727%2Fgocvkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elliot727","download_url":"https://codeload.github.com/Elliot727/gocvkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliot727%2Fgocvkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28435104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","golang","opencv"],"created_at":"2026-01-14T21:31:47.244Z","updated_at":"2026-01-14T21:31:48.057Z","avatar_url":"https://github.com/Elliot727.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoCVKit\n**The OpenCV framework Go was waiting for**\nZero boilerplate • Hot reload • Zero leaks • Actually fun to use\n\n---\n\n## What is GoCVKit?\n\nGoCVKit is a modular GoCV framework for working with live camera or video streams with configurable pipelines and filters. It simplifies computer vision development by providing a clean, idiomatic API that handles all the complexity behind the scenes.\n\n## Quick Start\n\nTo get started with a live camera application:\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/Elliot727/gocvkit\"\n)\n\nfunc main() {\n    app, err := gocvkit.NewApp(\"config.toml\")\n    if err != nil {\n        log.Fatal(\"Failed to create app:\", err)\n    }\n    defer app.Close()\n\n    // Run the application with optional per-frame callback\n    if err := app.Run(nil); err != nil {\n        log.Fatal(\"Application error:\", err)\n    }\n}\n```\n\nThat's it! No boilerplate, no crashes, no resource leaks.\n\n## Installation\n\n```bash\ngo get github.com/elliot727/gocvkit\n```\n\n### Prerequisites\n\nGoCVKit requires OpenCV 4.x:\n- **macOS**: `brew install opencv`\n- **Ubuntu**: `sudo apt install libopencv-dev`\n- **Windows**: [Installation guide for Windows](https://gocv.io/getting-started/windows/)\n\n## Configuration\n\nCreate a `config.toml` file to define your pipeline:\n\n```toml\n[app]\nwindow_name = \"GoCVKit – Live Edge Detection\"\nrecord = true        # Enable video recording (optional)\noutput = \"output.mp4\" # Output video file path (optional, defaults to \"gocvkit_capture.mp4\")\n\n[camera]\ndevice_id = 0\n# file = \"demo.mp4\"  # Use video file instead of webcam\n\n[stream]\nenabled = true        # Enable MJPEG streaming\nport = 8080           # Port for the stream server\npath = \"/stream\"      # Path for the stream endpoint\nquality = 75          # JPEG quality (0-100, higher is better)\n\n[[pipeline.steps]]\nname = \"Grayscale\"\n\n[[pipeline.steps]]\nname = \"GaussianBlur\"\nkernel = 9\nsigma = 1.8\n\n[[pipeline.steps]]\nname = \"Canny\"\nlow = 50\nhigh = 150\n```\n\n## Controls\n\n- **Esc** or **q**: Quit the application\n- **f**: Toggle FPS display overlay on/off\n\n## Key Features\n\n- **One-line startup**: Full application in ≤10 lines of code\n- **Live config hot-reload**: Edit `config.toml` → instant pipeline update\n- **Zero per-frame allocations**: Efficient double-buffer pipeline\n- **Frame callbacks**: Overlay, logging, and recording support\n- **Video recording**: Record processed video with automatic file rotation\n- **MJPEG Streaming**: Stream processed video over HTTP to multiple clients\n- **FPS overlay**: Real-time performance monitoring with toggleable FPS display\n- **Graceful shutdown**: Ctrl+C and Esc/q handling with zero resource leaks\n- **Extensible plugin system**: Register custom processors from anywhere\n- **Zero-boilerplate AutoConfig**: Dynamic parameters with reflection\n- **Robust error handling**: Clear error messages for typos and unknown processors\n- **Webcam \u0026 video file support**: Seamless input switching\n\n## Built-in Processors\n\n| Name           | Config Keys             | Description                          |\n|----------------|-------------------------|--------------------------------------|\n| `Grayscale`    | –                       | Convert BGR → grayscale              |\n| `Erode`        | `kernel`, `iterations`  | Morphological erosion                |\n| `Dilate`       | `kernel`, `iterations`  | Morphological dilation               |\n| `MorphClose`   | `kernel`, `iterations`  | Morphological close operation        |\n| `Otsu`         | `max_value`, `invert`   | Otsu thresholding                    |\n| `GaussianBlur` | `kernel`, `sigma`       | Noise reduction with Gaussian kernel |\n| `MedianBlur`   | `k`                     | Remove salt-and-pepper noise         |\n| `Bilateral`    | `diameter`, `sigma_color`, `sigma_space` | Edge-preserving smoothing |\n| `Canny`        | `low`, `high`           | Edge detection                       |\n| `Sobel`        | `sobel_size`            | Gradient-based edge detection        |\n| `Laplacian`    | `k`                     | Second derivative edge detection     |\n| `Scharr`       | –                       | Accurate edge detection for gradients|\n\n## Advanced Usage\n\n### Frame Callbacks\n\nAdd real-time overlays, logging, or recording:\n\n```go\napp.Run(func(frame *gocv.Mat) {\n    // Process the final frame\n    // Useful for overlays, saving, logging, etc.\n})\n```\n\n### Using Built-in Processors Directly\n\nYou can also use built-in processors directly in your Go code by creating instances with specific parameters:\n\n```go\n// You can create and configure processors directly\nc := gocvkit.Canny{Low: 50, High: 150}\ngb := gocvkit.GaussianBlur{Kernel: 9, Sigma: 1.8}\n```\n\nThis is useful when you want to create specific instances with custom parameters programmatically.\n\n### Adding Custom Filters\n\nCreate your own processors with zero boilerplate:\n\n```go\n// custom_filter.go\npackage main\n\nimport (\n    \"gocv.io/x/gocv\"\n    \"github.com/Elliot727/gocvkit\"\n)\n\n// RedTint adds a red tint to the image\ntype RedTint struct {\n    Intensity float64 `toml:\"intensity\"` // 0.0 – 1.0\n    Enabled   bool    `toml:\"enabled\"`\n}\n\nfunc (r *RedTint) Process(src gocv.Mat, dst *gocv.Mat) {\n    if !r.Enabled {\n        src.CopyTo(dst)\n        return\n    }\n    src.CopyTo(dst)\n    // Apply red tint logic here\n    // Implementation details...\n}\n\nfunc init() {\n    gocvkit.RegisterProcessor(\"RedTint\", \u0026RedTint{\n        Intensity: 0.5,\n        Enabled:   true,\n    })\n}\n```\n\nThen add to your config.toml:\n\n```toml\n[[pipeline.steps]]\nname = \"RedTint\"\nintensity = 0.85\nenabled = true\n```\n\n## Architecture\n\nGoCVKit follows a clean, modular architecture:\n\n- **app**: Main orchestrator handling camera, display, pipeline, and config\n- **builder**: Creates processing pipelines from configuration\n- **camera**: Unified wrapper for webcam and video file input\n- **config**: TOML configuration loading with custom unmarshaling\n- **display**: Window display wrapper\n- **pipeline**: Efficient double-buffered processing pipeline\n- **processor**: Extensible filter system with auto-configuration\n  - **registry**: Central registry for all processor types\n  - **auto_config**: Automatic configuration for user-defined filters\n  - **core**: Basic image processing filters (Grayscale, Erode, Dilate, etc.)\n  - **blurs**: Blurring and smoothing filters (GaussianBlur, MedianBlur, etc.)\n  - **edges**: Edge detection filters (Canny, Sobel, etc.)\n\n## Use Cases\n\nPerfect for:\n\n- **Rapid prototyping** of computer vision applications\n- **Teaching computer vision** concepts\n- **Live demonstrations** and presentations\n- **Real-time vision applications**\n- **Anyone who values their sanity**\n\n## License\n\nMIT © 2025 elliot727\n\n---\n\n**Star if you like it**\n**Contribute if you love it**\n**Tell everyone** — Go deserves this.\n\nMade with passion by [@elliot727](https://github.com/elliot727)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliot727%2Fgocvkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliot727%2Fgocvkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliot727%2Fgocvkit/lists"}