last update 20 Sep 2009 |
#include <cvrLabelAdjacencyMap.h>
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 |
labelAdjacencyMap & | copy (const labelAdjacencyMap &other) |
labelAdjacencyMap & | operator= (const labelAdjacencyMap &other) |
virtual labelAdjacencyMap * | clone () const |
virtual labelAdjacencyMap * | newInstance () const |
const parameters & | getParameters () 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 |
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
cvr::labelAdjacencyMap::labelAdjacencyMap | ( | ) |
default constructor
cvr::labelAdjacencyMap::labelAdjacencyMap | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
cvr::labelAdjacencyMap::labelAdjacencyMap | ( | const labelAdjacencyMap & | other | ) |
virtual cvr::labelAdjacencyMap::~labelAdjacencyMap | ( | ) | [virtual] |
destructor
Compute the adjacency graph of labels for the given labeled mask.
Compute the adjacency graph of labels for the given labeled mask.
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.
src | matrix<int> with the source data. | |
dest | image where the result will be left. |
virtual labelAdjacencyMap* cvr::labelAdjacencyMap::clone | ( | ) | const [virtual] |
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.
Compute a transformation Look-up Table that maps the id of a label to the corresponding entry in the parameters palette.
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 | ) |
const parameters& cvr::labelAdjacencyMap::getParameters | ( | ) | const |
virtual const std::string& cvr::labelAdjacencyMap::name | ( | ) | const [virtual] |
virtual labelAdjacencyMap* cvr::labelAdjacencyMap::newInstance | ( | ) | const [virtual] |
labelAdjacencyMap& cvr::labelAdjacencyMap::operator= | ( | const labelAdjacencyMap & | other | ) |
const palette cvr::labelAdjacencyMap::defaultPalette [static] |
Default color palette.
{cvr::Black, cvr::Red, cvr::Green, cvr::Blue, cvr::Yellow, cvr::Cyan, cvr::Magenta, cvr::DarkOrange, cvr::Lemon, cvr::Violet}