Skip to content

5.0.0.20260703

Choose a tag to compare

@shimat shimat released this 03 Jul 15:24
d3bb1f3

Highlights

This release migrates OpenCvSharp to OpenCV 5 (native + managed) and targets .NET 8+ only. Highlights:

  • OpenCV 5 port: native OpenCvSharpExtern rebuilt against OpenCV 5.0.0, with module relocations (features2d→features, calib3d split, new ptcloud wrapper) and behavior-change fixes.
  • New high-level DNN APIs: Model (Classification/Detection/Segmentation/Keypoints), text recognition/detection, Tokenizer, TFLite reader, and richer Net introspection/tracing/profiling.
  • New feature & geometry wrappers: ALIKED, DISK, LightGlue, ANNIndex, AffineFeature, USAC polishing, multi-view camera calibration, ptcloud mesh I/O, TrueType text rendering (FontFace), typed Mat<T>/SparseMat<T>.
  • Large internal modernization: SafeHandle + LibraryImport P/Invoke throughout, allocation-free InputArray/OutputArray ref structs, lazy/leak-free Mat arithmetic via a managed MatExpr tree, UTF-8 path/string handling, and removal of several legacy helper types.
  • Infra: macOS x64/arm64 CI restored, Docker packaging cleanup, test project moved off SixLabors.ImageSharp to SkiaSharp/LibTiff.NET, various dependency bumps.

See the full PR list below for details.

Full Changelog: 4.13.0.20260627...5.0.0.20260703

Full changelog (65 PRs)

OpenCV 5 core migration

  • OpenCvSharp5 foundation: OpenCV 5 packaging, .NET 8+ TFMs, docs by @shimat in #1901
  • OpenCV 5 native port: OpenCvSharpExtern compiles against OpenCV 5.0.0 by @shimat in #1903
  • Fix OpenCV 5 CI test failures (type encoding, 1-D Mats, behavior changes) by @shimat in #1907
  • OpenCV 5: rename features2d→features, split calib3d, add ptcloud wrapper by @shimat in #1910
  • ptcloud: wrap RgbdNormals, depth free functions, and Odometry.getNormalsComputer by @shimat in #1911
  • Fix/superpixelseeds test params by @shimat in #1916
  • Fix MatType.IsInteger for OpenCV 5 integer depths; clarify Mat.Dims docs by @shimat in #1931
  • OpenCV 5 migration (5.x integration branch) by @shimat in #1920
  • Expand the 4-to-5 migration guide and spotlight it from the README by @shimat in #1992

DNN

  • Add high-level dnn Model API (Model + Classification/Detection/Segmentation/Keypoints) by @shimat in #1917
  • Add high-level dnn text Model API (TextRecognition + TextDetection EAST/DB) by @shimat in #1918
  • Add dnn TFLite reader, blobFromImageWithParams, imagesFromBlob, batched/soft NMS by @shimat in #1919
  • Add dnn Net introspection: params, layer types, KV cache, getAvailable*, model format by @shimat in #1922
  • Add DNN engine selection (EngineType) and sync Backend/Target enums by @shimat in #1925
  • Add DNN Tokenizer and Net tracing/profiling/finalizeNet/registerOutput by @shimat in #1934
  • Add detailed Net.GetPerfProfileDetailed by @shimat in #1937
  • Wrap dnn Net shape/FLOPS/memory introspection (#1923) by @shimat in #1962

Features / imgproc / calib / ptcloud additions

  • Add OpenCV 5 features wrappers: ALIKED, DISK, LightGlue, ANNIndex, AffineFeature by @shimat in #1926
  • Add geometry/calib functions: solvePnPRefine, decomposeEssentialMat, estimateTranslation2D/3D, fisheye distortPoints overload by @shimat in #1927
  • Add ptcloud mesh / point cloud I/O: loadPointCloud, savePointCloud, loadMesh, saveMesh by @shimat in #1928
  • Add imgproc TrueType text rendering: FontFace + FontFace-based PutText/GetTextSize by @shimat in #1929
  • Add imgproc additions: INTER_NEAREST_EXACT, Filter2DParams overload, findContoursLinkRuns by @shimat in #1930
  • Add AlgorithmHint parameter to warpAffine/warpPerspective/remap/GaussianBlur/cvtColor by @shimat in #1932
  • Add USAC PolishingMethod + findFundamentalMat UsacParams overload by @shimat in #1933
  • Add core MatShape value type and Mat integration by @shimat in #1935
  • Add multi-view camera calibration: registerCameras and calibrateMultiview by @shimat in #1936
  • SparseMat: non-zero element enumeration + Get/Set and ToString cleanup by @shimat in #1959
  • Typed matrices: generic SparseMat redesign and Mat improvements by @shimat in #1961
  • Enable the parked line_descriptor LSDDetector wrapper by @shimat in #1996
  • Polish ConnectedComponents wrappers (doc fix + eager-copy / round-trip efficiency) by @shimat in #1999

Internal modernization

  • Unify blittable std::vector wrappers into a single StdVector (Phase 0) by @shimat in #1940
  • Slim CvObject base + SafeHandle/LibraryImport foundation (Phase 1) by @shimat in #1942
  • Internal Phase 2: migrate P/Invoke from [DllImport] to [LibraryImport] by @shimat in #1943
  • Support UTF-8 / non-ANSI image file paths on Windows (imgcodecs) by @shimat in #1944
  • Support UTF-8 / non-ANSI model paths on Windows (dnn) by @shimat in #1945
  • Internal 1b: unify CvPtrObject on the owned SafeHandle (+ CLAHE pilot) by @shimat in #1946
  • Internal 1b: sweep wrapper classes to SafeHandle args (drop GC.KeepAlive(this)) by @shimat in #1952
  • Standardize on UTF-8 without BOM across the repository by @shimat in #1953
  • Internal 1b: pass SafeHandle to entry points and drop GC.KeepAlive(this) by @shimat in #1958
  • Modernize P/Invoke POD types into namespace interop (#1902) by @shimat in #1963
  • Unify free-function facades into nested Cv2. classes (#1921) by @shimat in #1965
  • Replace BEGIN_WRAP/END_WRAP macros with a cvTry() wrapper by @shimat in #1968
  • Unify native→managed error propagation; drop the managed error callback by @shimat in #1969
  • Eliminate ArrayAddress1; make ArrayAddress2 a scoped ref struct by @shimat in #1970
  • Modernize Window/CvTrackbar; delete DisposableObject (closes #1941) by @shimat in #1972
  • Inline the one PInvokeHelper use and delete the class by @shimat in #1973
  • Make Mat arithmetic lazy and leak-free via a managed MatExpr tree (#1974) by @shimat in #1975
  • Remove InputArray collection blockers from StereoCalibrate/Rectify3Collinear by @shimat in #1977
  • Foundation: allocation-free InputArray/OutputArray ref structs (ArrayProxy proxy-POD path) by @shimat in #1980
  • Migration: move externs to the ArrayProxy ABI (strategy 3) by @shimat in #1983
  • Migration: photo/video/features/xphoto/stitching/aruco/ximgproc/ml/ptcloud to the ArrayProxy ABI (by-pointer) by @shimat in #1986
  • Migration: calib module to the ArrayProxy ABI (by-pointer) + tests by @shimat in #1987
  • Migration: remaining modules to the ArrayProxy ABI (by-pointer) + tests by @shimat in #1988
  • Migration: InputArray/OutputArray/InputOutputArray to allocation-free ref structs (issue #1976 step 4 & 5) by @shimat in #1989
  • Remove WindowsLibraryLoader/Win32Api: unreachable now that the managed lib is net8.0-only by @shimat in #1990
  • Internal: remove dead KeepAlive/ElemPtr, add OpenCvSafeHandle.Null for optional args by @shimat in #1998

CI / Infra / Dependencies

  • Add macOS x64/arm64 CI and runtime packages (port of #1947 to 5.x) by @shimat in #1955
  • CI: platform-explicit job names + trim macOS PR checks by @shimat in #1964
  • Replace SixLabors.ImageSharp with SkiaSharp and LibTiff.NET in tests by @shimat in #1994
  • Modernize Docker packaging: drop stale images, fix untested test stages by @shimat in #1995
  • Fix stale FFmpeg plugin DLL reference in test project by @shimat in #1997
  • Update dependency Microsoft.NET.Test.Sdk to 18.7.0 by @renovate[bot] in #1979
  • Update actions/cache action to v6 by @renovate[bot] in #1981
  • Update dependency Microsoft.NET.Test.Sdk to v18 by @renovate[bot] in #1982
  • Update dotnet monorepo to v5 by @renovate[bot] in #1913