Skip to content

Wrap features2d (2/2): generated wrappers + tests (closes #51)#82

Merged
ViralBShah merged 2 commits into
masterfrom
vs/features2d-wrappers
Jun 4, 2026
Merged

Wrap features2d (2/2): generated wrappers + tests (closes #51)#82
ViralBShah merged 2 commits into
masterfrom
vs/features2d-wrappers

Conversation

@ViralBShah

Copy link
Copy Markdown
Member

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_julia that only exist once OpenCV_jll is 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

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>
Base automatically changed from vs/features2d-gen to master June 4, 2026 03:01
@ViralBShah ViralBShah merged commit 20d709f into master Jun 4, 2026
1 of 9 checks passed
@ViralBShah ViralBShah deleted the vs/features2d-wrappers branch June 4, 2026 22:40
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant