connected_components.h
Go to the documentation of this file.
1 #ifndef CONNECTED_COMPONENTS_H
2 #define CONNECTED_COMPONENTS_H
3 
4 #include <vector>
5 #include <valarray>
6 #include <ros/ros.h>
7 
8 using namespace std;
9 
15 {
16 public:
24  connected_components (valarray<int> m, int rows, int cols, bool zeroAsBg);
25 
30  valarray<int> compactLabeling ();
31 
36  int getMaxLabel ();
37 
38 
43  vector<int> labeling ();
44 
51  void uf_union (int x, int y, vector<int>& parent);
52 
60  int uf_find (int x, vector<int> parent, vector<int>& label);
61 
66  void constructBinaryImages (int robotsLabel);
67 
73  valarray<float> NormalizedEuclideanDistanceBinary (bool RobotR);
74 
75 private:
83  void DT1D (vector<float> f, vector<float>& d, vector<int>& v , vector<float>& z);
84 
91  vector<float> getVector (valarray<float> A, int row);
92 
96  valarray<int> label2d;
97 
101  valarray<int> BinaryRobot;
102 
106  valarray<int> BinaryNonRobot;
107 
111  int rows;
112 
116  int cols;
117 
121  int next_label = 1;
122 
126  vector<int> image;
127 
131  bool zeroAsBg;
132 };
133 
134 #endif // CONNECTED_COMPONENTS_H
valarray< int > BinaryRobot
Binary array of the label assigned to a robot.
vector< int > image
The image to perform the labeling on.
Use row-by-row labeling algorithm to label connected components. The algorithm makes two passes over ...
int cols
Number of columns of the image.
int rows
Number of rows of the image.
valarray< int > label2d
Array of labels.
bool zeroAsBg
Whether 0 should be considered or not.
valarray< int > BinaryNonRobot
Binary array of the labels not assigned to a robot.


area_division
Author(s): Micha Sende
autogenerated on Thu Oct 31 2019 09:22:46