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