Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
drwnNNGraph Class Reference

Class for maintaining a nearest neighbour graph over superpixel images. Search moves are implemented by templated functions in the drwnNNGraphMoves namespace. More...

Public Member Functions

 drwnNNGraph ()
 default constructor
 
virtual ~drwnNNGraph ()
 destructor
 
bool write (const char *filestem) const
 write to persistent storage
 
bool read (const char *filestem)
 read from persistent storage
 
void clear ()
 clear the entire graph
 
void reserve (size_t n)
 reserve a given number of images (reduced memory allocation)
 
drwnNNGraph clone (bool bWithFeatures=true) const
 clone the graph (with or without node features)
 
size_t numImages () const
 number of images in the graph
 
size_t numNodes () const
 number of nodes (superpixels) in the graph
 
size_t numEdges () const
 number of edges in the graph
 
size_t numNodesWithLabel (int label) const
 count the number of nodes (superpixels) with a given label
 
int findImage (const string &baseName) const
 returns the index for an image or -1 if not in graph
 
int appendImage (const string &baseName, unsigned numNodes=0)
 add a single image and return its index (do not use while the graph is being learned)
 
int appendImage (const drwnNNGraphImage &image)
 add a drwnNNGraphImage and return its index (do not use while the graph is being learned)
 
int removeImage (unsigned imgIndx)
 delete an image from the graph (do not use while the graph is being learned) and returns the number of edges removed which terminated at nodes within the deleted image
 
pair< double, double > energy () const
 sum of all edge weights (first) and best edge weights (second)
 
bool inSameEqvClass (unsigned imgIndxA, unsigned imgIndxB) const
 return true if two images are in the same equivalence class
 
const drwnNNGraphImageoperator[] (size_t indx) const
 returns const reference to an image (and its nodes)
 
drwnNNGraphImageoperator[] (size_t indx)
 returns reference an image (and its nodes)
 
const drwnNNGraphImageoperator[] (const string &baseName) const
 returns const reference to an image (and its nodes)
 
drwnNNGraphImageoperator[] (const string &baseName)
 returns reference an image (and its nodes)
 
const drwnNNGraphNodeoperator[] (const drwnNNGraphNodeIndex &indx) const
 returns const reference to a node
 
drwnNNGraphNodeoperator[] (const drwnNNGraphNodeIndex &indx)
 returns reference a node
 

Static Public Attributes

static unsigned int K = 1
 default number of matches per node
 
static bool DO_PROPAGATE = true
 execute propagate move
 
static bool DO_LOCAL = true
 execute local move
 
static bool DO_SEARCH = true
 execute random search move
 
static int DO_RANDPROJ = 100
 execute random projection move to given horizon
 
static bool DO_ENRICHMENT = true
 execute enrichment moves
 
static int DO_EXHAUSTIVE = 1
 execute n exhaustive search moves per iteration
 

Protected Attributes

vector< drwnNNGraphImage_images
 graph images containing nodes
 
map< string, unsigned > _names
 image name lookup
 

Detailed Description

Class for maintaining a nearest neighbour graph over superpixel images. Search moves are implemented by templated functions in the drwnNNGraphMoves namespace.


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