Fix ransac update of the iteration number #6789
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The update of the iteration number is forced to be non-negative (was negative if corres_inlier_ratio = 0.0)
Type
Motivation and Context
Issue 6709: RANSAC incorrectly exits early if
corres_inlier_ratio
is 0.0 during a RANSAC iteration.Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
The$est\_k\_local\_d={\text{log} (1-criteria.confidence\_ ) \over \text{log} ( 1-corres\_inlier\_ratio^{ransac\_n})}$ .
corres_inlier_ratio
of a specific RANSAC iteration is employed to updateest_k_local_d
(the maximum number of iterations to be performed) using the formulaHowever, if
corres_inlier_ratio = 0.0
thenest_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.