Skip to content

Commit 36fcb18

Browse files
committed
Update README for OpenCvSharp5: fix stale v4-era content
- Point macOS quick start/install at OpenCvSharp5 packages, which are now actually published, instead of the leftover OpenCvSharp4 example - Drop the ubuntu.*-deprecation warning: that distro-specific package family only ever existed for OpenCvSharp4, never OpenCvSharp5 - Remove the OpenCvSharp3-*/OpenCvSharp-* legacy package mentions - Update the native wrapper cmake generator example to VS 2026 (with a note for VS 2022), matching the CI and build script - Fix MatExprNode -> MatExpr to match the current public type name
1 parent 15517bb commit 36fcb18

2 files changed

Lines changed: 10 additions & 16 deletions

File tree

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ dotnet add package OpenCvSharp5.official.runtime.linux-x64
3838

3939
### macOS
4040
```bash
41-
dotnet add package OpenCvSharp4
41+
dotnet add package OpenCvSharp5
4242
# Intel (x64):
43-
dotnet add package OpenCvSharp4.runtime.osx.x64
43+
dotnet add package OpenCvSharp5.runtime.osx.x64
4444
# Apple Silicon (arm64):
45-
dotnet add package OpenCvSharp4.runtime.osx.arm64
45+
dotnet add package OpenCvSharp5.runtime.osx.arm64
4646
```
4747

4848
For more installation options, see the [Installation](#installation) section below.
@@ -101,19 +101,16 @@ dotnet add package OpenCvSharp5.official.runtime.linux-x64
101101
dotnet run
102102
```
103103

104-
> ⚠️ The distro-specific `OpenCvSharp5.official.runtime.ubuntu.*` packages are **no longer maintained**. Use `OpenCvSharp5.official.runtime.linux-x64` instead.
105-
106-
107104
### macOS (Intel and Apple Silicon)
108-
Add `OpenCvSharp4` and the runtime package matching your architecture:
105+
Add `OpenCvSharp5` and the runtime package matching your architecture:
109106
```bash
110107
dotnet new console -n ConsoleApp01
111108
cd ConsoleApp01
112-
dotnet add package OpenCvSharp4
109+
dotnet add package OpenCvSharp5
113110
# Intel (x64):
114-
dotnet add package OpenCvSharp4.runtime.osx.x64
111+
dotnet add package OpenCvSharp5.runtime.osx.x64
115112
# Apple Silicon (arm64):
116-
dotnet add package OpenCvSharp4.runtime.osx.arm64
113+
dotnet add package OpenCvSharp5.runtime.osx.arm64
117114
# --- edit Program.cs ---
118115
dotnet run
119116
```
@@ -156,7 +153,7 @@ using (new Window("dst image", dst))
156153
<details>
157154
<summary><b>Note: chained Mat arithmetic is leak-free</b></summary>
158155

159-
`Mat` arithmetic operators (`+`, `-`, `*`, `/`, the comparison and bitwise operators, `T()`, `Inv()`, `Mul()`, `Abs()`, `Eye`/`Zeros`/`Ones`, ...) return a purely managed, lazily-evaluated expression tree (`MatExprNode`) that holds **no** unmanaged resources. The native `cv::MatExpr` chain is built only when the expression is materialized — when it is assigned to a `Mat`, or passed where a `Mat`/`InputArray` is expected — and every native intermediate is disposed immediately during that evaluation.
156+
`Mat` arithmetic operators (`+`, `-`, `*`, `/`, the comparison and bitwise operators, `T()`, `Inv()`, `Mul()`, `Abs()`, `Eye`/`Zeros`/`Ones`, ...) return a purely managed, lazily-evaluated expression tree (`MatExpr`) that holds **no** unmanaged resources. The native `cv::MatExpr` chain is built only when the expression is materialized — when it is assigned to a `Mat`, or passed where a `Mat`/`InputArray` is expected — and every native intermediate is disposed immediately during that evaluation.
160157

161158
As a result, chained expressions never leak: you only need `using` on your inputs and on the final `Mat`. The intermediate expression nodes require no disposal.
162159

@@ -219,9 +216,6 @@ http://shimat.github.io/opencvsharp/api/OpenCvSharp.html
219216
220217
Native binding (OpenCvSharpExtern.dll / libOpenCvSharpExtern.so / libOpenCvSharpExtern.dylib) is required for OpenCvSharp to work. To use OpenCvSharp, you should add both `OpenCvSharp5` and `OpenCvSharp5.runtime.*` packages to your project. Currently, native bindings for Windows x64/ARM64, Linux x64/ARM64, macOS x64/arm64, and WebAssembly are available.
221218

222-
Packages named OpenCvSharp3-* and OpenCvSharp-* are deprecated.
223-
> [OpenCvSharp3-AnyCPU](https://www.nuget.org/packages/OpenCvSharp3-AnyCPU/) / [OpenCvSharp3-WithoutDll](https://www.nuget.org/packages/OpenCvSharp3-WithoutDll/) / [OpenCvSharp-AnyCPU](https://www.nuget.org/packages/OpenCvSharp-AnyCPU/) / [OpenCvSharp-WithoutDll](https://www.nuget.org/packages/OpenCvSharp-WithoutDll/)
224-
225219
## Downloads
226220
If you are not using NuGet, you can download the DLL files from the [release page](https://github.com/shimat/opencvsharp/releases).
227221

@@ -268,7 +262,8 @@ https://github.com/shimat?tab=packages
268262

269263
3. Build the native wrapper `OpenCvSharpExtern`:
270264
```powershell
271-
cmake -S src -B src\build -G "Visual Studio 17 2022" -A x64 `
265+
# Use "Visual Studio 17 2022" for VS 2022, or "Visual Studio 18 2026" for VS 2026
266+
cmake -S src -B src\build -G "Visual Studio 18 2026" -A x64 `
272267
-D "CMAKE_PREFIX_PATH=$PWD\opencv_artifacts" `
273268
-D CMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" `
274269
-D VCPKG_TARGET_TRIPLET=x64-windows-static `

packaging/nuget/README.runtime.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ The Linux `linux-x64` packages are built on **manylinux_2_28** (glibc 2.28) and
3333
| `OpenCvSharp5.runtime.osx.x64` | macOS x64 (Intel) |
3434
| `OpenCvSharp5.runtime.osx.arm64` | macOS 11.0+ arm64 (Apple Silicon) |
3535

36-
> **Note:** `OpenCvSharp5.official.runtime.ubuntu.22.04-x64`, `ubuntu.22.04-x64.slim`, `ubuntu.24.04-x64`, and `ubuntu.24.04-x64.slim` are **deprecated**. Migrate to the portable `linux-x64` packages.
3736
> **Note:** `OpenCvSharp5.runtime.linux-arm` has been renamed to `OpenCvSharp5.runtime.linux-arm64` to correctly reflect the ARM64 (AArch64) RID. The old package is kept as a compatibility shim that automatically pulls in the renamed package, but new projects should reference `OpenCvSharp5.runtime.linux-arm64` directly.
3837
3938
## Slim Profile

0 commit comments

Comments
 (0)