LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::regionGraphColor< F > Class Template Reference

Functor to manipulate graphs of adjacent image regions, where the nodes of the graphs contain the mean value of the region represented by the node. More...

#include <ltiRegionGraphMeans.h>

Inheritance diagram for lti::regionGraphColor< F >:
Inheritance graph
[legend]
Collaboration diagram for lti::regionGraphColor< F >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef regionGraphFunctor
< adjacencyGraph
< regionGraphMeansNode
< trgbPixel< float > >, float,
int, F, symmetricEdgeTraits
< float > > > 
parent
typedef parent::graph_type graph_type
typedef parent::weight_type weight_type
typedef parent::edge_data_type edge_data_type
typedef parent::node_type node_type

Public Member Functions

 regionGraphColor ()
 regionGraphColor (const parameters &par)
 regionGraphColor (const regionGraphColor &other)
virtual ~regionGraphColor ()
virtual const char * getTypeName () const
virtual functorclone () const
bool apply (const matrix< int > &regions, const image &image, const int minLabel, graph_type &graph)
bool apply (const matrix< int > &regions, const channel &c1, const channel &c2, const channel &c3, const int minLabel, graph_type &graph)
bool generate (const matrix< int > &regions, const image &image, const int minLabel, graph_type &graph)
bool generate (const matrix< int > &regions, const channel &c1, const channel &c2, const channel &c3, const int minLabel, graph_type &graph)
bool apply (const weight_type &threshold, graph_type &graph, ivector &equivalences)
bool apply (graph_type &graph, ivector &equivalences)
bool apply (const weight_type &threshold, const int minLabel, graph_type &graph, ivector &equivalences)
bool apply (const int minLabel, graph_type &graph, ivector &equivalences)

Protected Member Functions

bool apply (const matrix< int > &regions, const int minLabel, graph_type &graph)
Reimplemented virtual methods



virtual bool checkInternalData (const point &regionsSize, const int maxRegionIndex) const
virtual bool considerForEdgeData (const point &p1, const point &p2, edge_data_type &edgeData)
virtual bool considerForNodeData (const point &p1, const int label, node_type &nodeData)

Protected Attributes

Internal data



channel c1
channel c2
channel c3

Detailed Description

template<class F>
class lti::regionGraphColor< F >

Functor to manipulate graphs of adjacent image regions, where the nodes of the graphs contain the mean value of the region represented by the node.

The template F is the distance computation functor required by the graph.


Member Typedef Documentation

template<class F>
typedef parent::graph_type lti::regionGraphColor< F >::graph_type
template<class F>
typedef parent::node_type lti::regionGraphColor< F >::node_type
template<class F>
typedef regionGraphFunctor< adjacencyGraph< regionGraphMeansNode< trgbPixel<float> >, float, int, F, symmetricEdgeTraits<float> > > lti::regionGraphColor< F >::parent

Parent class shortcut.

template<class F>
typedef parent::weight_type lti::regionGraphColor< F >::weight_type

Type used for the weights.

They should usually be float or double, but any type supported by the lti::vector can be used.

Reimplemented from lti::regionGraphFunctor< adjacencyGraph< regionGraphMeansNode< trgbPixel< float > >, float, int, F, symmetricEdgeTraits< float > > >.


Constructor & Destructor Documentation

template<class F>
lti::regionGraphColor< F >::regionGraphColor (  ) 

default constructor

template<class F>
lti::regionGraphColor< F >::regionGraphColor ( const parameters par  ) 

Construct a functor using the given parameters.

template<class F>
lti::regionGraphColor< F >::regionGraphColor ( const regionGraphColor< F > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class F>
virtual lti::regionGraphColor< F >::~regionGraphColor (  )  [virtual]

destructor


Member Function Documentation

template<class F>
bool lti::regionGraphColor< F >::apply ( const matrix< int > &  regions,
const int  minLabel,
graph_type graph 
) [protected]

Alias for generate().

template<class F>
bool lti::regionGraphColor< F >::apply ( const int  minLabel,
graph_type graph,
ivector equivalences 
)

Alias for merge() taking the threshold from the parameters.

template<class F>
bool lti::regionGraphColor< F >::apply ( const weight_type threshold,
const int  minLabel,
graph_type graph,
ivector equivalences 
)

Alias for merge().

template<class F>
bool lti::regionGraphColor< F >::apply ( graph_type graph,
ivector equivalences 
)

Alias for merge() taking the threshold from the parameters.

template<class F>
bool lti::regionGraphColor< F >::apply ( const weight_type threshold,
graph_type graph,
ivector equivalences 
)

Alias for merge().

template<class F>
bool lti::regionGraphColor< F >::apply ( const matrix< int > &  regions,
const channel c1,
const channel c2,
const channel c3,
const int  minLabel,
graph_type graph 
)

Generate a graph representation for the given image using the partition in regions and considering only the labels above or equal minLabel.

The nodes of the graph contain at the end enough information to compute the color mean values of each region.

template<class F>
bool lti::regionGraphColor< F >::apply ( const matrix< int > &  regions,
const image image,
const int  minLabel,
graph_type graph 
)

Generate a graph representation for the given image using the partition in regions and considering only the labels above or equal minLabel.

The nodes of the graph contain at the end enough information to compute the color mean values of each region.

template<class F>
virtual bool lti::regionGraphColor< F >::checkInternalData ( const point regionsSize,
const int  maxRegionIndex 
) const [protected, virtual]

Check if the internal data is compatible with the region mask.

The weights between region nodes can be computed from very different information sources. Usually, this information is coded in images and channels also extracted from the same image from which the regions map was computed. Therefore, it is important to provide a way to check if the internal data is compatible with the regions map, since both must be provided by the user at different times.

Parameters:
regionsSize size of the original image and region mask. This allows to check for channels and other data in the original image size format.
maxRegionIndex maximum region index employed. This is used to check if the vectors with information per region have the appropriate size.
Returns:
true if the internal data is compatible, false if there are problems.

Reimplemented from lti::regionGraphFunctor< adjacencyGraph< regionGraphMeansNode< trgbPixel< float > >, float, int, F, symmetricEdgeTraits< float > > >.

template<class F>
virtual functor* lti::regionGraphColor< F >::clone (  )  const [virtual]
template<class F>
virtual bool lti::regionGraphColor< F >::considerForEdgeData ( const point p1,
const point p2,
edge_data_type edgeData 
) [protected, virtual]

For each two neighbor pixels that belong to different regions, this method is called to compute the edge data value in a sequential manner.

It will be assumed, that the default constructor of the graph_type::edge_type::data_type "resets" correctly the data of the edge.

Parameters:
p1 coordinates of pixel belonging to one region
p2 coordinates of pixel belonging to another region
edgeData reference to data structure of the edge, where some values can be accumulated or set.
Returns:
true if successful, false otherwise.
template<class F>
virtual bool lti::regionGraphColor< F >::considerForNodeData ( const point p1,
const int  label,
node_type nodeData 
) [protected, virtual]

For each pixel in each region, this method is called once to compute statistics or other data for each node.

Parameters:
p1 coordinates of the current pixel
label identification label for the region to which the pixel belongs.
nodeData reference to the data structure of the node, where some values can be accumulated or set.
Returns:
true if successful, false otherwise.
template<class F>
bool lti::regionGraphColor< F >::generate ( const matrix< int > &  regions,
const channel c1,
const channel c2,
const channel c3,
const int  minLabel,
graph_type graph 
)

Generate a graph representation for the given image using the partition in regions and considering only the labels above or equal minLabel.

The nodes of the graph contain at the end enough information to compute the color mean values of each region.

This is an alias. You can also directly call the corresponding apply method.

template<class F>
bool lti::regionGraphColor< F >::generate ( const matrix< int > &  regions,
const image image,
const int  minLabel,
graph_type graph 
)

Generate a graph representation for the given image using the partition in regions and considering only the labels above or equal minLabel.

The nodes of the graph contain at the end enough information to compute the color mean values of each region.

This is an alias. You can also directly call the corresponding apply method.

template<class F>
virtual const char* lti::regionGraphColor< F >::getTypeName (  )  const [virtual]

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

Generated on Sat Apr 10 15:27:46 2010 for LTI-Lib by Doxygen 1.6.1