OpenCV5Sharp.Gpu.Linux
1.0.6
See the version list below for details.
dotnet add package OpenCV5Sharp.Gpu.Linux --version 1.0.6
NuGet\Install-Package OpenCV5Sharp.Gpu.Linux -Version 1.0.6
<PackageReference Include="OpenCV5Sharp.Gpu.Linux" Version="1.0.6" />
<PackageVersion Include="OpenCV5Sharp.Gpu.Linux" Version="1.0.6" />
<PackageReference Include="OpenCV5Sharp.Gpu.Linux" />
paket add OpenCV5Sharp.Gpu.Linux --version 1.0.6
#r "nuget: OpenCV5Sharp.Gpu.Linux, 1.0.6"
#:package OpenCV5Sharp.Gpu.Linux@1.0.6
#addin nuget:?package=OpenCV5Sharp.Gpu.Linux&version=1.0.6
#tool nuget:?package=OpenCV5Sharp.Gpu.Linux&version=1.0.6

OpenCV5Sharp
by Qourex โ Bringing high-performance computer vision to .NET
๐ Read the Documentation for detailed guides, C# samples, and mobile deployment walkthroughs. ๐ GPU Acceleration Guide for CUDA-enabled development.
OpenCV5Sharp is a production-ready C# wrapper for OpenCV 5.x. It provides a clean, automatic .NET API mapping of OpenCV's core computer vision algorithms.
The project features robust IDisposable memory management patterns, allowing developers to write high-performance image processing, feature detection, object tracking, and deep learning pipelines in modern C# without native memory leaks.
โ Why OpenCV5Sharp?
OpenCV5Sharp focuses on delivering a complete, optimized .NET developer experience:
- ๐ Native .NET API Surface โ Elegant, idiomatic C# wrappers covering 2,600+ OpenCV methods.
- โก OpenCV 5 Backend โ High-performance execution powered by compiled OpenCV 5 native libraries.
- ๐ฎ GPU Acceleration โ Native CUDA and cuDNN support for fast pixel manipulation and DNN runs.
- ๐ฑ Cross-Platform Interop โ First-class support for Windows, Linux, macOS, Android, and iOS using runtime identifiers (RIDs).
- ๐ Automated Memory Cleanup โ Built-in
IDisposablewrappers that clean up unmanaged pointers deterministically. - ๐ค Deep Learning (DNN) โ Direct ONNX model support for face detection (YuNet) and image classification.
- ๐ฆ Workload Isolation โ Dynamically strips unused platform binaries to reduce mobile package size.
- โ Automated Verification โ Extensive test suite validating interop methods and library layouts.
๐ฅ Project Health
| Metric | Value |
|---|---|
| Native Backend | OpenCV 5.0.0 |
| License | Apache-2.0 (Wrapper) / LGPL-2.1-or-later (FFmpeg) |
| Target Frameworks | .NET 8.0, .NET 9.0, .NET 10.0 |
| Supported OS | Windows (x64), Linux (x64), macOS (x64, ARM64), Android (ARM64), iOS (ARM64) |
| Languages | C#, C++, CUDA |
๐ฏ Feature Matrix
| Capability | Support |
|---|---|
| Image Processing & Filtering | โ |
| Feature & Corner Detection | โ |
| Object Tracking & Optical Flow | โ |
| ArUco Marker Detection | โ |
| Image Inpainting & Restoration | โ |
| Deep Learning Inference (DNN) | โ |
| CUDA GPU Acceleration | โ |
| IDisposable Memory Management | โ |
๐ Architecture
Below is a high-level overview of the library's interop layer:
graph TD
App[Application] --> SDK[OpenCV5Sharp]
subgraph SDK Modules
SDK --> Core[Core Structures: Mat, Size, Scalar]
SDK --> Proc[Image Processing & Transforms]
SDK --> Dnn[ONNX DNN Pipelines]
SDK --> Cuda[CUDA/cuDNN GPU Accelerators]
SDK --> Interop[P/Invoke C++ Wrapper: opencv5sharp_native]
end
Interop --> OpenCV[OpenCV 5 Engine: opencv_world]
๐ป Quick Start
Here is a copy-pasteable example showing Canny Edge Detection:
using System;
using OpenCV5Sharp;
class Program
{
static void Main()
{
// 1. Load an image from disk
using var src = Cv2.Imread("lena.jpg", (int)ImreadModes.Color);
if (src == null || src.Handle == IntPtr.Zero)
{
Console.WriteLine("Could not load image.");
return;
}
// 2. Prepare workspace matrices
using var gray = new Mat();
using var edges = new Mat();
// 3. Convert to grayscale and run Canny Filter
Cv2.CvtColor(src, gray, (int)ColorConversionCodes.Bgr2gray, 0, AlgorithmHint.Default);
Cv2.Canny(gray, edges, 50, 150, 3, false);
// 4. Save the output
Cv2.Imwrite("edges.png", edges, IntPtr.Zero);
Console.WriteLine("Edge detection complete!");
}
}
๐งช Running the Test Suite
OpenCV5Sharp comes with a comprehensive test suite targeting both .NET 8.0 and .NET 9.0 frameworks with 618 unique test cases (running 1,236 test runs in total). The suite verifies memory layout padding, exception boundaries, API calling conventions, DNN model inference, and GPU calculations.
To run the test suite locally:
dotnet test
Note: CUDA GPU tests (CudaTests.cs) utilize dynamic device queries and will automatically skip on machines without a configured CUDA runtime, keeping the test runner green across both CPU and GPU development machines.
๐ License
The managed wrapper code and native compile scripts are licensed under the Apache License, Version 2.0. Bundled native FFmpeg binaries linked dynamically are licensed under the GNU LGPL v2.1 or later. See the LICENSE and LICENSE_FFMPEG.txt files for complete details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See CHANGELOG.md for release notes.