Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vrabaud
Copy link
Contributor

@vrabaud vrabaud commented May 29, 2024

The bug was introduced in #25308

I am sorry I do not have a proper test.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

The bug was introduced in opencv#25308
@vrabaud vrabaud requested review from asmorkalov and vpisarev May 29, 2024 09:25
@vrabaud
Copy link
Contributor Author

vrabaud commented May 29, 2024

@ivashmak, @dkurt, PTAL

@asmorkalov asmorkalov requested a review from dkurt May 29, 2024 10:01
@asmorkalov asmorkalov added this to the 4.10.0 milestone May 29, 2024
@vrabaud
Copy link
Contributor Author

vrabaud commented May 29, 2024

There is actually another bug at HEAD: H is not normalized if it is refined.
We need a H.convertTo(H, H.type(), scaleFor(H.at<double>(2,2))); here:

if( _mask.needed() )

Should I add it to this PR and rename it?

@dkurt
Copy link
Member

dkurt commented May 29, 2024

@vrabaud, I recommend to add all findings to PR, thanks.

Unfortunately, I also cannot find a proper test. Let's review by definition if you have no test case to catch the problem.

@vrabaud
Copy link
Contributor Author

vrabaud commented May 29, 2024

@dkurt, done. BTW, shouldn't we normalize H by dividing it by H.at<double>(2,2) instead of multiplying by the inverse ? I understand divisions are still 4/5 times slower according to uops.info but at least, we would get exactly 1 for H(2,2).

@dkurt dkurt self-assigned this May 30, 2024
@vrabaud vrabaud changed the title Fix Jacobian computation. Fix Homography computation. May 30, 2024
@dkurt
Copy link
Member

dkurt commented May 30, 2024

@vrabaud, please review commit 3b90aa0 that adds two checks for H normalization and Jacobian calculation for the refinement process.

@vrabaud
Copy link
Contributor Author

vrabaud commented May 31, 2024

@dkurt, thx for the extra commit, +1

@asmorkalov asmorkalov merged commit 1db6a8a into opencv:4.x May 31, 2024
@mshabunin mshabunin mentioned this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants