pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap > Class Template Reference
Module segmentation

Multilabel graph segmentation using random walks. More...

`#include <pcl/segmentation/impl/random_walker.hpp>`

## Public Types

typedef boost::property_traits< VertexColorMap >::value_type | Color
typedef boost::property_traits< EdgeWeightMap >::value_type | Weight
typedef boost::graph_traits< Graph > | GraphTraits
typedef GraphTraits::edge_descriptor | EdgeDescriptor
typedef GraphTraits::vertex_descriptor | VertexDescriptor
typedef GraphTraits::edge_iterator | EdgeIterator
typedef GraphTraits::out_edge_iterator | OutEdgeIterator
typedef GraphTraits::vertex_iterator | VertexIterator
typedef boost::property_map< Graph, boost::vertex_index_t >::type | VertexIndexMap
typedef boost::iterator_property_map< typename std::vector< Weight >::iterator, VertexIndexMap > | VertexDegreeMap
typedef Eigen::SparseMatrix< Weight > | SparseMatrix
typedef Eigen::Matrix< Weight, Eigen::Dynamic, Eigen::Dynamic > | Matrix
typedef Eigen::Matrix< Weight, Eigen::Dynamic, 1 > | Vector

## Public Member Functions

| RandomWalker (Graph &g, EdgeWeightMap weights, VertexColorMap colors)
bool | segment ()
void | computeVertexDegrees ()
void | buildLinearSystem ()
bool | solveLinearSystem ()
void | assignColors ()
void | getPotentials (Matrix &potentials, std::map< Color, size_t > &color_to_column_map)

## Static Public Member Functions

template<typename T >
static size_t | insertInBimap (boost::bimap< size_t, T > &bimap, T value)

## Public Attributes

Graph & | g_
EdgeWeightMap | weight_map_
VertexColorMap | color_map_
VertexIndexMap | index_map_
std::vector< VertexDescriptor > | seeds_
std::set< Color > | colors_
std::vector< Weight > | degree_storage_
VertexDegreeMap | degree_map_
SparseMatrix | L
SparseMatrix | B
Matrix | X
boost::bimap< size_t, VertexDescriptor > | L_vertex_bimap
boost::bimap< size_t, Color > | B_color_bimap

## Detailed Description

### template<class Graph, class EdgeWeightMap, class VertexColorMap>
class pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >

Multilabel graph segmentation using random walks.

This is an implementation of the algorithm described in "Random Walks for Image Segmentation" by Leo Grady.

See the documentation of the randomWalker() function for details.

Author
  Sergey Alexandrov

Definition at line 65 of file random_walker.hpp.

## Member Typedef Documentation

## Color

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef boost::property_traits<VertexColorMap>::value_type pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::Color

Definition at line 70 of file random_walker.hpp.

## EdgeDescriptor

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef GraphTraits::edge_descriptor pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::EdgeDescriptor

Definition at line 73 of file random_walker.hpp.

## EdgeIterator

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef GraphTraits::edge_iterator pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::EdgeIterator

Definition at line 75 of file random_walker.hpp.

## GraphTraits

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef boost::graph_traits<Graph> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::GraphTraits

Definition at line 72 of file random_walker.hpp.

## Matrix

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef Eigen::Matrix<Weight, Eigen::Dynamic, Eigen::Dynamic> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::Matrix

Definition at line 81 of file random_walker.hpp.

## OutEdgeIterator

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef GraphTraits::out_edge_iterator pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::OutEdgeIterator

Definition at line 76 of file random_walker.hpp.

## SparseMatrix

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef Eigen::SparseMatrix<Weight> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::SparseMatrix

Definition at line 80 of file random_walker.hpp.

## Vector

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef Eigen::Matrix<Weight, Eigen::Dynamic, 1> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::Vector

Definition at line 82 of file random_walker.hpp.

## VertexDegreeMap

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef boost::iterator_property_map<typename std::vector<Weight>::iterator, VertexIndexMap> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::VertexDegreeMap

Definition at line 79 of file random_walker.hpp.

## VertexDescriptor

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef GraphTraits::vertex_descriptor pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::VertexDescriptor

Definition at line 74 of file random_walker.hpp.

## VertexIndexMap

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef boost::property_map<Graph, boost::vertex_index_t>::type pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::VertexIndexMap

Definition at line 78 of file random_walker.hpp.

## VertexIterator

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef GraphTraits::vertex_iterator pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::VertexIterator

Definition at line 77 of file random_walker.hpp.

## Weight

template<class Graph , class EdgeWeightMap , class VertexColorMap >

typedef boost::property_traits<EdgeWeightMap>::value_type pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::Weight

Definition at line 71 of file random_walker.hpp.

## Constructor & Destructor Documentation

## RandomWalker()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::RandomWalker | ( | Graph & | g,
|  | EdgeWeightMap | weights,
|  | VertexColorMap | colors
| ) |  |

inline

Definition at line 84 of file random_walker.hpp.

## Member Function Documentation

## assignColors()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

void pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::assignColors | ( |  | ) |

inline

Definition at line 209 of file random_walker.hpp.

References pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B_color_bimap, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::color_map_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L_vertex_bimap, and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::X.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::solveLinearSystem().

## buildLinearSystem()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

void pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem | ( |  | ) |

inline

Definition at line 116 of file random_walker.hpp.

References pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B_color_bimap, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::color_map_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::colors_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::degree_map_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::g_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::insertInBimap(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L_vertex_bimap, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::seeds_, and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::weight_map_.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::segment().

## computeVertexDegrees()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

void pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::computeVertexDegrees | ( |  | ) |

inline

Definition at line 103 of file random_walker.hpp.

References pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::degree_map_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::g_, and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::weight_map_.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::segment().

## getPotentials()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

void pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials | ( | Matrix & | potentials,
|  | std::map< Color, size_t > & | color_to_column_map
| ) |  |

inline

Definition at line 224 of file random_walker.hpp.

References pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B_color_bimap, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::color_map_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::colors_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::g_, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::insertInBimap(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L_vertex_bimap, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::seeds_, and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::X.

## insertInBimap()

template<class Graph , class EdgeWeightMap , class VertexColorMap >
template<typename T >

static size_t pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::insertInBimap | ( | boost::bimap< size_t, T > & | bimap,
|  | T | value
| ) |  |

inline static

Definition at line 245 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## segment()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

bool pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::segment | ( |  | ) |

inline

Definition at line 95 of file random_walker.hpp.

References pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::computeVertexDegrees(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::solveLinearSystem().

## solveLinearSystem()

template<class Graph , class EdgeWeightMap , class VertexColorMap >

bool pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::solveLinearSystem | ( |  | ) |

inline

Definition at line 185 of file random_walker.hpp.

References pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::assignColors(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B, pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L, and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::X.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::segment().

## Member Data Documentation

## B

template<class Graph , class EdgeWeightMap , class VertexColorMap >

SparseMatrix pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B

Definition at line 270 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::solveLinearSystem().

## B_color_bimap

template<class Graph , class EdgeWeightMap , class VertexColorMap >

boost::bimap<size_t, Color> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::B_color_bimap

Definition at line 276 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::assignColors(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## color_map_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

VertexColorMap pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::color_map_

Definition at line 261 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::assignColors(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## colors_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

std::set<Color> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::colors_

Definition at line 265 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## degree_map_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

VertexDegreeMap pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::degree_map_

Definition at line 268 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::computeVertexDegrees().

## degree_storage_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

std::vector<Weight> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::degree_storage_

Definition at line 267 of file random_walker.hpp.

## g_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

Graph& pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::g_

Definition at line 259 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::computeVertexDegrees(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## index_map_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

VertexIndexMap pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::index_map_

Definition at line 262 of file random_walker.hpp.

## L

template<class Graph , class EdgeWeightMap , class VertexColorMap >

SparseMatrix pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L

Definition at line 269 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::solveLinearSystem().

## L_vertex_bimap

template<class Graph , class EdgeWeightMap , class VertexColorMap >

boost::bimap<size_t, VertexDescriptor> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::L_vertex_bimap

Definition at line 274 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::assignColors(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## seeds_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

std::vector<VertexDescriptor> pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::seeds_

Definition at line 264 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials().

## weight_map_

template<class Graph , class EdgeWeightMap , class VertexColorMap >

EdgeWeightMap pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::weight_map_

Definition at line 260 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::buildLinearSystem(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::computeVertexDegrees().

## X

template<class Graph , class EdgeWeightMap , class VertexColorMap >

Matrix pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::X

Definition at line 271 of file random_walker.hpp.

Referenced by pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::assignColors(), pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::getPotentials(), and pcl::segmentation::detail::RandomWalker< Graph, EdgeWeightMap, VertexColorMap >::solveLinearSystem().

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

- /build/pcl-OilVEB/pcl-1.8.1+dfsg1/segmentation/include/pcl/segmentation/impl/random_walker.hpp