Set of functions for region growing.
More...
#include <vector>
#include "BitGrid.h"
|
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) |
|
Set of functions for region growing.
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
-
intermedPts | BitGrid in which to search for the active cells |
boundaries | Vector of the boundaries around which to search for the active cells |
indexes | Return parameter storing the indexes of the bands found |
minIntermedPts | Minimal 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
-
g | BitGrid for which to calculate the indexes |
trials | Return parameter storing the calculated indexes |
index | Index 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
-
g | BitGrid for which to calculate the indexes |
trials | Return parameter storing the calculated indexes |
index | Index 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
-
g | BitGrid in which to evaluate the cell index |
room | In-Out parameter where the index is added if the cell is active |
index | Index 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
-
g | BitGrid in which to evaluate the cell index |
room | In-Out parameter where the index is added if the cell is inactive |
index | Index 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
-
g | BitGrid in which to search for the segments |
segList | Return parameter storing the segments found |
boundaries | Return parameter storing the neighbouring cells of the segments found |
minArea | Minimal 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
-
g | BitGrid in which to search for the segments |
segList | Return parameter storing the segments found |
minArea | Minimal area of the calculated segment |
cellStep | Specifies 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
-
g | BitGrid in which to search for the region |
trialsVec | Vector of the vectors of the indexes around (+-1 cell) which to search for the region |
segList | Return parameter storing the segments found |