Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Helpers
[Global data and functions]


Detailed Description

Global helpers.

Such a function constructs an object of a QgarLib class (for example a partition of clusters using a distance function), without explicitely invoking the corresponding constructor.

Helpers allow a functional programming style, whereas Qgar coding philosophy is rather based on a constructor-call programming style, as emphasized in [ Rendek-et-al-04a ] and [ Tombre-et-al-98 ].


KMeans helper functions

template<class T>
std::vector< GenCluster< T > > qgar::qgKMeans (const std::vector< T > &anObjVect, double(*aDistFunction)(const T &, const T &), int aClusterCnt=3) throw (QgarErrorAlgorithm)
 Construct a partition of clusters using a distance function.
template<class T>
std::vector< GenCluster< T > > qgar::qgKMeans (const std::vector< T > &anObjVect, double(*aDistFunction)(const T &, const T &), std::vector< T * > &aCenterVector, int aClusterCnt=3) throw (QgarErrorAlgorithm)
 Construct a partition of clusters of given centers, using a distance function.

Kanungo degradation helper functions

void qgar::qgKanungoDegradation (BinaryImage &anImg, double alpha0, double alpha, double beta0, double beta, double eta, int structEltSize) throw (QgarErrorInvalidArg)
 Degrade a given image.

Binarization helper functions

ThresBinaryImage qgar::qgThresBinarization (const GreyLevelImage &anImg, int aThres)
 Returns a binary image, result of the binarization of the given grey-level image, using a constant threshold.


Function Documentation

void qgar::qgKanungoDegradation BinaryImage anImg,
double  alpha0 = 1.0,
double  alpha = 2.0,
double  beta0 = 1.0,
double  beta = 2.0,
double  eta = 0.0,
int  structEltSize = 3
throw (QgarErrorInvalidArg)
 

Degrade a given image.

If the provided structural element size is 0 (argument structEltSize), the final closing, as described in Kanungo's method, is not performed.

Parameters:
anImg image to be degraded
alpha0 see Kanungo's method (default 1)
alpha see Kanungo's method (default 2)
beta0 see Kanungo's method (default 1)
beta see Kanungo's method (default 2)
eta see Kanungo's method (default 0)
structEltSize size of the square structutal element of the final closing (default 3)
Exceptions:
qgar::QgarErrorInvalidArg (arg structEltSize cannot be negative)

Definition at line 86 of file KanungoBinaryImage.C.

References qgar::CloseBinaryImage::perform(), qgar::QGE_BW_BLACK, and qgar::QGE_BW_WHITE.

Referenced by qgar::KanungoBinaryImage::KanungoBinaryImage().

template<class T>
std::vector< GenCluster< T > > qgar::qgKMeans const std::vector< T > &  anObjVect,
double(*)(const T &, const T &)  aDistFunction,
std::vector< T * > &  aCenterVector,
int  aClusterCnt = 3
throw (QgarErrorAlgorithm)
 

Construct a partition of clusters of given centers, using a distance function.

Parameters:
anObjVect vector of objects to be partitioned
aDistFunction distance function f(const T&, const T&)
aCenterVector vector of the initial centers of the clusters
aClusterCnt number of resulting clusters (default 3)
Exceptions:
qgar::QgarErrorAlgorithm if an error occurred while creating clusters

Definition at line 611 of file GenKMeans.TCC.

template<class T>
std::vector< GenCluster< T > > qgar::qgKMeans const std::vector< T > &  anObjVect,
double(*)(const T &, const T &)  aDistFunction,
int  aClusterCnt = 3
throw (QgarErrorAlgorithm)
 

Construct a partition of clusters using a distance function.

Parameters:
anObjVect vector of objects to be partitioned
aDistFunction distance function f(const T&, const T&)
aClusterCnt number of resulting clusters (default 3)
Exceptions:
qgar::QgarErrorAlgorithm if an error occurred while creating clusters

Definition at line 595 of file GenKMeans.TCC.

ThresBinaryImage qgar::qgThresBinarization const GreyLevelImage anImg,
int  aThres
 

Returns a binary image, result of the binarization of the given grey-level image, using a constant threshold.

Parameters:
anImg grey-level image
aThres constant binarization threshold

Definition at line 97 of file ThresBinaryImage.C.