ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
consistency_graph.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <string>
12 #include <vector>
13 
14 #include "util/types.h"
15 
16 namespace colmap {
17 namespace mvs {
18 
19 // List of geometrically consistent images, in the following format:
20 //
21 // r_1, c_1, N_1, i_11, i_12, ..., i_1N_1,
22 // r_2, c_2, N_2, i_21, i_22, ..., i_2N_2, ...
23 //
24 // where r, c are the row and column image coordinates of the pixel,
25 // N is the number of consistent images, followed by the N image indices.
26 // Note that only pixels are listed which are not filtered and that the
27 // consistency graph is only filled if filtering is enabled.
29 public:
31  ConsistencyGraph(const size_t width,
32  const size_t height,
33  const std::vector<int>& data);
34 
35  size_t GetNumBytes() const;
36 
37  void GetImageIdxs(const int row,
38  const int col,
39  int* num_images,
40  const int** image_idxs) const;
41 
42  void Read(const std::string& path);
43  void Write(const std::string& path) const;
44 
45 private:
46  void InitializeMap(const size_t width, const size_t height);
47 
48  const static int kNoConsistentImageIds;
49  std::vector<int> data_;
50  Eigen::MatrixXi map_;
51 };
52 
53 } // namespace mvs
54 } // namespace colmap
int width
int height
void GetImageIdxs(const int row, const int col, int *num_images, const int **image_idxs) const
void Read(const std::string &path)
void Write(const std::string &path) const
GraphType data
Definition: graph_cut.cc:138
static const std::string path
Definition: PointCloud.cpp:59