shimat/opencvsharp

OpenCV wrapper for .NET

What it solves

OpenCvSharp provides a way for .NET developers to use the powerful OpenCV library for image processing and computer vision without needing to write C++ code. It bridges the gap between the native C++ API of OpenCV and the C# ecosystem, allowing developers to implement vision tasks in a managed environment.

How it works

It acts as a cross-platform .NET wrapper around the native OpenCV C++ API. The library is designed to stay close to the original C++ API to ensure that documentation and existing OpenCV concepts can be easily transferred to .NET. It handles the management of unsafe native resources through C# conventions like IDisposable and provides specialized extensions for GDI+, WPF, and Avalonia.

Who it’s for

.NET developers who need to integrate computer vision and image processing capabilities into their applications across Windows, Linux, macOS, and WebAssembly.

Highlights

  • API Fidelity: Modeled closely on the native OpenCV C++ API for easy transition from C++ code.
  • Cross-Platform: Supports Windows (x64/ARM64), Linux (x64/ARM64), macOS (Intel/Apple Silicon), and WebAssembly.
  • Resource Management: Uses IDisposable for automatic management of native resources and provides leak-free chained Mat arithmetic.
  • Flexible Deployment: Offers multiple runtime profiles (Full, Headless, and Slim) to reduce dependency footprints in containerized or minimal environments.

Related

  • Project
  • Project
  • Project
  • Project
  • Project