39 std::vector<Segment>
VoronoiGraphGenerator::calcSegments(cv::Mat &_map, cv::Mat &_distField, cv::Mat &_voronoiPath,
float* potential,
float _path_length,
float _optimizeCrossingPixels,
float _optimizeEndSegmentsPixel)
42 exp.
Initialize(_map, _distField, _voronoiPath);
43 std::vector<std::vector<Eigen::Vector2d>> points = exp.
calcEndpoints(potential);
44 std::vector<std::pair<Eigen::Vector2d, Eigen::Vector2d>> segments;
50 exp.
Initialize(_map, _distField, _voronoiPath);
51 std::fill(potential, potential + nx * ny, -1);
53 std::vector<Segment> segs = exp.
getGraph(points, potential, _path_length, _optimizeCrossingPixels, _optimizeEndSegmentsPixel);
55 for(uint32_t i = 0; i < segs.size(); i++)
57 std::vector<uint32_t> predecessors = segs[i].getPredecessors();
58 std::vector<uint32_t> successors = segs[i].getSuccessors();
62 return std::vector<Segment>(segs);
void Initialize(cv::Mat &_map, cv::Mat &_distField, cv::Mat &_voronoiPath)
initializes the expander by setting the voronoi path map and distancefield
std::vector< std::vector< Eigen::Vector2d > > calcEndpoints(float *_potential)
looks for crossings and saves all segment endpoints of it
std::vector< Segment > getGraph(const std::vector< std::vector< Eigen::Vector2d >> &_endPoints, float *_potential, const float _min_length, float _optimizePixelsCrossing, const float _optimizePixelsEndSegments)
returns a list of segments, which represent the found search graph
std::vector< Segment > calcSegments(cv::Mat &_map, cv::Mat &_distField, cv::Mat &_voronoiPath, float *potential, float _path_length, float _optimizeCrossingPixels, float _optimizeEndSegmentsPixel)
calculates the search graph