44 const std::vector<Feature>& image_features,
45 const std::vector<Descriptor>& image_descriptors) {
52 const std::vector<std::vector<Feature> >& image_features,
53 const std::vector<std::vector<Descriptor> >& image_descriptors) {
55 image_features.end());
57 image_descriptors.end());
81 VLOG(1) <<
"Could not match image " << ii <<
" to image " << jj <<
".";
86 image_matches.push_back(image_match);
91 return image_matches.size() > 0;
95 const std::vector<LightFeatureMatch>& feature_matches_lhs,
96 std::vector<LightFeatureMatch>& feature_matches_rhs) {
97 std::unordered_map<int, int> feature_indices;
98 feature_indices.reserve(feature_matches_lhs.size());
101 for (
const auto& feature_match : feature_matches_lhs) {
102 feature_indices.insert(std::make_pair(feature_match.feature_index1_,
103 feature_match.feature_index2_));
108 auto rhs_iter = feature_matches_rhs.begin();
109 while (rhs_iter != feature_matches_rhs.end()) {
110 const auto& lhs_matched_iter =
111 feature_indices.find(rhs_iter->feature_index2_);
114 if (lhs_matched_iter != feature_indices.end()) {
115 if (lhs_matched_iter->second == rhs_iter->feature_index1_) {
122 feature_matches_rhs.erase(rhs_iter);
virtual bool MatchImages(const FeatureMatcherOptions &options, PairwiseImageMatchList &image_matches)
virtual void SymmetricMatches(const std::vector< LightFeatureMatch > &feature_matches_lhs, std::vector< LightFeatureMatch > &feature_matches_rhs)
std::vector< std::vector< Feature > > image_features_
virtual bool MatchImagePair(int image_index1, int image_index2, PairwiseImageMatch &image_match)=0
std::vector< PairwiseImageMatch > PairwiseImageMatchList
virtual void AddImageFeatures(const std::vector< Feature > &image_features, const std::vector< Descriptor > &image_descriptors)
std::vector< std::vector< Descriptor > > image_descriptors_
FeatureMatcherOptions options_