Fortgeschrittenenpraktikum
graph.h
1 #ifndef GRAPH_H
2 #define GRAPH_H
3 
4 #include <boost/graph/adjacency_list.hpp>
5 #include <boost/graph/subgraph.hpp>
6 #include <scip/scip.h>
7 
8 using namespace boost;
9 
13 struct Pixel
14 {
15  uint32_t x;
16  uint32_t y;
17 
18  Pixel(uint32_t x_, uint32_t y_) : x(x_), y(y_)
19  {}
20 };
21 
25 struct Superpixel
26 {
27  SCIP_Real color;
28  std::vector<Pixel> pixels;
29 };
30 
36 typedef subgraph<adjacency_list<
37  setS, // setS disallows parallel edges
38  vecS, undirectedS,
39  Superpixel,
40  property<edge_index_t, size_t,
41  property<edge_weight_t, size_t>> // edge weight is the number of neighbouring pixels,
42  // i.e. the number of edges in the pixel graph
43  // connecting both superpixels
44  >>
45  Graph;
46 
47 #endif
SCIP_Real color
color of the superpixel, i.e. the average color of all pixels contained in it
Definition: graph.h:27
uint32_t x
x coordinate
Definition: graph.h:15
Struct representing a superpixel.
Definition: graph.h:25
std::vector< Pixel > pixels
vector of all pixels contained in the superpixel
Definition: graph.h:28
Struct representing a pixel in the imput image.
Definition: graph.h:13
uint32_t y
y coordinate
Definition: graph.h:16