OpenCvSharp4.WpfExtensions
4.13.0.20260318
dotnet add package OpenCvSharp4.WpfExtensions --version 4.13.0.20260318
NuGet\Install-Package OpenCvSharp4.WpfExtensions -Version 4.13.0.20260318
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.13.0.20260318" />
<PackageVersion Include="OpenCvSharp4.WpfExtensions" Version="4.13.0.20260318" />
<PackageReference Include="OpenCvSharp4.WpfExtensions" />
paket add OpenCvSharp4.WpfExtensions --version 4.13.0.20260318
#r "nuget: OpenCvSharp4.WpfExtensions, 4.13.0.20260318"
#:package OpenCvSharp4.WpfExtensions@4.13.0.20260318
#addin nuget:?package=OpenCvSharp4.WpfExtensions&version=4.13.0.20260318
#tool nuget:?package=OpenCvSharp4.WpfExtensions&version=4.13.0.20260318
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)
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.
- 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 (
OpenCvSharp4.official.runtime.linux-x64.slim):highguiis disabled; no GTK3 or other GUI dependencies. Suitable for headless and container environments.
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, 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();
}
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
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- OpenCvSharp4 (>= 4.13.0.20260318)
- System.Drawing.Common (>= 10.0.3)
-
net8.0-windows7.0
- OpenCvSharp4 (>= 4.13.0.20260318)
- System.Drawing.Common (>= 10.0.3)
NuGet packages (12)
Showing the top 5 NuGet packages that depend on OpenCvSharp4.WpfExtensions:
| Package | Downloads |
|---|---|
|
OpenCvSharp4.Windows
OpenCV 4.x wrapper. All-in-one package for Windows users. |
|
|
OpenCvSharpExtension
Package Description |
|
|
Galosys.Foundation.OpenCvSharp
Galosys.Foundation快速开发库 |
|
|
HakuBaseCV
基于HakuBase的视觉检测框架 |
|
|
H.Controls.Diagram.Presenters.OpenCV
WPF轻量控件和皮肤库 |
GitHub repositories (7)
Showing the top 7 popular GitHub repositories that depend on OpenCvSharp4.WpfExtensions:
| Repository | Stars |
|---|---|
|
babalae/better-genshin-impact
📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 - UI Automation Testing Tools For Genshin Impact
|
|
|
Keboo/MaterialDesignInXaml.Examples
A collection of small samples using MaterialDesignInXaml.
|
|
|
shimat/opencvsharp_samples
|
|
|
TheCheatsrichter/Gw2_Launchbuddy
Custom launcher generator for the video game Guild Wars 2.
|
|
|
EasyConNS/EasyCon
a ns gamepad controller
|
|
|
lolo77777/OpenCVVision
使用OpenCvSharp创建常用功能集合
|
|
|
DigitalPlatform/dp2
Integrated Library System / 图书馆集成系统
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.13.0.20260318 | 314 | 3/18/2026 |
| 4.13.0.20260317 | 187 | 3/17/2026 |
| 4.13.0.20260308 | 1,115 | 3/8/2026 |
| 4.13.0.20260302 | 4,443 | 3/2/2026 |
| 4.13.0.20260228 | 428 | 2/28/2026 |
| 4.13.0.20260226 | 589 | 2/26/2026 |
| 4.13.0.20260225 | 508 | 2/25/2026 |
| 4.13.0.20260222 | 1,016 | 2/22/2026 |
| 4.13.0.20260214 | 1,786 | 2/14/2026 |
| 4.13.0.20260213 | 295 | 2/13/2026 |
| 4.13.0.20260211 | 380 | 2/11/2026 |
| 4.11.0.20250507 | 52,880 | 5/7/2025 |
| 4.11.0.20250506 | 1,012 | 5/6/2025 |
| 4.10.0.20241108 | 52,550 | 11/8/2024 |
| 4.10.0.20241107 | 1,001 | 11/7/2024 |
| 4.10.0.20240616 | 53,392 | 6/16/2024 |
| 4.10.0.20240615 | 3,139 | 6/15/2024 |
| 4.9.0.20240103 | 50,959 | 1/3/2024 |
| 4.8.0.20230708 | 66,186 | 7/10/2023 |
| 4.7.0.20230115 | 185,549 | 1/15/2023 |