OpenCV5Sharp.Gpu.Linux 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package OpenCV5Sharp.Gpu.Linux --version 1.0.8
                    
NuGet\Install-Package OpenCV5Sharp.Gpu.Linux -Version 1.0.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenCV5Sharp.Gpu.Linux" Version="1.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenCV5Sharp.Gpu.Linux" Version="1.0.8" />
                    
Directory.Packages.props
<PackageReference Include="OpenCV5Sharp.Gpu.Linux" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenCV5Sharp.Gpu.Linux --version 1.0.8
                    
#r "nuget: OpenCV5Sharp.Gpu.Linux, 1.0.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenCV5Sharp.Gpu.Linux@1.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenCV5Sharp.Gpu.Linux&version=1.0.8
                    
Install as a Cake Addin
#tool nuget:?package=OpenCV5Sharp.Gpu.Linux&version=1.0.8
                    
Install as a Cake Tool

OpenCV5Sharp Banner

OpenCV5Sharp

by Qourex โ€” Bringing high-performance computer vision to .NET

Build & Test NuGet Downloads Documentation License: Apache-2.0 .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 IDisposable wrappers 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
1.0.10 45 7/2/2026
1.0.9 43 7/2/2026
1.0.8 44 7/1/2026
1.0.7 48 7/1/2026
1.0.6 44 7/1/2026
1.0.5 58 7/1/2026

See CHANGELOG.md for release notes.