76 using Traits = boost::adjacency_list_traits< boost::vecS, boost::vecS, boost::directedS >;
78 using mGraph = boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS,
79 boost::property< boost::vertex_name_t, std::string,
80 boost::property< boost::vertex_index_t, long,
81 boost::property< boost::vertex_color_t, boost::default_color_type,
82 boost::property< boost::vertex_distance_t, long,
83 boost::property< boost::vertex_predecessor_t, Traits::edge_descriptor > > > > >,
84 boost::property< boost::edge_capacity_t, double,
85 boost::property< boost::edge_residual_capacity_t, double,
86 boost::property< boost::edge_reverse_t, Traits::edge_descriptor > > > >;
88 using CapacityMap = boost::property_map< mGraph, boost::edge_capacity_t >::type;
90 using ReverseEdgeMap = boost::property_map< mGraph, boost::edge_reverse_t>::type;
102 using IndexMap = boost::property_map< mGraph, boost::vertex_index_t >::type;
131 setSigma (
double sigma);
141 setRadius (
double radius);
145 getSourceWeight ()
const;
151 setSourceWeight (
double weight);
157 getSearchMethod ()
const;
168 getNumberOfNeighbours ()
const;
174 setNumberOfNeighbours (
unsigned int neighbour_number);
177 std::vector<PointT, Eigen::aligned_allocator<PointT> >
178 getForegroundPoints ()
const;
187 std::vector<PointT, Eigen::aligned_allocator<PointT> >
188 getBackgroundPoints ()
const;
202 extract (std::vector <pcl::PointIndices>& clusters);
229 calculateUnaryPotential (
int point,
double& source_weight,
double& sink_weight)
const;
237 addEdge (
int source,
int target,
double weight);
245 calculateBinaryPotential (
int source,
int target)
const;
249 recalculateUnaryPotentials ();
253 recalculateBinaryPotentials ();
264 double inverse_sigma_{16.0};
267 bool binary_potentials_are_valid_{
false};
270 double epsilon_{0.0001};
273 double radius_{16.0};
276 bool unary_potentials_are_valid_{
false};
279 double source_weight_{0.8};
285 unsigned int number_of_neighbours_{14};
288 bool graph_is_valid_{
false};
291 std::vector<PointT, Eigen::aligned_allocator<PointT> > foreground_points_{};
294 std::vector<PointT, Eigen::aligned_allocator<PointT> > background_points_{};
297 std::vector <pcl::PointIndices> clusters_{};
303 std::shared_ptr<CapacityMap> capacity_{
nullptr};
306 std::shared_ptr<ReverseEdgeMap> reverse_edges_{
nullptr};
309 std::vector< VertexDescriptor > vertices_{};
312 std::vector< std::set<int> > edge_marker_{};
321 double max_flow_{0.0};
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::property< boost::vertex_name_t, std::string, boost::property< boost::vertex_index_t, long, boost::property< boost::vertex_color_t, boost::default_color_type, boost::property< boost::vertex_distance_t, long, boost::property< boost::vertex_predecessor_t, Traits::edge_descriptor > > > > >, boost::property< boost::edge_capacity_t, double, boost::property< boost::edge_residual_capacity_t, double, boost::property< boost::edge_reverse_t, Traits::edge_descriptor > > > > mGraph