OpenCvSharp4.WpfExtensions
4.13.0.20260627
Prefix Reserved
dotnet add package OpenCvSharp4.WpfExtensions --version 4.13.0.20260627
NuGet\Install-Package OpenCvSharp4.WpfExtensions -Version 4.13.0.20260627
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.13.0.20260627" />
<PackageVersion Include="OpenCvSharp4.WpfExtensions" Version="4.13.0.20260627" />
<PackageReference Include="OpenCvSharp4.WpfExtensions" />
paket add OpenCvSharp4.WpfExtensions --version 4.13.0.20260627
#r "nuget: OpenCvSharp4.WpfExtensions, 4.13.0.20260627"
#:package OpenCvSharp4.WpfExtensions@4.13.0.20260627
#addin nuget:?package=OpenCvSharp4.WpfExtensions&version=4.13.0.20260627
#tool nuget:?package=OpenCvSharp4.WpfExtensions&version=4.13.0.20260627
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
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 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.
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 (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.20260627)
- System.Drawing.Common (>= 10.0.9)
-
net8.0-windows7.0
- OpenCvSharp4 (>= 4.13.0.20260627)
- System.Drawing.Common (>= 10.0.9)
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快速开发库 |
|
|
OpenCvSharp4.Windows.Slim
OpenCV 4.x wrapper slim package for Windows users. Enabled modules: core,imgproc,imgcodecs,calib3d,features2d,flann,objdetect,photo. Disabled modules: contrib,dnn,ml,video,videoio,highgui,stitching,barcode. |
|
|
HakuBaseCV
基于HakuBase的视觉检测框架 |
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
|
|
|
guojin-yan/OpenVINO-CSharp-API
OpenVINO wrapper for .NET.
|
|
|
TheCheatsrichter/Gw2_Launchbuddy
Custom launcher generator for the video game Guild Wars 2.
|
|
|
fusrodahs/OpenCVVision
使用OpenCvSharp创建常用功能集合
|
|
|
DigitalPlatform/dp2
Integrated Library System / 图书馆集成系统
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.13.0.20260627 | 168 | 6/27/2026 |
| 4.13.0.20260602 | 6,594 | 6/2/2026 |
| 4.13.0.20260531 | 925 | 5/31/2026 |
| 4.13.0.20260528 | 665 | 5/29/2026 |
| 4.13.0.20260526 | 344 | 5/26/2026 |
| 4.13.0.20260427 | 2,787 | 4/29/2026 |
| 4.13.0.20260330 | 3,189 | 3/30/2026 |
| 4.13.0.20260318 | 1,957 | 3/18/2026 |
| 4.13.0.20260317 | 346 | 3/17/2026 |
| 4.13.0.20260308 | 1,835 | 3/8/2026 |
| 4.13.0.20260302 | 20,365 | 3/2/2026 |
| 4.13.0.20260228 | 681 | 2/28/2026 |
| 4.13.0.20260226 | 846 | 2/26/2026 |
| 4.13.0.20260225 | 726 | 2/25/2026 |
| 4.13.0.20260222 | 1,541 | 2/22/2026 |
| 4.13.0.20260214 | 3,258 | 2/14/2026 |
| 4.13.0.20260213 | 427 | 2/13/2026 |
| 4.13.0.20260211 | 1,495 | 2/11/2026 |
| 4.11.0.20250507 | 65,750 | 5/7/2025 |
| 4.11.0.20250506 | 1,192 | 5/6/2025 |