Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change threshold for sfm validity #1760

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

servantftechnicolor
Copy link
Contributor

Actually, sfm returns an error only if there is no reconstructed views.
We want to return an error if there is only the initial reconstructed pair and no other valid views.
If the number of views is small, we still keep 1 view as the minimal size, but for any other size, we also return an error if only 2 views are reconstructed.

int nbposes = _sfmData.getPoses().size();

int minPoses = 1;
if (nbviews > 5)
Copy link
Member

Choose a reason for hiding this comment

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

I would a new param to the set of parameters of the class


(with a line of comment that explains the meaning)
Not necessary that it is exposed, but it's better than having a random number in the code.

Comment on lines +230 to +239
int nbviews = _sfmData.getViews().size();
int nbposes = _sfmData.getPoses().size();

int minPoses = 1;
if (nbviews > 5)
{
minPoses = 3;
}

return (nbposes >= minPoses);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
int nbviews = _sfmData.getViews().size();
int nbposes = _sfmData.getPoses().size();
int minPoses = 1;
if (nbviews > 5)
{
minPoses = 3;
}
return (nbposes >= minPoses);
const auto nbviews = _sfmData.getViews().size();
const auto nbposes = _sfmData.getPoses().size();
const std::size_t minPoses = nbviews > small_dataset? 3 : 1;
return (nbposes >= minPoses);

where small_dataset is the placeholder for the new param discussed above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants