![]() |
VOOZH | about |
dotnet add package OpenCvSharp4.Windows.Slim --version 4.13.0.20260602
NuGet\Install-Package OpenCvSharp4.Windows.Slim -Version 4.13.0.20260602
<PackageReference Include="OpenCvSharp4.Windows.Slim" Version="4.13.0.20260602" />
<PackageVersion Include="OpenCvSharp4.Windows.Slim" Version="4.13.0.20260602" />Directory.Packages.props
<PackageReference Include="OpenCvSharp4.Windows.Slim" />Project file
paket add OpenCvSharp4.Windows.Slim --version 4.13.0.20260602
#r "nuget: OpenCvSharp4.Windows.Slim, 4.13.0.20260602"
#:package OpenCvSharp4.Windows.Slim@4.13.0.20260602
#addin nuget:?package=OpenCvSharp4.Windows.Slim&version=4.13.0.20260602Install as a Cake Addin
#tool nuget:?package=OpenCvSharp4.Windows.Slim&version=4.13.0.20260602Install as a Cake Tool
A cross-platform .NET wrapper for OpenCV, providing image processing and computer vision functionality.
| Platform | Target Framework |
|---|---|
| .NET 8.0 or later | net8.0 |
| .NET Standard 2.1 | netstandard2.1 |
| .NET Standard 2.0 | netstandard2.0 |
| .NET Framework 4.6.1+ | via netstandard2.0 |
| .NET Framework 4.8 | direct target (WpfExtensions only) |
Target OpenCV version: 4.13.0 (with opencv_contrib)
dotnet add package OpenCvSharp4.Windows
dotnet add package OpenCvSharp4
dotnet add package OpenCvSharp4.official.runtime.linux-x64
For more installation options, see Installation on GitHub.
Install-WindowsFeature Server-Media-Foundation
The official OpenCvSharp4.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.
highgui support (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.OpenCvSharp4.official.runtime.linux-x64.slim): highgui is disabled; no GTK3 or other GUI dependencies. Suitable for headless and container environments.The slim runtime packages (OpenCvSharp4.Windows.Slim, OpenCvSharp4.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 |
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();
}
For complex pipelines, use ResourcesTracker to manage multiple resources automatically:
using var t = new ResourcesTracker();
var src = t.T(new Mat("lenna.png", ImreadModes.Grayscale));
var dst = t.NewMat();
Cv2.Canny(src, dst, 50, 200);
var blurred = t.T(dst.Blur(new Size(3, 3)));
t.T(new Window("src image", src));
t.T(new Window("dst image", blurred));
Cv2.WaitKey();
Note: OpenCvSharp does not support Unity, Xamarin, CUDA or UWP.
Learn more about Target Frameworks and .NET Standard.
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.13.0.20260602 | 124 | 6/2/2026 |
| 4.13.0.20260531 | 162 | 5/31/2026 |
| 4.13.0.20260528 | 131 | 5/29/2026 |
| 4.13.0.20260526 | 124 | 5/26/2026 |
| 4.13.0.20260427 | 248 | 4/29/2026 |
| 4.13.0.20260330 | 230 | 3/30/2026 |
| 4.13.0.20260318 | 206 | 3/18/2026 |
| 4.13.0.20260317 | 204 | 3/17/2026 |
| 4.13.0.20260308 | 231 | 3/8/2026 |
| 4.13.0.20260302 | 247 | 3/2/2026 |
| 4.13.0.20260228 | 225 | 2/28/2026 |
| 4.13.0.20260226 | 233 | 2/26/2026 |
| 4.13.0.20260225 | 237 | 2/25/2026 |
| 4.13.0.20260222 | 248 | 2/22/2026 |