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

Fix ransac update of the iteration number #6789

Merged
merged 3 commits into from
May 23, 2024

Conversation

nicolaloi
Copy link
Contributor

The update of the iteration number is forced to be non-negative (was negative if corres_inlier_ratio = 0.0)

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes RANSAC exits early when no checker is passed #6709
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Issue 6709: RANSAC incorrectly exits early if corres_inlier_ratio is 0.0 during a RANSAC iteration.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

The corres_inlier_ratio of a specific RANSAC iteration is employed to update est_k_local_d (the maximum number of iterations to be performed) using the formula $est\_k\_local\_d={\text{log} (1-criteria.confidence\_ ) \over \text{log} ( 1-corres\_inlier\_ratio^{ransac\_n})}$.

However, if corres_inlier_ratio = 0.0 then est_k_local_d = -inf. Hence, the maximum number of iterations is negative and RANSAC exits early.

Instead, we want RANSAC to continue to test new transformations. This PR adds a check to ensure that est_k_local_d is non-negative.

The update of the iteration number is forced to be non-negative (was negative if corres_inlier_ratio = 0.0)
Copy link

update-docs bot commented May 12, 2024

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey requested a review from benjaminum May 13, 2024 20:45
Copy link
Member

@ssheorey ssheorey left a comment

Choose a reason for hiding this comment

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

THanks @nicolaloi ! Looks good.

@ssheorey ssheorey merged commit b68eae1 into isl-org:main May 23, 2024
32 of 34 checks passed
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.

RANSAC exits early when no checker is passed
2 participants