| 9 | namespace glomap { |
| 10 | |
| 11 | class ViewGraph { |
| 12 | public: |
| 13 | // Methods |
| 14 | inline void RemoveInvalidPair(image_pair_t pair_id); |
| 15 | |
| 16 | // Mark the image which is not connected to any other images as not registered |
| 17 | // Return: the number of images in the largest connected component |
| 18 | int KeepLargestConnectedComponents( |
| 19 | std::unordered_map<image_t, Image>& images); |
| 20 | |
| 21 | // Mark the cluster of the cameras (cluster_id sort by the the number of |
| 22 | // images) |
| 23 | int MarkConnectedComponents(std::unordered_map<image_t, Image>& images, |
| 24 | int min_num_img = -1); |
| 25 | |
| 26 | // Establish the adjacency list |
| 27 | void EstablishAdjacencyList(); |
| 28 | |
| 29 | inline const std::unordered_map<image_t, std::unordered_set<image_t>>& |
| 30 | GetAdjacencyList() const; |
| 31 | |
| 32 | // Data |
| 33 | std::unordered_map<image_pair_t, ImagePair> image_pairs; |
| 34 | |
| 35 | image_t num_images = 0; |
| 36 | image_pair_t num_pairs = 0; |
| 37 | |
| 38 | private: |
| 39 | int FindConnectedComponent(); |
| 40 | |
| 41 | void BFS(image_t root, |
| 42 | std::unordered_map<image_t, bool>& visited, |
| 43 | std::unordered_set<image_t>& component); |
| 44 | |
| 45 | // Data for processing |
| 46 | std::unordered_map<image_t, std::unordered_set<image_t>> adjacency_list; |
| 47 | std::vector<std::unordered_set<image_t>> connected_components; |
| 48 | }; |
| 49 | |
| 50 | const std::unordered_map<image_t, std::unordered_set<image_t>>& |
| 51 | ViewGraph::GetAdjacencyList() const { |
nothing calls this directly
no outgoing calls
no test coverage detected