12 return std::any_of(
x_indices.cbegin(),
x_indices.cend(), [idx](
const int& x){
return x == idx.
x; })
13 && std::any_of(
y_indices.cbegin(),
y_indices.cend(), [idx](
const int& y){
return y == idx.
y; });
18 json j_grid = json::object();
27 for(
int x : j_grid[
"x_indices"]) grid.
x_indices.push_back(x);
28 for(
int y : j_grid[
"y_indices"]) grid.
y_indices.push_back(y);
38 std::vector<int> ref_x_positions, ref_y_positions;
40 std::set<int> ref_x_positions_set, ref_y_positions_set;
42 ref_x_positions_set.insert(idx.x);
43 ref_y_positions_set.insert(idx.y);
45 for(
int x : ref_x_positions) grid.
x_indices.push_back(x);
46 for(
int y : ref_y_positions) grid.
y_indices.push_back(y);
49 for(
int row = 0; row < grid.
rows(); ++row)
50 for(
int col = 0; col < grid.
cols(); ++col) {
52 if(ref_vws.find(ref_idx) == ref_vws.end())
53 throw std::runtime_error(
"reference views are not arranged in a grid");
references_grid decode_references_grid(const json &j_grid)
Set of features, each on set of views.
references_grid references_grid_arg()
json encode_references_grid(const references_grid &grid)
bool has_view(const view_index &) const
std::vector< int > y_indices
std::vector< int > x_indices
view_index view(std::ptrdiff_t col, std::ptrdiff_t row) const
std::set< view_index > get_reference_views_set(const image_correspondences &cors)
references_grid get_references_grid(const image_correspondences &cors)