OpenCvSharp4.Windows
4.13.0.20260602
Prefix Reserved
See the version list below for details.
dotnet add package OpenCvSharp4.Windows --version 4.13.0.20260602
NuGet\Install-Package OpenCvSharp4.Windows -Version 4.13.0.20260602
<PackageReference Include="OpenCvSharp4.Windows" Version="4.13.0.20260602" />
<PackageVersion Include="OpenCvSharp4.Windows" Version="4.13.0.20260602" />
<PackageReference Include="OpenCvSharp4.Windows" />
paket add OpenCvSharp4.Windows --version 4.13.0.20260602
#r "nuget: OpenCvSharp4.Windows, 4.13.0.20260602"
#:package OpenCvSharp4.Windows@4.13.0.20260602
#addin nuget:?package=OpenCvSharp4.Windows&version=4.13.0.20260602
#tool nuget:?package=OpenCvSharp4.Windows&version=4.13.0.20260602
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
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- OpenCvSharp4 (>= 4.13.0.20260602)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260602)
- OpenCvSharp4.WpfExtensions (>= 4.13.0.20260602)
-
.NETStandard 2.0
- OpenCvSharp4 (>= 4.13.0.20260602)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260602)
-
.NETStandard 2.1
- OpenCvSharp4 (>= 4.13.0.20260602)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260602)
-
net8.0
- OpenCvSharp4 (>= 4.13.0.20260602)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260602)
- OpenCvSharp4.WpfExtensions (>= 4.13.0.20260602)
NuGet packages (51)
Showing the top 5 NuGet packages that depend on OpenCvSharp4.Windows:
| Package | Downloads |
|---|---|
|
RatEye
Image processing library for Escape from Tarkov |
|
|
Starxcjy.DataAccess.CodeReader
图像处理库 |
|
|
MicroPrint.Cam.Engine
MicroPrint图形解析引擎; |
|
|
OpenVinoSharp.win
基于C#平台调用OpenVINO套件部署深度学习模型。 Based on the C # platform, call the OpenVINO suite to deploy a deep learning model. |
|
|
UnionSoft.UiAuto.Automation
Library to use UnionSoft automaion project. |
GitHub repositories (23)
Showing the top 20 popular GitHub repositories that depend on OpenCvSharp4.Windows:
| Repository | Stars |
|---|---|
|
babalae/better-genshin-impact
📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 | 自动烹饪 | 桌面分身 - UI Automation Testing Tools For Genshin Impact
|
|
|
tixl3d/tixl
TiXL is an open source software to create realtime motion graphics.
|
|
|
dorisoy/Dorisoy.Pan
Dorisoy.Pan 是基于 .NET 10 的跨平台文档管理系统,使用 MS SQL 2012 / MySQL 8.0(或更高版本)后端数据库,您可以在 Windows、Linux 或 Mac 上运行它。项目中的所有方法都是异步的,支持 JWT 令牌身份验证,项目体系结构遵循 CQRS + MediatR 模式和最佳安全实践。源代码完全可定制,热插拔且清晰的体系结构,使开发定制功能和遵循任何业务需求变得容易。
|
|
|
Keboo/MaterialDesignInXaml.Examples
A collection of small samples using MaterialDesignInXaml.
|
|
|
MediaPortal/MediaPortal-2
Development of MediaPortal 2
|
|
|
dengqizhou30/AIAssist
GameAssist是一个AI游戏助手,结合OpenCv、OpenCvSharp4、ssd_mobilenet_v3等技术,对游戏对象进行识别,支持自动瞄准/自动开枪等功能,提升玩家的游戏体验
|
|
|
dl-cv/OpenIVS
OpenIVS是一个开源的工业视觉系统,它提供了一套工业视觉软件框架,帮助你快速完成工业视觉检测项目。
|
|
|
fusrodahs/OpenCVVision
使用OpenCvSharp创建常用功能集合
|
|
|
guojin-yan/OpenVINO-CSharp-API
OpenVINO wrapper for .NET.
|
|
|
guojin-yan/TensorRT-CSharp-API
TensorRT wrapper for .NET.
|
|
|
TheCheatsrichter/Gw2_Launchbuddy
Custom launcher generator for the video game Guild Wars 2.
|
|
|
rexcardan/Evil-DICOM
A C# DICOM Library
|
|
|
DSPaul/COMPASS
TTRPG resource manager, bringing all your books, maps, etc. in one place.
|
|
|
babalae/better-wuthering-waves
🌊更好的鸣潮 - 后台自动剧情
|
|
|
deepakkumar1984/MxNet.Sharp
.NET Standard bindings for Apache MxNet with Imperative, Symbolic and Gluon Interface for developing, training and deploying Machine Learning models in C#. https://mxnet.tech-quantum.com/
|
|
|
TrustNTE/TrustNTE
TrustNTE让异环解放双手!异环自动化后台静默运行工具 | NTE辅助脚本。支持粉爪大劫案、自动钓鱼、自动战斗、自动打副本、异环刷材料(自动锄地)。基于YOLO AI视觉,全分辨率适配,开源免费的解放双手工具。
|
|
|
died/YOLO3-With-OpenCvSharp4
Demo of implement YOLO v3 with OpenCvSharp v4 on C#
|
|
|
PackingProof/PackingProof-Desktop
快递打包监控-电脑版
|
|
|
DigitalPlatform/dp2
Integrated Library System / 图书馆集成系统
|
|
|
Traeger-GmbH/opcuanet-samples
Sample projects for C#, VB.NET and C++/CLI to guide developers using our OPC UA .NET SDKs.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.13.0.20261107 | 3,201 | 11/7/2026 |
| 4.13.0.20260627 | 68,033 | 6/27/2026 |
| 4.13.0.20260602 | 14,990 | 6/2/2026 |
| 4.13.0.20260531 | 2,362 | 5/31/2026 |
| 4.13.0.20260528 | 1,242 | 5/29/2026 |
| 4.13.0.20260302 | 36,594 | 3/2/2026 |
| 4.13.0.20260228 | 1,126 | 2/28/2026 |
| 4.13.0.20260226 | 1,694 | 2/26/2026 |
| 4.13.0.20260225 | 1,185 | 2/25/2026 |
| 4.13.0.20260222 | 1,601 | 2/22/2026 |
| 4.13.0.20260214 | 3,826 | 2/14/2026 |
| 4.13.0.20260213 | 2,245 | 2/13/2026 |
| 4.13.0.20260211 | 8,451 | 2/11/2026 |
| 4.11.0.20250507 | 178,693 | 5/7/2025 |
| 4.11.0.20250506 | 1,980 | 5/6/2025 |
| 4.10.0.20241108 | 184,314 | 11/8/2024 |
| 4.10.0.20241107 | 2,305 | 11/7/2024 |
| 4.10.0.20240616 | 135,619 | 6/16/2024 |
| 4.10.0.20240615 | 3,045 | 6/15/2024 |
| 4.9.0.20240103 | 162,092 | 1/3/2024 |