| 51 | } |
| 52 | |
| 53 | TEST(GlobalMapper, WithoutNoise) { |
| 54 | const std::string database_path = colmap::CreateTestDir() + "/database.db"; |
| 55 | |
| 56 | colmap::Database database(database_path); |
| 57 | colmap::Reconstruction gt_reconstruction; |
| 58 | colmap::SyntheticDatasetOptions synthetic_dataset_options; |
| 59 | synthetic_dataset_options.num_cameras = 2; |
| 60 | synthetic_dataset_options.num_images = 7; |
| 61 | synthetic_dataset_options.num_points3D = 50; |
| 62 | synthetic_dataset_options.point2D_stddev = 0; |
| 63 | colmap::SynthesizeDataset( |
| 64 | synthetic_dataset_options, >_reconstruction, &database); |
| 65 | |
| 66 | ViewGraph view_graph; |
| 67 | std::unordered_map<camera_t, Camera> cameras; |
| 68 | std::unordered_map<image_t, Image> images; |
| 69 | std::unordered_map<track_t, Track> tracks; |
| 70 | |
| 71 | ConvertDatabaseToGlomap(database, view_graph, cameras, images); |
| 72 | |
| 73 | GlobalMapper global_mapper(CreateTestOptions()); |
| 74 | global_mapper.Solve(database, view_graph, cameras, images, tracks); |
| 75 | |
| 76 | colmap::Reconstruction reconstruction; |
| 77 | ConvertGlomapToColmap(cameras, images, tracks, reconstruction); |
| 78 | |
| 79 | ExpectEqualReconstructions(gt_reconstruction, |
| 80 | reconstruction, |
| 81 | /*max_rotation_error_deg=*/1e-2, |
| 82 | /*max_proj_center_error=*/1e-4, |
| 83 | /*num_obs_tolerance=*/0); |
| 84 | } |
| 85 | |
| 86 | TEST(GlobalMapper, WithNoiseAndOutliers) { |
| 87 | const std::string database_path = colmap::CreateTestDir() + "/database.db"; |
nothing calls this directly
no test coverage detected