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

Holds image, segments and other housekeeping information for an image. More...

Public Member Functions

 drwnNNGraphImageData (const string &name)
 construct from basename
 
 drwnNNGraphImageData (const cv::Mat &img, const drwnSuperpixelContainer &segments)
 construct from image (no labels or name)
 
const string & name () const
 return the name of the image
 
const cv::Mat & image () const
 return the image
 
const MatrixXi & labels () const
 return the labels
 
const drwnSuperpixelContainersegments () const
 return the superpixel container
 
drwnSuperpixelContainersegments ()
 return the superpixel container
 
size_t numSegments () const
 return the number of superpixels
 
size_t height () const
 return image height
 
size_t width () const
 return image width
 
unsigned colour (unsigned segId) const
 return average colour (as 24-bit unsigned) for a given superpixel
 
cv::Scalar rgbColour (unsigned segId) const
 return average colour (as 8-bit rgb) for a given superpixle
 
cv::Point centroid (unsigned segId) const
 return centroid for a given superpixel
 
void setLabels (const MatrixXi &labels)
 set new labels for this image
 
vector< VectorXd > getSegmentLabelMarginals (int numLabels=-1) const
 calculate segment label distributions
 

Static Public Attributes

static string imgDir
 directory to prepend to instance basename for images
 
static string imgExt
 extension to append to instance basename for images
 
static string lblDir
 directory to prepend to instance basename for labels
 
static string lblExt
 extension to append to instance basename for labels
 
static string segDir
 directory to prepend to instance basename for segments
 
static string segExt
 extension to append to instance basename for segments
 

Protected Member Functions

void cacheSegmentData ()
 cache segments and neighbourhood
 

Protected Attributes

string _name
 basename for this image
 
cv::Mat _img
 the RGB image
 
MatrixXi _labels
 pixel labels
 
drwnSuperpixelContainer _segments
 superpixel maps
 
vector< unsigned > _colours
 cached 24-bit colour for visualization
 
vector< cv::Point > _centroids
 superpixel centroids for visualization
 

Detailed Description

Holds image, segments and other housekeeping information for an image.


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