OpenCvSharp5.Windows.Slim
5.0.0.20260702
Prefix Reserved
dotnet add package OpenCvSharp5.Windows.Slim --version 5.0.0.20260702
NuGet\Install-Package OpenCvSharp5.Windows.Slim -Version 5.0.0.20260702
<PackageReference Include="OpenCvSharp5.Windows.Slim" Version="5.0.0.20260702" />
<PackageVersion Include="OpenCvSharp5.Windows.Slim" Version="5.0.0.20260702" />
<PackageReference Include="OpenCvSharp5.Windows.Slim" />
paket add OpenCvSharp5.Windows.Slim --version 5.0.0.20260702
#r "nuget: OpenCvSharp5.Windows.Slim, 5.0.0.20260702"
#:package OpenCvSharp5.Windows.Slim@5.0.0.20260702
#addin nuget:?package=OpenCvSharp5.Windows.Slim&version=5.0.0.20260702
#tool nuget:?package=OpenCvSharp5.Windows.Slim&version=5.0.0.20260702
OpenCvSharp
A cross-platform .NET wrapper for OpenCV, providing image processing and computer vision functionality.
This is the OpenCvSharp5 family (OpenCV 5.x, .NET 8+). If you need .NET Framework, Unity, or another pre-.NET 8 runtime, use the OpenCvSharp4 family (OpenCV 4.13.0) instead.
Supported Platforms
| Platform | Target Framework |
|---|---|
| .NET 8.0 or later | net8.0 |
| Windows desktop (.NET 8+) | net8.0-windows (WpfExtensions) |
Target OpenCV version: 5.0.x (with opencv_contrib)
Quick Start
Windows
dotnet add package OpenCvSharp5.Windows
Linux / Ubuntu
dotnet add package OpenCvSharp5
dotnet add package OpenCvSharp5.official.runtime.linux-x64
macOS
dotnet add package OpenCvSharp4
# Intel (x64):
dotnet add package OpenCvSharp4.runtime.osx.x64
# Apple Silicon (arm64):
dotnet add package OpenCvSharp4.runtime.osx.arm64
For more installation options, see Installation on GitHub.
Requirements
Windows
- (Windows Server only) Media Foundation:
Install-WindowsFeature Server-Media-Foundation
Linux (Ubuntu and other distributions)
The official OpenCvSharp5.official.runtime.linux-x64 package is built on manylinux_2_28 (glibc 2.28) and works on Ubuntu 20.04+, Debian 10+, RHEL/AlmaLinux 8+, and other Linux distributions.
- Full package: uses GTK3 for
highguisupport (Cv2.ImShow,Cv2.WaitKey, etc.). GTK3 (libgtk-3.so.0) is pre-installed on standard Ubuntu/Debian/RHEL environments and typically requires no action. In minimal or container environments where GTK3 is absent, install it manually: Ubuntu/Debian:apt-get install libgtk-3-0; RHEL/AlmaLinux:dnf install gtk3. Alternatively, use the slim package which has no GUI dependencies. - Slim package (
OpenCvSharp5.official.runtime.linux-x64.slim):highguiis disabled; no GTK3 or other GUI dependencies. Suitable for headless and container environments.
macOS (Intel and Apple Silicon)
The OpenCvSharp4.runtime.osx.x64 and OpenCvSharp4.runtime.osx.arm64 packages provide native bindings for macOS. FFmpeg, Tesseract, Freetype, and all standard OpenCV modules are statically linked.
Slim Profile
The slim runtime packages (OpenCvSharp5.Windows.Slim, OpenCvSharp5.official.runtime.linux-x64.slim, etc.) bundle a smaller native library:
| Modules | |
|---|---|
| Enabled | core, imgproc, imgcodecs, calib3d, features2d, flann, objdetect, photo, ml, video, stitching, barcode |
| Disabled | contrib, dnn, videoio, highgui |
Usage
Always release Mat and other IDisposable resources using the using statement:
using OpenCvSharp;
// Edge detection using Canny algorithm
using var src = new Mat("lenna.png", ImreadModes.Grayscale);
using var dst = new Mat();
Cv2.Canny(src, dst, 50, 200);
using (new Window("src image", src))
using (new Window("dst image", dst))
{
Cv2.WaitKey();
}
Mat arithmetic operators (+, -, *, /, comparisons, bitwise, T(), Inv(), ...) return a
lazily-evaluated managed expression tree that holds no unmanaged resources, so chained expressions
never leak. Just receive the result in a using Mat:
using var src = new Mat("lenna.png", ImreadModes.Grayscale);
// The intermediate (src * 0.8) holds no native resource; nothing leaks.
using Mat dst = 255 - src * 0.8;
Note: OpenCvSharp does not support Unity, Xamarin, CUDA or UWP.
Resources
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- OpenCvSharp5 (>= 5.0.0.20260702)
- OpenCvSharp5.GdipExtensions (>= 5.0.0.20260702)
- OpenCvSharp5.runtime.win.slim (>= 5.0.0.20260702)
-
net8.0-windows7.0
- OpenCvSharp5 (>= 5.0.0.20260702)
- OpenCvSharp5.GdipExtensions (>= 5.0.0.20260702)
- OpenCvSharp5.runtime.win.slim (>= 5.0.0.20260702)
- OpenCvSharp5.WpfExtensions (>= 5.0.0.20260702)
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 |
|---|---|---|
| 5.0.0.20260702 | 35 | 7/2/2026 |
| 5.0.0.20260702-beta | 32 | 7/2/2026 |