Has to satisfy the same requirements as KSSegment.
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. | |
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. | |
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 (const Cluster< T > &other) |
Add another cluster. | |
float | contains (const Cluster< T > &other) const |
Percentage of other region contained within this one. | |
float | contained_within (const Cluster< T > &other) const |
Percentage of this one contained in other region. | |
float | computeArea () const |
Returns computed area between the bounds. | |
float | relativeDist (const Cluster< T > &other) const |
Relative distance between this cluster and the other cluster. | |
Friends | |
std::ostream & | operator<< (std::ostream &dout, const Cluster< T > &obj) |
kmeans::Cluster< T >::Cluster | ( | ) |
int kmeans::Cluster< T >::bot_lt | ( | ) | const [inline] |
int kmeans::Cluster< T >::bot_rt | ( | ) | const [inline] |
float kmeans::Cluster< T >::computeArea | ( | ) | const |
Returns computed area between the bounds.
float kmeans::Cluster< T >::contained_within | ( | const Cluster< T > & | other | ) | const [inline] |
Percentage of this one contained in other region.
float kmeans::Cluster< T >::contains | ( | const Cluster< T > & | other | ) | const |
Percentage of other region contained within this one.
T kmeans::Cluster< T >::cval | ( | ) | const [inline] |
The center of gravity in measurement space.
float kmeans::Cluster< T >::cx | ( | ) | const [inline] |
The center of gravity.
float kmeans::Cluster< T >::cy | ( | ) | const [inline] |
The center of gravity.
T kmeans::Cluster< T >::geo_cval | ( | ) | const [inline] |
The geometric center of gravity in measurement space.
float kmeans::Cluster< T >::geo_cx | ( | ) | const [inline] |
The geometric center of gravity.
float kmeans::Cluster< T >::geo_cy | ( | ) | const [inline] |
The geometric center of gravity.
int kmeans::Cluster< T >::maxx | ( | ) | const [inline] |
int kmeans::Cluster< T >::maxy | ( | ) | const [inline] |
int kmeans::Cluster< T >::minx | ( | ) | const [inline] |
int kmeans::Cluster< T >::miny | ( | ) | const [inline] |
float kmeans::Cluster< T >::relativeDist | ( | const Cluster< T > & | other | ) | const |
Relative distance between this cluster and the other cluster.
The whole idea that a.relativeDist(b) is 0 if a contains b. Otherwise, it gives the number of a-sized clusters that you can fit between a's envelope and b's envelope.
Because of this definition, a.relativeDist(b) is not the same as b.relativeDist(a)
void kmeans::Cluster< T >::set_bot_lt | ( | int | a | ) | [inline] |
void kmeans::Cluster< T >::set_bot_rt | ( | int | a | ) | [inline] |
void kmeans::Cluster< T >::set_maxx | ( | int | a | ) | [inline] |
void kmeans::Cluster< T >::set_maxy | ( | int | a | ) | [inline] |
void kmeans::Cluster< T >::set_minx | ( | int | a | ) | [inline] |
WARNING! by changing this, the cluster might become inconsistent!
void kmeans::Cluster< T >::set_miny | ( | int | a | ) | [inline] |
void kmeans::Cluster< T >::set_top_lt | ( | int | a | ) | [inline] |
void kmeans::Cluster< T >::set_top_rt | ( | int | a | ) | [inline] |
int kmeans::Cluster< T >::size | ( | ) | const [inline] |
Number of pixels in region.
int kmeans::Cluster< T >::top_lt | ( | ) | const [inline] |
int kmeans::Cluster< T >::top_rt | ( | ) | const [inline] |
void kmeans::Cluster< T >::update | ( | const Cluster< T > & | other | ) |
Add another cluster.
void kmeans::Cluster< T >::update | ( | int | x, | |
int | y, | |||
const T & | value = T() , |
|||
float | wt = 1.0 | |||
) |
Add a new pixel.
std::ostream& operator<< | ( | std::ostream & | dout, | |
const Cluster< T > & | obj | |||
) | [friend] |