OpenCvSharp4.Windows
4.13.0.20260302
dotnet add package OpenCvSharp4.Windows --version 4.13.0.20260302
NuGet\Install-Package OpenCvSharp4.Windows -Version 4.13.0.20260302
<PackageReference Include="OpenCvSharp4.Windows" Version="4.13.0.20260302" />
<PackageVersion Include="OpenCvSharp4.Windows" Version="4.13.0.20260302" />
<PackageReference Include="OpenCvSharp4.Windows" />
paket add OpenCvSharp4.Windows --version 4.13.0.20260302
#r "nuget: OpenCvSharp4.Windows, 4.13.0.20260302"
#:package OpenCvSharp4.Windows@4.13.0.20260302
#addin nuget:?package=OpenCvSharp4.Windows&version=4.13.0.20260302
#tool nuget:?package=OpenCvSharp4.Windows&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
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- OpenCvSharp4 (>= 4.13.0.20260302)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260302)
- OpenCvSharp4.WpfExtensions (>= 4.13.0.20260302)
-
.NETStandard 2.0
- OpenCvSharp4 (>= 4.13.0.20260302)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260302)
-
.NETStandard 2.1
- OpenCvSharp4 (>= 4.13.0.20260302)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260302)
-
net8.0
- OpenCvSharp4 (>= 4.13.0.20260302)
- OpenCvSharp4.runtime.win (>= 4.13.0.20260302)
- OpenCvSharp4.WpfExtensions (>= 4.13.0.20260302)
NuGet packages (48)
Showing the top 5 NuGet packages that depend on OpenCvSharp4.Windows:
| Package | Downloads |
|---|---|
|
RatEye
Image processing library for Escape from Tarkov |
|
|
Starxcjy.DataAccess.CodeReader
图像处理库 |
|
|
UnionSoft.UiAuto.Automation
Library to use UnionSoft automaion project. |
|
|
OpenVinoSharp.win
基于C#平台调用OpenVINO套件部署深度学习模型。 Based on the C # platform, call the OpenVINO suite to deploy a deep learning model. |
|
|
MxNet.Sharp
C# Binding for the Apache MxNet library. NDArray, Symbolic and Gluon Supported MxNet is a deep learning framework designed for both efficiency and flexibility. It allows you to mix symbolic and imperative programming to maximize efficiency and productivity. At its core, MXNet contains a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly. A graph optimization layer on top of that makes symbolic execution fast and memory efficient. MXNet is portable and lightweight, scaling effectively to multiple GPUs and multiple machines. MXNet is more than a deep learning project. It is a collection of blue prints and guidelines for building deep learning systems, and interesting insights of DL systems for hackers. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on OpenCvSharp4.Windows:
| Repository | Stars |
|---|---|
|
babalae/better-genshin-impact
📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 - UI Automation Testing Tools For Genshin Impact
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.13.0.20260302 | 6,387 | 3/2/2026 |
| 4.13.0.20260228 | 369 | 2/28/2026 |
| 4.13.0.20260226 | 562 | 2/26/2026 |
| 4.13.0.20260225 | 458 | 2/25/2026 |
| 4.13.0.20260222 | 825 | 2/22/2026 |
| 4.13.0.20260214 | 1,703 | 2/14/2026 |
| 4.13.0.20260213 | 541 | 2/13/2026 |
| 4.13.0.20260211 | 619 | 2/11/2026 |
| 4.11.0.20250507 | 106,861 | 5/7/2025 |
| 4.11.0.20250506 | 1,089 | 5/6/2025 |
| 4.10.0.20241108 | 141,424 | 11/8/2024 |
| 4.10.0.20241107 | 1,311 | 11/7/2024 |
| 4.10.0.20240616 | 99,511 | 6/16/2024 |
| 4.10.0.20240615 | 2,315 | 6/15/2024 |
| 4.9.0.20240103 | 134,183 | 1/3/2024 |
| 4.8.0.20230708 | 439,976 | 7/10/2023 |
| 4.7.0.20230115 | 259,650 | 1/15/2023 |
| 4.6.0.20220608 | 180,903 | 6/8/2022 |
| 4.5.5.20211231 | 110,695 | 12/31/2021 |