Skip to content

calib3d(usac): do not crash on empty models#19640

Merged
alalek merged 3 commits intoopencv:masterfrom
alalek:issue_19639
Feb 28, 2021
Merged

calib3d(usac): do not crash on empty models#19640
alalek merged 3 commits intoopencv:masterfrom
alalek:issue_19639

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Feb 28, 2021

resolves #19639
relates #17683

inline bool isModelGood(const Mat& model) override
{
if (model.empty())
return false;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ivashmak @vpisarev Is it valid?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes it is. However, the situation that model comes empty to SPRT should not have happened in general. Maybe there is a problem somewhere else, I'll check it. For function setModelParameters CV_CheckTypeEQ(model.depth(), CV_64F, ""); it is a bit redundant because the model will always be in double format. It comes from solver.

@alalek
Copy link
Copy Markdown
Member Author

alalek commented Feb 28, 2021

👍

@alalek alalek merged commit f70e80a into opencv:master Feb 28, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
calib3d(usac): do not crash on empty models

* calib3d(test): regression test for issue 19639

* calib3d(usac): do not crash in setModelParameters()

* calib3d(usac): handle empty models in isModelGood()
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.

version 4.5.1 findFundamentalMat Magsac algorithm SegmentFault across platforms on specific keypoint input

2 participants