feat(features2d): implement complete ORB keypoint detection and steered BRIEF descriptor pipeline#70
Merged
Conversation
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.
PR Summary
feat(features2d): implement complete ORB keypoint detection and steered BRIEF descriptor pipelinefeatures2d&imgprocfeat/issue-60-orb-pyramidtargetingfeat/m5-features2d-moduleDetailed Description
This PR delivers the complete, high-performance pure-Rust implementation of the Oriented FAST and Rotated BRIEF (ORB) keypoint detection and description pipeline, satisfying the entire suite of Milestone 5 goals (tracking under parent Issue #65).
This is a two-commit PR targeting the
feat/m5-features2d-modulebranch. All algorithms have been written from scratch in safe, safe Rust with 100% OpenCV behavioral parity and zero-unsafe FFI bounds.Key Milestones & Features Implemented in this PR:
imgproc::resizeusing generic bilinear interpolation and parallel loops (rayon) to support arbitrary floating-point scale factor resizing required by the decimation pyramid (rather than standard power-of-2 restricted downscaling).build_orb_pyramid) that distribute the target keypoint count geometrically across layers according to decimation factors.precompute_umax) to speed up pixel offset traversals.[0.0, 360.0)degrees.bit_pattern_31.rsmirroring OpenCV's static arrays to avoid source bloat.benches/features2d_bench.rscomparing FAST and unified ORB pipelines.Review Checklist
General
cargo fmt --checkpasses).Code Quality
cargo clippyis 100% clean with 0 warnings.rayoninternally whenparallelis enabled, falling back to sequential iterations seamlessly when disabled.Testing
src/features2d/tests.rsandsrc/imgproc/tests.rs.cargo bench --bench features2d_bench.Risk Assessment
bit_pattern_31,orb,resize) and co-located tests for localized verification.Test Coverage & Verification
src/features2d/orb.rssrc/imgproc/resize.rssrc/imgproc/tests.rsKey Benchmark Metrics (Criterion):
Visual Aids
Unified ORB
detect_and_computePipeline Flowchart:graph TD A[Input Grayscale Image] --> B[Build Scale Pyramid using Bilinear Resize] B --> C[For each level: Detect FAST Corners] C --> D[Rank Corners using corner_harris] D --> E[Retain top keypoints per level] E --> F[Assign Orientation using Intensity Centroid method] F --> G[Re-scale keypoints to original coordinate space] G --> H[Compute steered BRIEF descriptors using bit_pattern_31] H --> I[Output Keypoints & Descriptors]Size Recommendations
At 927 lines of highly cohesive changes, this PR is at an excellent size for review. Since the features are highly coupled (FAST feeds into ORB, which uses steered BRIEF and the pyramid resizer), compiling and reviewing them as a single cohesive module is highly recommended.
Review Automation
cargo clippy --all-targets --all-features(0 warnings).cargo fmt --check(succeeds).cargo test(all 281 + 28 pass).