OpenCvSharp4.WpfExtensions
4.13.0.20260302
dotnet add package OpenCvSharp4.WpfExtensions --version 4.13.0.20260302
NuGet\Install-Package OpenCvSharp4.WpfExtensions -Version 4.13.0.20260302
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.13.0.20260302" />
<PackageVersion Include="OpenCvSharp4.WpfExtensions" Version="4.13.0.20260302" />
<PackageReference Include="OpenCvSharp4.WpfExtensions" />
paket add OpenCvSharp4.WpfExtensions --version 4.13.0.20260302
#r "nuget: OpenCvSharp4.WpfExtensions, 4.13.0.20260302"
#:package OpenCvSharp4.WpfExtensions@4.13.0.20260302
#addin nuget:?package=OpenCvSharp4.WpfExtensions&version=4.13.0.20260302
#tool nuget:?package=OpenCvSharp4.WpfExtensions&version=4.13.0.20260302
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
| 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.20260302)
- System.Drawing.Common (>= 10.0.3)
-
net8.0-windows7.0
- OpenCvSharp4 (>= 4.13.0.20260302)
- 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.20260302 | 816 | 3/2/2026 |
| 4.13.0.20260228 | 320 | 2/28/2026 |
| 4.13.0.20260226 | 503 | 2/26/2026 |
| 4.13.0.20260225 | 424 | 2/25/2026 |
| 4.13.0.20260222 | 924 | 2/22/2026 |
| 4.13.0.20260214 | 1,449 | 2/14/2026 |
| 4.13.0.20260213 | 264 | 2/13/2026 |
| 4.13.0.20260211 | 339 | 2/11/2026 |
| 4.11.0.20250507 | 50,557 | 5/7/2025 |
| 4.11.0.20250506 | 982 | 5/6/2025 |
| 4.10.0.20241108 | 51,652 | 11/8/2024 |
| 4.10.0.20241107 | 977 | 11/7/2024 |
| 4.10.0.20240616 | 52,303 | 6/16/2024 |
| 4.10.0.20240615 | 3,105 | 6/15/2024 |
| 4.9.0.20240103 | 49,991 | 1/3/2024 |
| 4.8.0.20230708 | 65,667 | 7/10/2023 |
| 4.7.0.20230115 | 185,097 | 1/15/2023 |
| 4.6.0.20220608 | 100,748 | 6/8/2022 |
| 4.5.5.20211231 | 59,224 | 12/31/2021 |