Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix intrinsics processing in case USAC parameters#21166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
alalek merged 2 commits intoopencv:4.xfromrayonnant14:issue_21105
Dec 13, 2021

Conversation

@rayonnant14
Copy link
Contributor

@rayonnant14rayonnant14 commentedNov 30, 2021
edited by alalek
Loading

fixes#21105
relates#17683

Pull Request Readiness Checklist

See details athttps://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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

Copy link
Member

@alalekalalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you!

Please add simple regression tests case based on code from the issue.

voidUtils::calibratePoints (const Mat &K1,const Mat &K2,const Mat &points, Mat &calib_points) {
constauto *const points_ = (float *) points.data;
constauto *const k1 =(double *) K1.data;
constauto *const k1 =K1.isContinuous() ? (double *) K1.data : (double *) K1.clone().data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

K1.clone().data

Don't use dangling pointers.
This expression creates temporary object which is disposed before the next line.


To declare assumptions of this code we should have several checks:

  • CV_Assert(K1.isContinuous());
  • CV_CheckDepthEQ(K1.depth(), CV_32F, ""); due to assumption(double *) K1.data
  • CV_CheckEQ(K1.total(), (size_t)9, "");
  • and similar for other types.

To avoid such "void" interface checks it is better to useconst Matx33d& K1 parameters in internal API.


.clone() should be done by caller function of this function (or convert toMatx33d).

Copy link
Member

@alalekalalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Well done! Thank you 👍

@alalekalalek merged commit456137f intoopencv:4.xDec 13, 2021
@alalekalalek mentioned this pull requestDec 30, 2021
@alalekalalek mentioned this pull requestFeb 22, 2022
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull requestMar 30, 2023
Fix intrinsics processing in case USAC parameters* fixed USAC intrinsics processing* change mat to matx33d, added test
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alalekalalekalalek approved these changes

Assignees

@alalekalalek

Projects

None yet

Milestone

4.5.5

Development

Successfully merging this pull request may close these issues.

solvePnPRansac with USAC returns empty inlier cv::Mat

2 participants

@rayonnant14@alalek

[8]ページ先頭

©2009-2025 Movatter.jp