w2img::Cluster< T > Class Template Reference

List of all members.

Detailed Description

template<class T>
class w2img::Cluster< T >

Defines a cluster based on a statistic.

The template class should suppor the following methods:

     float get_val(size_t index) const; 
     void set_val(size_t index, float val);
     size_t NumFeatures;
     static void compute( const LImage<int>& img,
                         ImageAttr<SingleFeature>* attr);
     

See also:
SingleFeature
Author:
Lakshman
Version:
Id
w2img_Cluster.h,v 1.9 2009/06/02 20:17:56 lakshman Exp


Public Member Functions

int minx () const
int maxx () const
int miny () const
int maxy () const
int top_rt () const
int top_lt () const
int bot_rt () const
int bot_lt () const
void set_minx (int a)
 WARNING! by changing this, the cluster might become inconsistent!
void set_maxx (int a)
void set_miny (int a)
void set_maxy (int a)
void set_top_rt (int a)
void set_top_lt (int a)
void set_bot_rt (int a)
void set_bot_lt (int a)
float cx () const
 The center of gravity.
float cy () const
 The center of gravity.
cval () const
 The center of gravity in measurement space.
maxval () const
 Maximum value encountered.
minval () const
float geo_cx () const
 The geometric center of gravity.
float geo_cy () const
 The geometric center of gravity.
geo_cval () const
 The geometric center of gravity in measurement space.
double varx () const
 Variance of x.
double vary () const
 Variance of y.
double varxy () const
 Covariance of x,y.
Ellipse bestFitEllipse () const
 Get best fit ellipse to cluster.
int size () const
 Number of pixels in region.
 Cluster ()
void update (int x, int y, const T &value=T(), float wt=1.0)
 Add a new pixel.
void update (Cluster< T > &other, std::vector< Cluster< T > > &clusters)
 Add another cluster and update distances between the clusters.
float contains (const Cluster< T > &other) const
 Fraction of other region contained within this one.
float contained_within (const Cluster< T > &other) const
 Fraction of this one contained in other region.
float computeArea () const
 Returns computed area between the bounds.
float get_distance (const Cluster< T > &other) const
 distance in pixels between these two clusters (shortest path).
float get_boundingbox_distance (const Cluster< T > &other) const
 distance between bounding boxes of the two clusters.

Static Public Member Functions

static void computeDistances (const code::Image< int > &label, std::vector< Cluster< T > > &clusters)

Friends

std::ostream & operator<< (std::ostream &dout, const Cluster< T > &obj)


Constructor & Destructor Documentation

template<class T>
w2img::Cluster< T >::Cluster (  ) 


Member Function Documentation

template<class T>
Ellipse w2img::Cluster< T >::bestFitEllipse (  )  const [inline]

Get best fit ellipse to cluster.

template<class T>
int w2img::Cluster< T >::bot_lt (  )  const [inline]

template<class T>
int w2img::Cluster< T >::bot_rt (  )  const [inline]

template<class T>
float w2img::Cluster< T >::computeArea (  )  const

Returns computed area between the bounds.

template<class T>
static void w2img::Cluster< T >::computeDistances ( const code::Image< int > &  label,
std::vector< Cluster< T > > &  clusters 
) [static]

template<class T>
float w2img::Cluster< T >::contained_within ( const Cluster< T > &  other  )  const [inline]

Fraction of this one contained in other region.

template<class T>
float w2img::Cluster< T >::contains ( const Cluster< T > &  other  )  const

Fraction of other region contained within this one.

template<class T>
T w2img::Cluster< T >::cval (  )  const [inline]

The center of gravity in measurement space.

template<class T>
float w2img::Cluster< T >::cx (  )  const [inline]

The center of gravity.

template<class T>
float w2img::Cluster< T >::cy (  )  const [inline]

The center of gravity.

template<class T>
T w2img::Cluster< T >::geo_cval (  )  const [inline]

The geometric center of gravity in measurement space.

template<class T>
float w2img::Cluster< T >::geo_cx (  )  const [inline]

The geometric center of gravity.

template<class T>
float w2img::Cluster< T >::geo_cy (  )  const [inline]

The geometric center of gravity.

template<class T>
float w2img::Cluster< T >::get_boundingbox_distance ( const Cluster< T > &  other  )  const

distance between bounding boxes of the two clusters.

template<class T>
float w2img::Cluster< T >::get_distance ( const Cluster< T > &  other  )  const

distance in pixels between these two clusters (shortest path).

template<class T>
T w2img::Cluster< T >::maxval (  )  const [inline]

Maximum value encountered.

template<class T>
int w2img::Cluster< T >::maxx (  )  const [inline]

template<class T>
int w2img::Cluster< T >::maxy (  )  const [inline]

template<class T>
T w2img::Cluster< T >::minval (  )  const [inline]

template<class T>
int w2img::Cluster< T >::minx (  )  const [inline]

template<class T>
int w2img::Cluster< T >::miny (  )  const [inline]

template<class T>
void w2img::Cluster< T >::set_bot_lt ( int  a  )  [inline]

template<class T>
void w2img::Cluster< T >::set_bot_rt ( int  a  )  [inline]

template<class T>
void w2img::Cluster< T >::set_maxx ( int  a  )  [inline]

template<class T>
void w2img::Cluster< T >::set_maxy ( int  a  )  [inline]

template<class T>
void w2img::Cluster< T >::set_minx ( int  a  )  [inline]

WARNING! by changing this, the cluster might become inconsistent!

template<class T>
void w2img::Cluster< T >::set_miny ( int  a  )  [inline]

template<class T>
void w2img::Cluster< T >::set_top_lt ( int  a  )  [inline]

template<class T>
void w2img::Cluster< T >::set_top_rt ( int  a  )  [inline]

template<class T>
int w2img::Cluster< T >::size (  )  const [inline]

Number of pixels in region.

template<class T>
int w2img::Cluster< T >::top_lt (  )  const [inline]

template<class T>
int w2img::Cluster< T >::top_rt (  )  const [inline]

template<class T>
void w2img::Cluster< T >::update ( Cluster< T > &  other,
std::vector< Cluster< T > > &  clusters 
)

Add another cluster and update distances between the clusters.

template<class T>
void w2img::Cluster< T >::update ( int  x,
int  y,
const T &  value = T(),
float  wt = 1.0 
)

Add a new pixel.

template<class T>
double w2img::Cluster< T >::varx (  )  const [inline]

Variance of x.

This is s11 in the covariance matrix

template<class T>
double w2img::Cluster< T >::varxy (  )  const [inline]

Covariance of x,y.

This is s11 in the covariance matrix

template<class T>
double w2img::Cluster< T >::vary (  )  const [inline]

Variance of y.

This is s22 in the covariance matrix


Friends And Related Function Documentation

template<class T>
std::ostream& operator<< ( std::ostream &  dout,
const Cluster< T > &  obj 
) [friend]


Generated on Fri May 4 13:40:23 2012 for WDSS-IIw2algs by  doxygen 1.4.7