Repository navigation
fix: FeatureMatch.estimate keeps only an inlier mask as the inlier status - #272
Merged
Merged
Conversation
…atus It took the last value func returned as the inlier mask. Only the robust methods (ransac, lmeds) return one, so with method='8p' or 'leastsquares' the residual became the inlier status and was dropped from the result, and with residual=False the estimate itself was. Keep the last value only if it is a bool array with one element per match; otherwise return everything and clear the inlier status. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| 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.
Fixes
FeatureMatch.estimatetreating the last value that the estimator returns as the inlier mask, whatever it is. Found while typingImagePointFeatures.py(Issue 60); a follow-up to PR 265 (merged).CentralCamera.points2Fandpoints2Hreturn an inlier mask only for the robust methods,"ransac"and"lmeds". With any other method the last value is the residual, or, withresidual=False, the estimate itself. I ranestimateon ORB matches of the two Eiffel images:points2F, method="8p"(F,), the residual is lostpoints2F, method="8p", residual=False(), the estimate is lostFpoints2H, method="leastsquares"(H,), the residual is lostmatches.inliersthen raised a confusingValueErrorabout the index type.The change. The last value is kept as the inlier status only if it is a
boolarray with one element per match. In that case it is not returned, as before, so"ransac"and"lmeds"behave as they did. Otherwise everything the estimator returns is returned, and the inlier status is cleared, so a mask from an earlier call does not stay attached to a new estimate. A single value that is not a tuple or list (an array on its own) is accepted... versionchanged:: 2.5.0is added; the:return:text now says "if there is one".Calls that worked still work: the book calls (
points2F/points2Hwith"ransac") return the same values and keep the same inliers.Tests: 15 new in
tests/test_image_point_features_extra.py: the mask kept and not returned; a list, a wrong-length array and an integer array refused as masks; no mask returns everything; a single array result; a later call clearing an old mask; the options passed on; and the six real estimator calls above on real matches. 10 of them fail on the old code. mypy reports no issues and the full suite passes (2292 passed, 30 skipped).AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code