@@ -15,13 +15,20 @@ bool RetriangulateTracks(const TriangulatorOptions& options,
1515 std::unordered_map<camera_t , Camera>& cameras,
1616 std::unordered_map<image_t , Image>& images,
1717 std::unordered_map<track_t , Track>& tracks) {
18+ // Collect the registered images
19+ std::unordered_set<std::string> registered_image_names;
20+ for (const auto & [image_id, image] : images) {
21+ if (image.is_registered ) {
22+ registered_image_names.insert (image.file_name );
23+ }
24+ }
1825 // Following code adapted from COLMAP
19- auto database_cache =
20- colmap::DatabaseCache::Create ( database,
21- options.min_num_matches ,
22- false , // ignore_watermarks
23- {} // reconstruct all possible images
24- );
26+ auto database_cache = colmap::DatabaseCache::Create (
27+ database,
28+ options.min_num_matches ,
29+ false , // ignore_watermarks
30+ registered_image_names // reconstruct all possible images
31+ );
2532
2633 // Check whether the image is in the database cache. If not, set the image
2734 // as not registered to avoid memory error.
0 commit comments