OpenCvSharp4.Extensions 4.13.0.20260308
OpenCvSharp
A cross-platform .NET wrapper for OpenCV, providing image processing and computer vision functionality.
Supported Platforms
| 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)
Quick Start
Windows
dotnet add package OpenCvSharp4.Windows
Linux / Ubuntu
dotnet add package OpenCvSharp4
dotnet add package OpenCvSharp4.official.runtime.linux-x64
For more installation options, see Installation on GitHub.
Requirements
Windows
- Visual C++ 2022 Redistributable
- (Windows Server only) Media Foundation:
Install-WindowsFeature Server-Media-Foundation
Linux (Ubuntu and other distributions)
Pre-install the dependency packages needed for OpenCV. Many packages such as libjpeg must be present for OpenCV to work.
See: OpenCV Linux install guide
Slim Profile
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 |
| Disabled | contrib, dnn, ml, video, videoio, highgui, stitching, barcode |
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();
}
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.
Resources
No packages depend on OpenCvSharp4.Extensions.
.NET 8.0
- OpenCvSharp4 (>= 4.13.0.20260308)
- System.Drawing.Common (>= 10.0.3)
.NET Standard 2.0
- OpenCvSharp4 (>= 4.13.0.20260308)
- System.Drawing.Common (>= 10.0.3)
.NET Standard 2.1
- OpenCvSharp4 (>= 4.13.0.20260308)
- System.Drawing.Common (>= 10.0.3)
| Version | Downloads | Last updated |
|---|---|---|
| 4.13.0.20260318 | 2 | 03/24/2026 |
| 4.13.0.20260317 | 2 | 03/27/2026 |
| 4.13.0.20260308 | 1 | 03/10/2026 |
| 4.13.0.20260302 | 1 | 03/03/2026 |
| 4.13.0.20260228 | 2 | 03/05/2026 |
| 4.13.0.20260226 | 2 | 03/04/2026 |
| 4.13.0.20260225 | 2 | 03/05/2026 |
| 4.13.0.20260222 | 3 | 02/26/2026 |
| 4.13.0.20260214 | 1 | 02/18/2026 |
| 4.13.0.20260213 | 2 | 02/19/2026 |
| 4.13.0.20260211 | 1 | 02/20/2026 |
| 4.11.0.20250507 | 4 | 12/17/2025 |
| 4.11.0.20250506 | 4 | 12/17/2025 |
| 4.10.0.20241108 | 3 | 12/09/2025 |
| 4.10.0.20241107 | 3 | 12/11/2025 |
| 4.10.0.20240616 | 3 | 12/17/2025 |
| 4.10.0.20240615 | 3 | 12/17/2025 |
| 4.9.0.20240103 | 3 | 12/25/2025 |
| 4.8.0.20230708 | 3 | 12/29/2025 |
| 4.7.0.20230115 | 2 | 12/25/2025 |
| 4.6.0.20220608 | 6 | 12/11/2025 |
| 4.5.5.20211231 | 3 | 12/09/2025 |
| 4.5.3.20211228 | 4 | 12/11/2025 |
| 4.5.3.20211225 | 3 | 12/29/2025 |