Skip to content

Commit 3f0db6a

Browse files
authored
Add error handling for insufficient correspondences in AdvancedMatching (#7234)
1 parent e4c3b38 commit 3f0db6a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
- Add select_by_index method to Feature class (PR #7039)
5959
- Add optional indices arg for fast computation of a small subset of FPFH features (PR #7118).
6060
- Fix CMake configuration summary incorrectly reporting `no` for system BLAS. (PR #7230)
61+
- Add error handling for insufficient correspondences in AdvancedMatching (PR #7234)
6162

6263
## 0.13
6364

cpp/open3d/pipelines/registration/FastGlobalRegistration.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ static std::vector<std::pair<int, int>> AdvancedMatching(
6969
int ncorr = static_cast<int>(corres_cross.size());
7070
int number_of_trial = ncorr * 100;
7171

72+
if (ncorr <= 2) {
73+
utility::LogWarning(
74+
"Not enough correspondences for tuple test. At least 3 needed, "
75+
"got {}.",
76+
ncorr);
77+
return {};
78+
}
79+
7280
utility::random::UniformIntGenerator<int> rand_generator(0, ncorr - 1);
7381
std::vector<std::pair<int, int>> corres_tuple;
7482
for (i = 0; i < number_of_trial; i++) {

0 commit comments

Comments
 (0)