| 66 | } |
| 67 | |
| 68 | TEST(Alignment, AlignReconstructionToLocations) { |
| 69 | Reconstruction src_reconstruction = GenerateReconstructionForAlignment(); |
| 70 | Reconstruction tgt_reconstruction = src_reconstruction; |
| 71 | |
| 72 | Sim3d gt_tgt_from_src = TestSim3d(); |
| 73 | tgt_reconstruction.Transform(gt_tgt_from_src); |
| 74 | |
| 75 | std::vector<std::string> tgt_image_names; |
| 76 | std::vector<Eigen::Vector3d> tgt_image_locations; |
| 77 | for (const auto& [_, image] : tgt_reconstruction.Images()) { |
| 78 | tgt_image_names.push_back(image.Name()); |
| 79 | tgt_image_locations.push_back(image.ProjectionCenter()); |
| 80 | } |
| 81 | |
| 82 | RANSACOptions ransac_options; |
| 83 | ransac_options.max_error = 1e-2; |
| 84 | |
| 85 | Sim3d tgt_from_src; |
| 86 | ASSERT_FALSE(AlignReconstructionToLocations( |
| 87 | src_reconstruction, |
| 88 | tgt_image_names, |
| 89 | tgt_image_locations, |
| 90 | /*min_common_images=*/tgt_image_names.size() + 1, |
| 91 | ransac_options, |
| 92 | &tgt_from_src)); |
| 93 | ASSERT_TRUE(AlignReconstructionToLocations(src_reconstruction, |
| 94 | tgt_image_names, |
| 95 | tgt_image_locations, |
| 96 | /*min_common_images=*/3, |
| 97 | ransac_options, |
| 98 | &tgt_from_src)); |
| 99 | ExpectEqualSim3d(gt_tgt_from_src, tgt_from_src); |
| 100 | } |
| 101 | |
| 102 | TEST(Alignment, AlignReconstructionToPosePriors) { |
| 103 | Reconstruction src_reconstruction = GenerateReconstructionForAlignment(); |
nothing calls this directly
no test coverage detected