CVR-Lib last update 20 Sep 2009

cvr::labelAdjacencyMap Class Reference
[Visualization Tools]

Visualize a label mask in a color image. More...

#include <cvrLabelAdjacencyMap.h>

Inheritance diagram for cvr::labelAdjacencyMap:

Inheritance graph
[legend]
Collaboration diagram for cvr::labelAdjacencyMap:

Collaboration graph
[legend]

List of all members.

Classes

class  graph
 This auxiliary class stores a simple adjacency graph between labels, in which only the edges between the nodes contain data. More...
class  parameters
 The parameters for the class labelAdjacencyMap. More...

Public Member Functions

 labelAdjacencyMap ()
 labelAdjacencyMap (const parameters &par)
 labelAdjacencyMap (const labelAdjacencyMap &other)
virtual ~labelAdjacencyMap ()
virtual const std::string & name () const
bool apply (const matrix< ubyte > &src, image &dest) const
bool apply (const matrix< int > &src, image &dest) const
labelAdjacencyMapcopy (const labelAdjacencyMap &other)
labelAdjacencyMapoperator= (const labelAdjacencyMap &other)
virtual labelAdjacencyMapclone () const
virtual labelAdjacencyMapnewInstance () const
const parametersgetParameters () const
bool adjacency (const matrix< ubyte > &mask, graph &dest) const
bool adjacency (const matrix< int > &mask, graph &dest) const
bool computePalette (const graph &adj, palette &pal) const
bool computePalette (const graph &adj, ivector &pal) const

Static Public Attributes

static const palette defaultPalette

Protected Member Functions

bool computeMinPalette (const graph &adj, palette &pal) const
bool computeMinPalette (const graph &adj, ivector &pal) const
bool computeMaxPalette (const graph &adj, palette &pal) const
bool computeMaxPalette (const graph &adj, ivector &pal) const


Detailed Description

Visualize a label mask in a color image.

This class draws a color image using as input a labeled mask. The colors used for each label are chosen based on the adjacency, so that two neighbor labels never get the same color.

You can choose the kind of neighborhood used (4 or 8 neighborhood) and the number of colors you want to use.

Other classes, like the viewers, may require partial computations, like the adjacency graph, which is a kind of


Constructor & Destructor Documentation

cvr::labelAdjacencyMap::labelAdjacencyMap (  ) 

default constructor

cvr::labelAdjacencyMap::labelAdjacencyMap ( const parameters par  ) 

Construct a functor using the given parameters.

cvr::labelAdjacencyMap::labelAdjacencyMap ( const labelAdjacencyMap other  ) 

copy constructor

Parameters:
other the object to be copied

virtual cvr::labelAdjacencyMap::~labelAdjacencyMap (  )  [virtual]

destructor


Member Function Documentation

bool cvr::labelAdjacencyMap::adjacency ( const matrix< int > &  mask,
graph dest 
) const

Compute the adjacency graph of labels for the given labeled mask.

bool cvr::labelAdjacencyMap::adjacency ( const matrix< ubyte > &  mask,
graph dest 
) const

Compute the adjacency graph of labels for the given labeled mask.

bool cvr::labelAdjacencyMap::apply ( const matrix< int > &  src,
image dest 
) const

Compute the adjacency map of the given 32-bit labeled mask.

The input data cannot have label ids less than zero and internally a look-up table of the size equal to the maximum value in the input data plus one will be created. So, it will be assumed that the input mask has all its labels with low positive ids.

Parameters:
src matrix<int> with the source data.
dest image where the result will be left.
Returns:
true if apply successful or false otherwise.

bool cvr::labelAdjacencyMap::apply ( const matrix< ubyte > &  src,
image dest 
) const

Compute the adjacency map of the given 8-bit labeled mask.

Parameters:
src channel8 with the source data.
dest image where the result will be left.
Returns:
true if apply successful or false otherwise.

virtual labelAdjacencyMap* cvr::labelAdjacencyMap::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements cvr::functor.

bool cvr::labelAdjacencyMap::computeMaxPalette ( const graph adj,
ivector pal 
) const [protected]

Compute a transformation Look-up Table that maps the id of a label to the corresponding entry in the parameters palette.

The maximum number of colors will be used.

bool cvr::labelAdjacencyMap::computeMaxPalette ( const graph adj,
palette pal 
) const [protected]

Compute a "palette" from the graph, which can be accessed with the id of a label to get the corresponding color in the map.

The maximum number of colors will be used.

bool cvr::labelAdjacencyMap::computeMinPalette ( const graph adj,
ivector pal 
) const [protected]

Compute a transformation Look-up Table that maps the id of a label to the corresponding entry in the parameters palette.

The minimum number of colors will be used.

bool cvr::labelAdjacencyMap::computeMinPalette ( const graph adj,
palette pal 
) const [protected]

Compute a "palette" from the graph, which can be accessed with the id of a label to get the corresponding color in the map.

The minimum number of colors will be used.

bool cvr::labelAdjacencyMap::computePalette ( const graph adj,
ivector pal 
) const

Compute a transformation Look-up Table that maps the id of a label to the corresponding entry in the parameters palette.

bool cvr::labelAdjacencyMap::computePalette ( const graph adj,
palette pal 
) const

Compute a transformation Look-up Table that maps the id of a label to the corresponding entry in the parameters palette.

labelAdjacencyMap& cvr::labelAdjacencyMap::copy ( const labelAdjacencyMap other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

const parameters& cvr::labelAdjacencyMap::getParameters (  )  const

returns used parameters

Reimplemented from cvr::parametersManager.

virtual const std::string& cvr::labelAdjacencyMap::name (  )  const [virtual]

returns the name of this type ("labelAdjacencyMap")

Implements cvr::functor.

virtual labelAdjacencyMap* cvr::labelAdjacencyMap::newInstance (  )  const [virtual]

returns a pointer to a new instance of this functor.

Implements cvr::functor.

labelAdjacencyMap& cvr::labelAdjacencyMap::operator= ( const labelAdjacencyMap other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object


Member Data Documentation


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

Generated on Sun Sep 20 22:08:48 2009 for CVR-Lib by Doxygen 1.5.8