bwi_mapper::TopologicalMapper Class Reference

Computes the 2 variants of the topological graph using the voronoi approximator. More...

`#include <topological_mapper.h>`

Inheritance diagram for bwi_mapper::TopologicalMapper:

## Public Member Functions | |

void | computeTopologicalGraph (double threshold, double critical_epsilon, double merge_threshold) |

computes the topological graph given the threshold for VoronoiApproximator and a parameter controlling the size of critical regions. | |

void | drawConnectedComponents (cv::Mat &image, uint32_t orig_x=0, uint32_t orig_y=0) |

draws colored regions corresponding to each critical region onto a given image starting at (orig_x, orig_y) | |

void | drawCriticalPoints (cv::Mat &image, uint32_t orig_x=0, uint32_t orig_y=0) |

draws critical points and lines onto a given image starting at (orig_x, orig_y) | |

void | drawOutput (cv::Mat &image) |

Draws the base map, voronoi points and critical points, lines and regions on to image. Should be only used for testing the output for Topological Mapper. | |

void | drawPointGraph (cv::Mat &image, uint32_t orig_x=0, uint32_t orig_y=0) |

void | drawRegionGraph (cv::Mat &image, uint32_t orig_x=0, uint32_t orig_y=0) |

void | printCriticalPoints () |

Prints information about all the critical points to screen. Used for testing the output of Topological Mapper. | |

void | saveOutput () |

TopologicalMapper (const std::string &fname) | |

Constructor. Initializes map_resp_ from given file. Only used to call the base class constructor. | |

void | writePointGraphToFile (std::string &filename) |

void | writeRegionGraphToFile (std::string &filename) |

## Protected Member Functions | |

void | computeCriticalRegions (double critical_epsilon) |

Compute critical regions once the voronoi points have been calculated. | |

void | computeGraph (double merge_threshold) |

void | drawCriticalLines (cv::Mat &image, uint32_t orig_x=0, uint32_t orig_y=0, bool draw_idx=false, bool visualization_image=false) |

Draws critical lines (4-connected) onto given image starting at (orig_x, orig_y) | |

## Protected Attributes | |

std::vector< cv::Vec3b > | component_colors_ |

a randomized color mapping selected for each component idx | |

cv::Mat | component_image_ |

image containing just the obstacles and critical lines. used for finding connected components | |

std::vector< int32_t > | component_map_ |

a vector the size of the map that contains the index of the component to which that pixel belongs (0 if background) | |

std::vector< VoronoiPoint > | critical_points_ |

stores the array of computed Critical Points | |

size_t | num_components_ |

the totatl number of components found + 1 for background | |

Graph | pass_1_graph_ |

Graph | pass_2_graph_ |

Graph | pass_3_graph_ |

Graph | pass_4_graph_ |

Graph | point_graph_ |

Graph | region_graph_ |

Computes the 2 variants of the topological graph using the voronoi approximator.

Definition at line 52 of file topological_mapper.h.

bwi_mapper::TopologicalMapper::TopologicalMapper | ( | const std::string & | fname | ) | ` [inline]` |

Constructor. Initializes map_resp_ from given file. Only used to call the base class constructor.

**Parameters:**-
fname absolute or relative system file location for the YAML file

Definition at line 62 of file topological_mapper.h.

void bwi_mapper::TopologicalMapper::computeCriticalRegions | ( | double | critical_epsilon | ) | ` [protected]` |

Compute critical regions once the voronoi points have been calculated.

**Parameters:**-
critical_epsilon see TopologicalMapper() for more details

Definition at line 206 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::computeGraph | ( | double | merge_threshold | ) | ` [protected]` |

Definition at line 333 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::computeTopologicalGraph | ( | double | threshold, |

double | critical_epsilon, |
||

double | merge_threshold |
||

) |

computes the topological graph given the threshold for VoronoiApproximator and a parameter controlling the size of critical regions.

**Parameters:**-
threshold same as threhold in VoronoiApproximator() critical_epsilon (meters) no 2 critical points can be closer than this distance. merge_threshold graph vertices having a smaller area than this should be merged together(meter^2) threshold same as threhold in VoronoiApproximator() critical_epsilon (meters) no 2 critical points can be closer than this distance. merge_threshold graph vertices having a smaller area than this should be merged together (meter^2)

Definition at line 59 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::drawConnectedComponents | ( | cv::Mat & | image, |

uint32_t | orig_x = `0` , |
||

uint32_t | orig_y = `0` |
||

) |

draws colored regions corresponding to each critical region onto a given image starting at (orig_x, orig_y)

Definition at line 90 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::drawCriticalLines | ( | cv::Mat & | image, |

uint32_t | orig_x = `0` , |
||

uint32_t | orig_y = `0` , |
||

bool | draw_idx = `false` , |
||

bool | visualization_image = `false` |
||

) | ` [protected]` |

Draws critical lines (4-connected) onto given image starting at (orig_x, orig_y)

Definition at line 1007 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::drawCriticalPoints | ( | cv::Mat & | image, |

uint32_t | orig_x = `0` , |
||

uint32_t | orig_y = `0` |
||

) |

draws critical points and lines onto a given image starting at (orig_x, orig_y)

Definition at line 74 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::drawOutput | ( | cv::Mat & | image | ) |

Draws the base map, voronoi points and critical points, lines and regions on to image. Should be only used for testing the output for Topological Mapper.

**Parameters:**-
image OpenCV image we are drawing output on

Reimplemented from bwi_mapper::VoronoiApproximator.

Definition at line 161 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::drawPointGraph | ( | cv::Mat & | image, |

uint32_t | orig_x = `0` , |
||

uint32_t | orig_y = `0` |
||

) |

Definition at line 125 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::drawRegionGraph | ( | cv::Mat & | image, |

uint32_t | orig_x = `0` , |
||

uint32_t | orig_y = `0` |
||

) |

Definition at line 120 of file topological_mapper.cpp.

Prints information about all the critical points to screen. Used for testing the output of Topological Mapper.

Definition at line 142 of file topological_mapper.cpp.

Definition at line 172 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::writePointGraphToFile | ( | std::string & | filename | ) |

Definition at line 134 of file topological_mapper.cpp.

void bwi_mapper::TopologicalMapper::writeRegionGraphToFile | ( | std::string & | filename | ) |

Definition at line 130 of file topological_mapper.cpp.

std::vector<cv::Vec3b> bwi_mapper::TopologicalMapper::component_colors_` [protected]` |

a randomized color mapping selected for each component idx

Definition at line 146 of file topological_mapper.h.

cv::Mat bwi_mapper::TopologicalMapper::component_image_` [protected]` |

image containing just the obstacles and critical lines. used for finding connected components

Definition at line 139 of file topological_mapper.h.

std::vector<int32_t> bwi_mapper::TopologicalMapper::component_map_` [protected]` |

a vector the size of the map that contains the index of the component to which that pixel belongs (0 if background)

Definition at line 143 of file topological_mapper.h.

std::vector<VoronoiPoint> bwi_mapper::TopologicalMapper::critical_points_` [protected]` |

stores the array of computed Critical Points

Definition at line 135 of file topological_mapper.h.

size_t bwi_mapper::TopologicalMapper::num_components_` [protected]` |

the totatl number of components found + 1 for background

Definition at line 149 of file topological_mapper.h.

Graph bwi_mapper::TopologicalMapper::pass_1_graph_` [protected]` |

Definition at line 152 of file topological_mapper.h.

Graph bwi_mapper::TopologicalMapper::pass_2_graph_` [protected]` |

Definition at line 153 of file topological_mapper.h.

Graph bwi_mapper::TopologicalMapper::pass_3_graph_` [protected]` |

Definition at line 154 of file topological_mapper.h.

Graph bwi_mapper::TopologicalMapper::pass_4_graph_` [protected]` |

Definition at line 155 of file topological_mapper.h.

Graph bwi_mapper::TopologicalMapper::point_graph_` [protected]` |

Definition at line 156 of file topological_mapper.h.

Graph bwi_mapper::TopologicalMapper::region_graph_` [protected]` |

Definition at line 151 of file topological_mapper.h.

The documentation for this class was generated from the following files: