PointCloud2BIM Library  1.0
Library to facilitate the transpormation of point clouds into digital BIM representation
Functions
RegionGrowing.h File Reference

Set of functions for region growing. More...

#include <vector>
#include "BitGrid.h"
Include dependency graph for RegionGrowing.h:

Functions

bool getTrials (BitGrid &g, std::vector< int > &trials, int index)
 Calculates BitGrid cell indexes one cell around the given cell. More...
 
bool getTrials2 (BitGrid &g, std::vector< int > &trials, int index)
 Calculates BitGrid cell indexes two cells around the given cell. More...
 
bool grow (BitGrid &g, std::vector< int > &room, int index)
 Adds the cell index to the vector if the cell is active and deactivates the cell. More...
 
void regionGrowing (BitGrid &g, std::vector< BitGrid > &segList, double minArea, int cellStep=1)
 Search for the active segments with minimal area in the given grid. More...
 
void regionGrowingAround (BitGrid &g, std::vector< std::vector< int >> trialsVec, std::vector< BitGrid > &segList)
 Search for the region of active cells in the given grid around cells given by the trial vectors. More...
 
bool inverseGrow (BitGrid &g, std::vector< int > &segment, int index)
 Adds the cell index to the vector if the cell is inactive and activates the cell. More...
 
void inverseRegionGrowing (BitGrid &initialGrid, std::vector< BitGrid > &segList, std::vector< BitGrid > &boundaries, double minArea)
 Search for the inactive segments with minimal area in the given grid. More...
 
std::vector< bool > boundaryGrowing2 (BitGrid &intermedPts, std::vector< BitGrid > &boundaries, std::vector< std::vector< int >> &indexes, std::vector< double > minIntermedPts)
 Search for the active cells in the grid around (+-1 cell) given boundaries segments with minimal area in the given grid and evaluates if the minimal number of cells is found. More...
 
std::vector< bool > boundaryGrowing (BitGrid &intermedPts, std::vector< BitGrid > &boundaries, std::vector< std::vector< int >> &indexes, double minIntermedPts)
 

Detailed Description

Set of functions for region growing.

Function Documentation

std::vector<bool> boundaryGrowing2 ( BitGrid intermedPts,
std::vector< BitGrid > &  boundaries,
std::vector< std::vector< int >> &  indexes,
std::vector< double >  minIntermedPts 
)

Search for the active cells in the grid around (+-1 cell) given boundaries segments with minimal area in the given grid and evaluates if the minimal number of cells is found.

Parameters
intermedPtsBitGrid in which to search for the active cells
boundariesVector of the boundaries around which to search for the active cells
indexesReturn parameter storing the indexes of the bands found
minIntermedPtsMinimal ratio of the boundary cells over the found active cells
Returns
True if sufficient number of active cells is found
False if insufficient number of active cells is found
bool getTrials ( BitGrid g,
std::vector< int > &  trials,
int  index 
)

Calculates BitGrid cell indexes one cell around the given cell.

Parameters
gBitGrid for which to calculate the indexes
trialsReturn parameter storing the calculated indexes
indexIndex of the cell around which to search for the neighbours
Returns
True if neighbouring indexes are calculated
False for invalid initial index
bool getTrials2 ( BitGrid g,
std::vector< int > &  trials,
int  index 
)

Calculates BitGrid cell indexes two cells around the given cell.

Parameters
gBitGrid for which to calculate the indexes
trialsReturn parameter storing the calculated indexes
indexIndex of the cell around which to search for the neighbours
Returns
True if neighbouring indexes are calculated
False for invalid initial index
bool grow ( BitGrid g,
std::vector< int > &  room,
int  index 
)

Adds the cell index to the vector if the cell is active and deactivates the cell.

Parameters
gBitGrid in which to evaluate the cell index
roomIn-Out parameter where the index is added if the cell is active
indexIndex of the cell to be evaluated
Returns
True if index is added and the cell is deactivated in the initial grid
False for invalid initial index or inactive cell; no index added
bool inverseGrow ( BitGrid g,
std::vector< int > &  segment,
int  index 
)

Adds the cell index to the vector if the cell is inactive and activates the cell.

Parameters
gBitGrid in which to evaluate the cell index
roomIn-Out parameter where the index is added if the cell is inactive
indexIndex of the cell to be evaluated
Returns
True if index is added and the cell is activated in the initial grid
False for invalid initial index or active cell; no index added
void inverseRegionGrowing ( BitGrid initialGrid,
std::vector< BitGrid > &  segList,
std::vector< BitGrid > &  boundaries,
double  minArea 
)

Search for the inactive segments with minimal area in the given grid.

Parameters
gBitGrid in which to search for the segments
segListReturn parameter storing the segments found
boundariesReturn parameter storing the neighbouring cells of the segments found
minAreaMinimal area of the calculated segment
void regionGrowing ( BitGrid g,
std::vector< BitGrid > &  segList,
double  minArea,
int  cellStep = 1 
)

Search for the active segments with minimal area in the given grid.

Parameters
gBitGrid in which to search for the segments
segListReturn parameter storing the segments found
minAreaMinimal area of the calculated segment
cellStepSpecifies how many cells around to search for the active cells (default = 1)
void regionGrowingAround ( BitGrid g,
std::vector< std::vector< int >>  trialsVec,
std::vector< BitGrid > &  segList 
)

Search for the region of active cells in the given grid around cells given by the trial vectors.

Parameters
gBitGrid in which to search for the region
trialsVecVector of the vectors of the indexes around (+-1 cell) which to search for the region
segListReturn parameter storing the segments found