| 75 | |
| 76 | template <typename Report> |
| 77 | void ValidateReport(const Report& report, |
| 78 | const SimilarityTransformTestData& data) { |
| 79 | EXPECT_TRUE(report.success); |
| 80 | EXPECT_GT(report.num_trials, 0); |
| 81 | |
| 82 | EXPECT_EQ(report.support.num_inliers, data.num_samples - data.num_outliers); |
| 83 | for (size_t i = 0; i < data.num_samples; ++i) { |
| 84 | if (i < data.num_outliers) { |
| 85 | EXPECT_FALSE(report.inlier_mask[i]); |
| 86 | } else { |
| 87 | EXPECT_TRUE(report.inlier_mask[i]); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | const double matrix_diff = |
| 92 | (data.expected_tgt_from_src.ToMatrix() - report.model).norm(); |
| 93 | EXPECT_LT(matrix_diff, 1e-6); |
| 94 | } |
| 95 | |
| 96 | TEST(LORANSAC, Report) { |
| 97 | LORANSAC<SimilarityTransformEstimator<3>, |