31 FloodFill(
float grid_radius,
float cell_size) : _grid_radius(grid_radius), _cell_size(cell_size) {}
41 std::vector<std::vector<int>>* segments_indices,
42 std::vector<int>* num_cells_per_segment);
50 int Pos(
float x,
float y)
const;
61 bool Pos2d(
float x,
float y,
int* irow,
int* jcol)
const;
74 _grid_radius = grid_radius;
82 _cell_size = cell_size;
90 return _grid_num_rows;
98 return _grid_num_cols;
114 return _point_cloud_grid_idx;
118 bool IsValidRowIndex(
int i)
const {
119 return (i >= 0 && i < _grid_num_rows);
121 bool IsValidColIndex(
int j)
const {
122 return (j >= 0 && j < _grid_num_cols);
124 int GetConnectedComponents();
125 void DfsColoring(
int i,
int j,
int curr_component);
126 float _grid_radius = 0.0;
127 float _cell_size = 0.0;
128 float _offset_x = 0.0;
129 float _offset_y = 0.0;
130 int _grid_num_rows = 0;
131 int _grid_num_cols = 0;
134 std::vector<int> _point_cloud_grid_idx;
135 std::vector<int> _label;
int GetNumCells() const
Get the number of cells
FloodFill(float grid_radius, float cell_size)
void SetGridRadius(float grid_radius)
Set the grid radius
const std::vector< int > & GetPointIdxInGrid() const
Get the indices of point cloud
bool Pos2d(float x, float y, int *irow, int *jcol) const
Get row and col position
int Pos(float x, float y) const
Get row and col position
void SetCellSize(float cell_size)
Set the cell size
int GetNumRows() const
Get the number of rows
int GetNumCols() const
Get the number of cols
void GetSegments(base::PointFCloudConstPtr cloud, std::vector< std::vector< int > > *segments_indices, std::vector< int > *num_cells_per_segment)
Get the segments
void BuildGrid(base::PointFCloudConstPtr cloud)
Build grid based on point cloud
std::shared_ptr< const PointFCloud > PointFCloudConstPtr