Add OpenCV 5 features wrappers: ALIKED, DISK, LightGlue, ANNIndex, AffineFeature - #1926
Merged
Merged
Conversation
…dex, AffineFeature Wraps the new and previously-unwrapped classes from the OpenCV 5 features module (formerly features2d): - ALIKED, DISK: deep-learning local feature detectors/descriptors (Feature2D, ONNX via dnn). Both expose Create (file path) and CreateFromMemory (buffer). - LightGlueMatcher: attention-based descriptor matcher (DescriptorMatcher) with SetPairInfo/ClearPairInfo. - ANNIndex: Annoy-based approximate nearest neighbor index (modern FLANN alternative) with add/build/knnSearch/save/load and ANNIndexDistance enum. - AffineFeature: affine-invariant wrapper over a backend Feature2D (ASIFT). DNN-dependent classes are guarded with HAVE_OPENCV_DNN in the native bridge. Model-path string entry points use the Windows/NotWindows marshaling split. Tests: AffineFeature and ANNIndex are exercised end-to-end; DISK/ALIKED/ LightGlue verify entry-point wiring (missing model -> OpenCVException) since their ONNX models are not committed. Full Features suite green (51 passed). Refs #1924. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the remaining features (formerly features2d) module classes from #1924 (OpenCV 5 API coverage).
New wrappers
ALIKED/DISK— deep-learning local feature detectors & descriptors (Feature2D, ONNX via the dnn module). Each exposesCreate(model file path) andCreateFromMemory(in-memory buffer). DISK additionally exposesMaxKeypoints/ScoreThreshold/ImageSize.LightGlueMatcher— attention-based descriptor matcher (DescriptorMatcher) withSetPairInfo/ClearPairInfo.ANNIndex— Annoy-based approximate nearest neighbor index (modern FLANN alternative):AddItems/Build/KnnSearch/Save/Load/GetTreeNumber/GetItemNumber/SetOnDiskBuild/SetSeed, plus theANNIndexDistanceenum.AffineFeature— affine-invariant (ASIFT-style) wrapper over a backendFeature2D, withSetViewParams/GetViewParams.Native bridge
#ifdef HAVE_OPENCV_DNN.ANNIndexlives in a newfeatures_ANNIndex.h(it is neitherFeature2DnorDescriptorMatcher); the others are added to the existing grouped headers.Test
AffineFeatureTestandANNIndexTestexercise the classes end-to-end (detect over SIFT backend; add/build/knnSearch round-trip + save/load).DiskAlikedLightGlueTestverifies entry-point wiring (missing model / garbage buffer →OpenCVException), since the ONNX models are not committed to the repo.OpenCvSharpExternlocally; full Features suite green (51 passed).Refs #1924.
🤖 Generated with Claude Code