Repository navigation
feat: add Image.SURF and SURFFeature - #201
Merged
Merged
Conversation
SURF is patented and absent from standard OpenCV builds, so SURF() raises a clear error that says to use a build with the contrib modules and OPENCV_ENABLE_NONFREE, or another detector, and the contrib-missing error still says to install opencv-contrib-python. BRISK and AKAZE are now resolved only when used, so a detector missing from OpenCV 5 without contrib no longer breaks every other feature detector. Closes #113 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 7 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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
Adds
Image.SURF()andSURFFeature, mirroringSIFT(scale and orientation on), and listsSURFFeaturein the support-classes docs. Closes #113 (Image.SURF()documented but not implemented).SURF is patented, so it is left out of standard OpenCV builds, including the
opencv-contrib-pythonwheels on PyPI. Rather than fail with an obscure OpenCV error:SURF()raises aRuntimeErrorthat says to use a build with the contrib modules andOPENCV_ENABLE_NONFREE=ON, or another detector such as SIFT, ORB, BRISK or AKAZE;opencv-contrib-python.Also changes
_image2featureto resolve the BRISK and AKAZE detectors only when they are used. They were resolved eagerly on every call, so on OpenCV 5 without the contrib modules every detector, including SIFT, would have failed.The docstring example is a
code-block, not arunblock, because SURF cannot run on the standard wheels.Testing
mypypasses with zero errors and the 24 tests intests/test_image_point_features.pypass, run on OpenCV 5.0 only. The real SURF test runs only if the OpenCV in use has SURF, which it does not here, so real SURF has never been run. The other three tests are mocked: the non-free error message, the missing contrib modules, and the wiring (SIFT standing in for the SURF detector). Not run: OpenCV 4, the docs build, and the full suite (left to CI).This change was written with AI assistance (Claude Code) and the diff has been reviewed by the maintainer.
🤖 Generated with Claude Code