7#include <NDEVR/BaseValues.h>
8#include <NDEVR/Dictionary.h>
11#include <openMVG/sfm/pipelines/sfm_regions_provider.hpp>
12#include <openMVG/features/regions.hpp>
13#include <openMVG/matching/indMatch.hpp>
14#include <openMVG/matching/indMatchDecoratorXY.hpp>
15#include <openMVG/sfm/pipelines/sfm_matches_provider.hpp>
41 class InMemoryRegionsProvider
42 :
public openMVG::sfm::Regions_Provider
45 InMemoryRegionsProvider() =
default;
52 void add(openMVG::IndexT view_id,
53 std::unique_ptr<openMVG::features::Regions> regions)
61 region_type_.reset(regions->EmptyClone());
62 cache_[view_id] = std::shared_ptr<openMVG::features::Regions>(std::move(regions));
68 std::shared_ptr<openMVG::features::Regions>
69 get(
const openMVG::IndexT x)
const override
71 auto it = cache_.find(x);
72 return (it != cache_.end()) ? it->second :
nullptr;
79 return static_cast<uint04>(cache_.size());
85 std::unordered_map<openMVG::IndexT,
86 std::shared_ptr<openMVG::features::Regions>> cache_;
96 class InMemoryMatchesProvider
97 :
public openMVG::sfm::Matches_Provider
100 InMemoryMatchesProvider() =
default;
107 pairWise_matches_ = std::move(matches);
111 bool load(
const openMVG::sfm::SfM_Data&,
const std::string&)
override
bool load(const openMVG::sfm::SfM_Data &, const std::string &) override
Required override — no loading from disk.
void setMatches(openMVG::matching::PairWiseMatches matches)
Overwrite the internal matches map with the result from a matcher.
std::shared_ptr< openMVG::features::Regions > get(const openMVG::IndexT x) const override
Return the regions for a given view.
void add(openMVG::IndexT view_id, std::unique_ptr< openMVG::features::Regions > regions)
Store regions for a view.
uint04 viewCount() const
Return the number of views stored.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...