AURobotServers  4
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
UFuzzyPixel Class Reference

#include <ufuzzypixel.h>

Inheritance diagram for UFuzzyPixel:
Inheritance graph

Public Member Functions

virtual bool addCovariance (int clust, double m, UMatrix *mF, UMatrix *mV, double *membSum)
 
virtual bool addPosition (int clust, double m, UMatrix *mAvg, double *membSum)
 
virtual int getClass (int clustCnt)
 
virtual int getMaxClusterCnt ()
 
virtual double getMembValue (int clust)
 
virtual double getMembValueChange (int clustCnt)
 
virtual int getVectorSize ()
 
virtual void print (const char *prestring, int clustCnt)
 
virtual void seedRandom (int clustCnt)
 
virtual bool setDistance (int clust, UMatrix *mAi, UMatrix *mV)
 
virtual void setMembValue (double value, int clust)
 
void setPixel (UPixel *pixRef)
 
 UFuzzyPixel ()
 
virtual void updateMembValue (double m, int clustCnt)
 
 ~UFuzzyPixel ()
 
- Public Member Functions inherited from UFuzzyElement
 UFuzzyElement ()
 
virtual ~UFuzzyElement ()
 

Protected Attributes

double d [MAX_CLUSTER_CNT]
 
double mu1 [MAX_CLUSTER_CNT]
 
double mu2 [MAX_CLUSTER_CNT]
 
UPixelpix
 

Static Protected Attributes

static const int MAX_CLUSTER_CNT = 4
 

Detailed Description

Fuzzy classification of pixel colour

Author
Christian Andersen

Constructor & Destructor Documentation

UFuzzyPixel::UFuzzyPixel ( )

Constructor

References MAX_CLUSTER_CNT, mu1, and mu2.

UFuzzyPixel::~UFuzzyPixel ( )

Destructor

Member Function Documentation

bool UFuzzyPixel::addCovariance ( int  clust,
double  m,
UMatrix mF,
UMatrix mV,
double *  membSum 
)
virtual

Add the squared distance from this cluster center weighted with the membership value, and add membership value to 'membSum'. weight and membership value must be raised to power m. If 'clust' < 0, then membershib is set to 1.0.

Reimplemented from UFuzzyElement.

References UMatrix::add(), UMatrix::getData(), mu1, UMatrix::mult(), UPixel::p1, UPixel::p2, UPixel::p3, pix, and UMatrix::setSize().

Referenced by getMembValue().

bool UFuzzyPixel::addPosition ( int  clust,
double  m,
UMatrix mAvg,
double *  membSum 
)
virtual

Add Position vector to this vector, veightet with the membership value to power m. Add the membership value (to power m) to membSum. Returns false if an error is detected. If 'clust' < 0, then membershib is set to 1.0.

Reimplemented from UFuzzyElement.

References UMatrix::getData(), mu1, UPixel::p1, UPixel::p2, UPixel::p3, and pix.

Referenced by getMembValue().

int UFuzzyPixel::getClass ( int  clustCnt)
virtual

Get class for this element

Reimplemented from UFuzzyElement.

References mu1.

Referenced by getMembValue(), and print().

int UFuzzyPixel::getMaxClusterCnt ( )
virtual

Get maximum number of clusters this element type can be split into

Reimplemented from UFuzzyElement.

References MAX_CLUSTER_CNT.

Referenced by getMembValue().

virtual double UFuzzyPixel::getMembValue ( int  clust)
inlinevirtual
double UFuzzyPixel::getMembValueChange ( int  clustCnt)
virtual

Get membership change value from last iteration

Reimplemented from UFuzzyElement.

References getVectorSize(), mu1, mu2, and sqr().

Referenced by getMembValue().

int UFuzzyPixel::getVectorSize ( )
virtual

Get vector size of element position

Reimplemented from UFuzzyElement.

Referenced by getMembValue(), and getMembValueChange().

void UFuzzyPixel::print ( const char *  prestring,
int  clustCnt 
)
virtual

Print values

Reimplemented from UFuzzyElement.

References d, getClass(), mu1, UPixel::p1, UPixel::p2, UPixel::p3, and pix.

Referenced by UClientFuncImgGui::doFuzzyClassify(), and setPixel().

void UFuzzyPixel::seedRandom ( int  clustCnt)
virtual

Seet the element with random membership values

Reimplemented from UFuzzyElement.

References mu1.

Referenced by getMembValue().

bool UFuzzyPixel::setDistance ( int  clust,
UMatrix mAi,
UMatrix mV 
)
virtual

Set distance to cluster 'cluster'. Returns false if parameter errors were found.

Reimplemented from UFuzzyElement.

References d, UMatrix::get(), UMatrix::getData(), UPixel::p1, UPixel::p2, UPixel::p3, pix, and UMatrix::setSize().

Referenced by getMembValue().

void UFuzzyPixel::setMembValue ( double  value,
int  clust 
)
virtual

Set membership value for a cluster

Reimplemented from UFuzzyElement.

References mu1.

Referenced by getMembValue().

void UFuzzyPixel::setPixel ( UPixel pixRef)
inline
void UFuzzyPixel::updateMembValue ( double  m,
int  clustCnt 
)
virtual

Update participation value based on distance to cluset and this weight exponent value (e.g. 1.3), must be > 1.0. Returns false if there is calculation errors.

Reimplemented from UFuzzyElement.

References d, mu1, and mu2.

Referenced by getMembValue().

Member Data Documentation

double UFuzzyPixel::d[MAX_CLUSTER_CNT]
protected

Mahalanobis distance to cluster center

Referenced by print(), setDistance(), and updateMembValue().

const int UFuzzyPixel::MAX_CLUSTER_CNT = 4
staticprotected

Vector size

Referenced by getMaxClusterCnt(), and UFuzzyPixel().

double UFuzzyPixel::mu1[MAX_CLUSTER_CNT]
protected
double UFuzzyPixel::mu2[MAX_CLUSTER_CNT]
protected

Membership value for each cluster in last iteration

Referenced by getMembValueChange(), UFuzzyPixel(), and updateMembValue().

UPixel* UFuzzyPixel::pix
protected

Pixel value

Referenced by addCovariance(), addPosition(), print(), setDistance(), and setPixel().


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