OpenCvSharp4 4.13.0.20260627
Prefix Reserveddotnet add package OpenCvSharp4 --version 4.13.0.20260627
NuGet\Install-Package OpenCvSharp4 -Version 4.13.0.20260627
<PackageReference Include="OpenCvSharp4" Version="4.13.0.20260627" />
<PackageVersion Include="OpenCvSharp4" Version="4.13.0.20260627" />
<PackageReference Include="OpenCvSharp4" />
paket add OpenCvSharp4 --version 4.13.0.20260627
#r "nuget: OpenCvSharp4, 4.13.0.20260627"
#:package OpenCvSharp4@4.13.0.20260627
#addin nuget:?package=OpenCvSharp4&version=4.13.0.20260627
#tool nuget:?package=OpenCvSharp4&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 | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
-
.NETStandard 2.1
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net8.0
- System.Memory (>= 4.6.3)
NuGet packages (181)
Showing the top 5 NuGet packages that depend on OpenCvSharp4:
| Package | Downloads |
|---|---|
|
OpenCvSharp4.Extensions
OpenCvSharp GDI+ extension library. |
|
|
OpenCvSharp4.Windows
OpenCV 4.x wrapper. All-in-one package for Windows users. |
|
|
OpenCvSharp4.WpfExtensions
OpenCvSharp WPF extension library. |
|
|
VL.OpenCV
OpenCV for VL |
|
|
VisioForge.DotNet.Core.CV
VisioForge CV |
GitHub repositories (47)
Showing the top 20 popular GitHub repositories that depend on OpenCvSharp4:
| Repository | Stars |
|---|---|
|
ldqk/Masuit.Tools
全龄段友好的C#万能工具库,码数吐司库,包含一些常用的操作类,大都是静态类,加密解密,反射操作,权重随机筛选算法,分布式短id,表达式树,linq扩展,文件压缩,多线程下载,硬件信息,字符串扩展方法,日期时间扩展操作,中国农历,大文件拷贝,图像裁剪,验证码,断点续传,集合扩展、Excel导出等常用封装。诸多功能集一身,代码量不到2MB!
|
|
|
ramjke/Translumo
Advanced real-time screen translator for games, hardcoded subtitles in videos, static text and etc.
|
|
|
tixl3d/tixl
TiXL is an open source software to create realtime motion graphics.
|
|
|
micjahn/ZXing.Net
.Net port of the original java-based barcode reader and generator library zxing
|
|
|
microsoft/Generative-AI-for-beginners-dotnet
Five lessons, learn how to really apply AI to your .NET Applications
|
|
|
sdcb/PaddleSharp
.NET/C# binding for Baidu paddle inference library and PaddleOCR
|
|
|
takuya-takeuchi/FaceRecognitionDotNet
The world's simplest facial recognition api for .NET on Windows, MacOS and Linux
|
|
|
dnobori/DN_SuperBook_PDF_Converter
DN_SuperBook_PDF_Converter - スキャン書籍 PDF をデジタル書籍並みに大変クリアに読みやすくする AI PDF 高品質化・各種調整ツール
|
|
|
zhuxb711/RX-Explorer
一款优雅的UWP文件管理器 | An elegant UWP Explorer
|
|
|
NickSwardh/YoloDotNet
YoloDotNet - A C# .NET 8.0 project for Classification, Object Detection, OBB Detection, Segmentation and Pose Estimation in both images and live video streams.
|
|
|
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.
|
|
|
Kinovea/Kinovea
Video solution for sport analysis. Capture, inspect, compare, annotate and measure technical performances.
|
|
|
shimat/opencvsharp_samples
|
|
|
babalae/genshin-fishing-toy
🐟 原神自动钓鱼机,有界面且操作简单。Genshin Impact Automatic Fishing Machine.
|
|
|
sdcb/OpenVINO.NET
High quality .NET wrapper for OpenVINO™ toolkit.
|
|
|
fmbot-discord/fmbot
.fmbot is a social Discord bot that provides music statistics for you and your friends.
|
|
|
ksasao/Gochiusearch
A Fast Scene Search Engine for Anime Series 'Gochuumon wa Usagi Desuka?'
|
|
|
Topkill/tianruoocr
天若OCR开源6.0版本,续更开源5.0版,全新版本,全新出发
|
|
|
guojin-yan/YoloDeployCsharp
Deploying Yolov8-det, Yolov8-pose, Yolov8-cls, and Yolov8-seg models based on C # programming language.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.13.0.20260627 | 224 | 6/27/2026 |
| 4.13.0.20260602 | 32,370 | 6/2/2026 |
| 4.13.0.20260531 | 4,058 | 5/31/2026 |
| 4.13.0.20260528 | 4,005 | 5/29/2026 |
| 4.13.0.20260526 | 4,247 | 5/26/2026 |
| 4.13.0.20260427 | 58,508 | 4/29/2026 |
| 4.13.0.20260330 | 57,157 | 3/30/2026 |
| 4.13.0.20260318 | 30,792 | 3/18/2026 |
| 4.13.0.20260317 | 8,606 | 3/17/2026 |
| 4.13.0.20260308 | 27,840 | 3/8/2026 |
| 4.13.0.20260302 | 44,922 | 3/2/2026 |
| 4.13.0.20260228 | 2,381 | 2/28/2026 |
| 4.13.0.20260226 | 4,254 | 2/26/2026 |
| 4.13.0.20260225 | 2,263 | 2/25/2026 |
| 4.13.0.20260222 | 7,884 | 2/22/2026 |
| 4.13.0.20260214 | 33,350 | 2/14/2026 |
| 4.13.0.20260213 | 1,966 | 2/13/2026 |
| 4.13.0.20260211 | 7,609 | 2/11/2026 |
| 4.11.0.20250507 | 1,125,111 | 5/7/2025 |
| 4.11.0.20250506 | 10,740 | 5/6/2025 |