Wrap features2d (2/2): generated wrappers + tests (closes #51)#82
Merged
Conversation
The regenerated Julia bindings for features2d (cv_cxx_wrap.jl / cv_wrap.jl), removal of the now-autogenerated manual wrappers, and the tests. These reference features2d symbols in libopencv_julia that only exist once OpenCV_jll is rebuilt from the generator changes in the companion gen PR — so this PR's tests pass only after that new JLL is registered. Stacked on the gen PR; rebase onto master once it merges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 4, 2026
3 tasks
ViralBShah
added a commit
that referenced
this pull request
Jun 5, 2026
…trip, test axes The features2d test suite (added in #82, never run against a published OpenCV_jll 4.13) failed in several ways once the JLL built: - ORB_create()/SimpleBlobDetector_create() had no zero-argument methods; add convenience overloads supplying OpenCV's standard defaults. - detect() -> compute() round-trip was broken. The generic StdVector conversion returned Vector{KeyPointDereferenced} whose elements are views into detect()'s C++ vector; once that return value is freed the elements dangle (use-after-free), corrupting keypoint.octave and tripping ORB's 'inv_scale_x > 0' pyramid assertion non-deterministically. It is also the wrong, invariant container type for compute()'s Vector{KeyPoint} parameter. Fix by value-copying each KeyPoint into a fresh Julia-owned object while the source is alive, and rebuilding StdVector{KeyPoint} (the only registered element type) on the way back to C++. - Test assertions assumed a (keypoints, descriptorSize) descriptor layout and exact crossCheck match counts. OpenCV.jl stores cv::Mat as (channels, cols, rows), so the keypoint axis is dim 3; and crossCheck collapses ORB's duplicate descriptors, so matches <= length(kps). Correct both. Full suite: 208/208 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Part 2 of 2 splitting #79. Stacked on the generator PR (1/2).
Contains the regenerated Julia bindings for features2d (
src/generated/cv_cxx_wrap.jl,src/generated/cv_wrap.jl), removal of the now-autogenerated manual wrappers (src/cv_manual_wrap.jl), and the tests (test/test_feature2d.jl).Expects the new JLL. These wrappers reference features2d symbols in
libopencv_juliathat only exist onceOpenCV_jllis rebuilt from PR (1/2)'s generator changes. So this PR's runtime tests pass only after that new JLL is registered.OpenCV_jll's build-number resolution picks up the new build automatically (compat already allows it).Merge order: (1/2) → Yggdrasil rebuilds OpenCV_jll → this PR (rebased onto master) goes green → merge.
🤖 Generated with Claude Code