You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The fix overrides user selection of solver and it's not obvious behaviour. Alternatives I see:
* Add recommendation to documentation how to check the function result (estimate error) and add recommendations.
* Change default method value to make the step-by-step approach more obvious.
Let me talk to colleagues and I'll return back.
@asmorkalov This isn't correct fix (because of that I moved PR to draft state). Problem isn't about solver. I guess, that it is a fundamental problem. In getPerspectiveTransform we search perspective transform only with h_33 != 0 (because use h_33 = 1 normalization), but for several cases (including issue case) solution should have h_33 = 0, because there is no proper solution with h_33 != 0. In issue reproducer correct inv_M* (obtained by inverse and findHomography) matrices have h_33 = 0.
I will try to prepare a correct fix in the near future
* \anchor lecture_16 1. [Lecture 16: Planar Homographies](https://www.cse.psu.edu/~rtc12/CSE486/lecture16.pdf), Robert Collins
on slide 33:
A More General Approach
What might be wrong with setting h33 = 1?
If h33 actually = 0, we canβt get the right answer.
So, that's exactly the problem. We can't limit ourselves only with h33 = 1 normalization case where h33 != 0. In case of failure we must consider h11^2 + h12^2 + h13^2 + h21^2 + h22^2 + h23^2 + h31^2 + h32^2 + h33^2 = 1 normalization case where h33 can be zero.
For implementation of new normalization case I used last 3 slides of the same source
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.
Pull Request Readiness Checklist
Fix #26916
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.