Ejemplo n.º 1
0
 /// Get feature index PerView and TrackId
 static bool GetFeatIndexPerViewAndTrackId
 (
   const STLMAPTracks & map_tracks,
   const std::set<size_t> & set_trackId,
   size_t nImageIndex,
   std::vector<size_t> * pvec_featIndex
 )
 {
   for (const size_t & trackId: set_trackId)
   {
     STLMAPTracks::const_iterator iterT = map_tracks.find(trackId);
     if (iterT != map_tracks.end())
     {
       //try to find imageIndex
       const submapTrack & map_ref = iterT->second;
       submapTrack::const_iterator iterSearch = map_ref.find(nImageIndex);
       if (iterSearch != map_ref.end())
       {
         pvec_featIndex->emplace_back(iterSearch->second);
       }
     }
   }
   return !pvec_featIndex->empty();
 }
Ejemplo n.º 2
0
 /// Get feature index PerView and TrackId
 static bool GetFeatIndexPerViewAndTrackId
 (
   const STLMAPTracks & tracks,
   const std::set<uint32_t> & track_ids,
   size_t nImageIndex,
   std::vector<uint32_t> * feat_ids
 )
 {
   feat_ids->reserve(tracks.size());
   for (const uint32_t & trackId: track_ids)
   {
     const auto iterT = tracks.find(trackId);
     if (iterT != tracks.end())
     {
       // Look if the desired image index exists in the track visibility
       const auto iterSearch = iterT->second.find(nImageIndex);
       if (iterSearch != iterT->second.end())
       {
         feat_ids->emplace_back(iterSearch->second);
       }
     }
   }
   return !feat_ids->empty();
 }