| 5 | namespace colmap { |
| 6 | |
| 7 | void PoseGraph::Load(const CorrespondenceGraph& corr_graph) { |
| 8 | for (const auto& [pair_id, num_matches] : |
| 9 | corr_graph.NumMatchesBetweenAllImages()) { |
| 10 | const auto [image_id1, image_id2] = PairIdToImagePair(pair_id); |
| 11 | const TwoViewGeometry two_view_geometry = corr_graph.ExtractTwoViewGeometry( |
| 12 | image_id1, image_id2, /*extract_inlier_matches=*/false); |
| 13 | if (two_view_geometry.cam2_from_cam1.has_value()) { |
| 14 | Edge edge; |
| 15 | edge.cam2_from_cam1 = *two_view_geometry.cam2_from_cam1; |
| 16 | edge.num_matches = num_matches; |
| 17 | AddEdge(image_id1, image_id2, std::move(edge)); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | LOG(INFO) << "Loaded " << edges_.size() << " edges into pose graph"; |
| 22 | } |
| 23 | |
| 24 | std::unordered_set<frame_t> PoseGraph::ComputeLargestConnectedFrameComponent( |
| 25 | const Reconstruction& reconstruction, bool filter_unregistered) const { |