GClasses
|
The base class for region ajacency graphs. These are useful for breaking down an image into patches of similar color.
#include <GRegion.h>
Public Member Functions | |
GRegionAjacencyGraph () | |
virtual | ~GRegionAjacencyGraph () |
size_t | addRegion () |
Creates a new region and returns the region number. More... | |
void | ajacency (size_t nEdge, size_t *pRegion1, size_t *pRegion2) |
Returns the two regions that are ajacent. More... | |
size_t | ajacencyCount () |
Returns the number of ajacencies. More... | |
bool | areNeighbors (size_t nRegion1, size_t nRegion2) |
Returns true if the two specified regions are neighbors. More... | |
void | averageColor (size_t nRegion, float *pRed, float *pGreen, float *pBlue) |
Returns the average pixel color in the specified region. More... | |
void | makeNeighbors (size_t nRegion1, size_t nRegion2) |
Makes the two specified regions neighbors (if they aren't already neighbors) More... | |
size_t | regionCount () |
Returns the number of regions so far. More... | |
Protected Attributes | |
std::vector< GRegionEdge * > | m_neighbors |
GHeap * | m_pHeap |
std::vector< GRegion * > | m_regions |
GClasses::GRegionAjacencyGraph::GRegionAjacencyGraph | ( | ) |
|
virtual |
size_t GClasses::GRegionAjacencyGraph::addRegion | ( | ) |
Creates a new region and returns the region number.
void GClasses::GRegionAjacencyGraph::ajacency | ( | size_t | nEdge, |
size_t * | pRegion1, | ||
size_t * | pRegion2 | ||
) |
Returns the two regions that are ajacent.
size_t GClasses::GRegionAjacencyGraph::ajacencyCount | ( | ) |
Returns the number of ajacencies.
bool GClasses::GRegionAjacencyGraph::areNeighbors | ( | size_t | nRegion1, |
size_t | nRegion2 | ||
) |
Returns true if the two specified regions are neighbors.
void GClasses::GRegionAjacencyGraph::averageColor | ( | size_t | nRegion, |
float * | pRed, | ||
float * | pGreen, | ||
float * | pBlue | ||
) |
Returns the average pixel color in the specified region.
void GClasses::GRegionAjacencyGraph::makeNeighbors | ( | size_t | nRegion1, |
size_t | nRegion2 | ||
) |
Makes the two specified regions neighbors (if they aren't already neighbors)
size_t GClasses::GRegionAjacencyGraph::regionCount | ( | ) |
Returns the number of regions so far.
|
protected |
|
protected |
|
protected |