Polimago (Polimago.dll) 15.0
Classification

Typedefs

typedef double TTransformation[16]
 Generic description of a transformation. More...
 

Functions

cvbbool_t PMClassify (TCLF simpleClf, IMG img, cvbdim_t X, cvbdim_t Y, char *szClassLabel, size_t len, double &confidence, double *confidences)
 Classifies the neighborhood of a point (X,Y) in an image according to the specified classifier. More...
 
cvbbool_t PMClassifyW (TCLF simpleClf, IMG img, cvbdim_t X, cvbdim_t Y, wchar_t *szClassLabel, size_t len, double &confidence, double *confidences)
 Classifies the neighborhood of a point (X,Y) in an image according to the specified classifier. More...
 
void PMFormatTransformation (TSCLF searchClf, double(&t)[16], TGeometrySpec &specification)
 Translate a geometry description. More...
 
cvbbool_t PMGetClfClassLabel (TCLF clf, cvbval_t classIndex, char *szClassLabel)
 Get the class label corresponding to a given index. More...
 
cvbbool_t PMGetClfClassLabelW (TCLF clf, cvbval_t classIndex, wchar_t *szClassLabel)
 Get the class label corresponding to a given index. More...
 
void PMGetClfTrainParams (TCLF clf, TTrainParams &params)
 Returns the training parameters that have been used during classifier creation in a TTrainParams structure. More...
 
cvbval_t PMGetGranularity (const char *szCode)
 The function returns the granularity (see tutorial) associated with a preprocessing code. More...
 
cvbval_t PMGetNumClasses (TCLF clf)
 Returns the number of classes trained in a classifier if its usage is CU_ClassifyOneVersusAll or CU_ClassifyOneVersusOne. More...
 
cvbval_t PMGetOutputDimension (TCLF clf)
 Returns the number of parameters estimated for numerical prediction by the classifier if the classifier's usage mode is CU_Regression. More...
 
cvbbool_t PMInterpretSpecification (TSCLF searchClf, const TGeometrySpec &specification, double(&t)[16])
 Translate a geometry description. More...
 
cvbbool_t PMPredictVector (TCLF simpleClf, IMG img, cvbdim_t X, cvbdim_t Y, double *resultVector)
 Numerical prediction of vector-valued function depending on the neighborhood of a point (X,Y) in an image according to the specified classifier. More...
 

Detailed Description

Typedef Documentation

◆ TTransformation

typedef double TTransformation[16]

Generic description of a transformation.

The TTransformation type generically describes transformations as an array of double values. The interpretation of these double values is dependent on the actually described transformation, and therefore the type TTransformation is usually never used directly. It is instead defined by the results of PMGridSearch or PMFormatTransformation and used in PMSearchResultToImage as well as PMInterpretSpecification.

Function Documentation

◆ PMClassify()

cvbbool_t PMClassify ( TCLF  simpleClf,
IMG  img,
cvbdim_t  X,
cvbdim_t  Y,
char *  szClassLabel,
size_t  len,
double &  confidence,
double *  confidences 
)

Classifies the neighborhood of a point (X,Y) in an image according to the specified classifier.

The classifier usage setting (retrieve with PMGetClfTrainParams) must be either CU_ClassifyOneVersusAll or CU_ClassifyOneVersusOne.

Parameters
[in]simpleClfPointer to classifier.
[in]imgImage handle.
[in]XX coordinate of the point in the image to classify.
[in]YY coordinate of the point in the image to classify.
[in]szClassLabelPointer to a string buffer where the resulting class label is returned. Generally, class labels are limited to up to 255 characters (not including the terminating zero).
[in]lenLength of the class label string buffer pointed to by szClassLabel.
[out]confidenceMaximal confidence.
[in]confidencesArray where the confidence may be returned for each class label. Set to NULL if the individual confidences should not be returned; otherwise have confidences point to an array of PMGetNumClasses * sizeof(double) bytes.
Returns
TRUE if classification was successful, FALSE if not

◆ PMClassifyW()

cvbbool_t PMClassifyW ( TCLF  simpleClf,
IMG  img,
cvbdim_t  X,
cvbdim_t  Y,
wchar_t *  szClassLabel,
size_t  len,
double &  confidence,
double *  confidences 
)

Classifies the neighborhood of a point (X,Y) in an image according to the specified classifier.

The classifier usage setting (retrieve with PMGetClfTrainParams) must be either CU_ClassifyOneVersusAll or CU_ClassifyOneVersusOne.

Parameters
[in]simpleClfPointer to classifier.
[in]imgImage handle.
[in]XX coordinate of the point in the image to classify.
[in]YY coordinate of the point in the image to classify.
[in]szClassLabelPointer to a string buffer where the resulting class label is returned. Generally, class labels are limited to up to 255 characters (not including the terminating zero).
[in]lenLength of the class label string buffer pointed to by szClassLabel.
[out]confidenceMaximal confidence.
[in]confidencesArray where the confidence may be returned for each class label. Set to NULL if the individual confidences should not be returned; otherwise have confidences point to an array of PMGetNumClasses * sizeof(double) bytes.
Returns
TRUE if classification was successful, FALSE if not

◆ PMFormatTransformation()

void PMFormatTransformation ( TSCLF  searchClf,
double(&)  t[16],
TGeometrySpec specification 
)

Translate a geometry description.

This method translates a classifier's geometry description as given by a TTransformation array into a readable geometry description as given by a TGeometrySpec struct, taking into account the classifier's view on geometries.

Parameters
[in]searchClfThe search classifiers whose geometry interpretation is to be used for formatting.
[in]tClassifier-dependent geometry to be interpreted.
[out]specificationStruct that makes the classifier's view at the parameter t readable

◆ PMGetClfClassLabel()

cvbbool_t PMGetClfClassLabel ( TCLF  clf,
cvbval_t  classIndex,
char *  szClassLabel 
)

Get the class label corresponding to a given index.

Attention
The buffer pointed to by szClassLabel must be big enough to hold the entire class label, otherwise a write access violation may occur. To be on the safe side, alway allocate at least 256 bytes.
Parameters
[in]clfHandle of the classifier to be queried.
[in]classIndexIndex of the class in question. Must be nonnegative and smaller than the return value of PMGetNumClasses.
[in]szClassLabelPointer to a buffer that will receive the class label string (zero-terminated!).
Returns
TRUE if the call was successful (i.e. all parameters are valid) FALSE otherwise.

◆ PMGetClfClassLabelW()

cvbbool_t PMGetClfClassLabelW ( TCLF  clf,
cvbval_t  classIndex,
wchar_t *  szClassLabel 
)

Get the class label corresponding to a given index.

Attention
The buffer pointed to by szClassLabel must be big enough to hold the entire class label, otherwise a write access violation may occur. To be on the safe side, alway allocate at least 256 bytes.
Parameters
[in]clfHandle of the classifier to be queried.
[in]classIndexIndex of the class in question. Must be nonnegative and smaller than the return value of PMGetNumClasses.
[in]szClassLabelPointer to a buffer that will receive the class label string (zero-terminated!).
Returns
TRUE if the call was successful (i.e. all parameters are valid) FALSE otherwise.

◆ PMGetClfTrainParams()

void PMGetClfTrainParams ( TCLF  clf,
TTrainParams params 
)

Returns the training parameters that have been used during classifier creation in a TTrainParams structure.

Note that this function should not be called on a search classifier. To retrieve the parameters that have been used for a search classifier please use PMGetSearchClfTrainParams.

Parameters
[in]clfpointer to classifier.
[out]paramsThe training parameters used during generation of the classifier.

◆ PMGetGranularity()

cvbval_t PMGetGranularity ( const char *  szCode)

The function returns the granularity (see tutorial) associated with a preprocessing code.

Parameters
[in]szCodePointer to 0-terminated string containing the preprocessing code.
Returns
Divisor for width and height of feature window.

◆ PMGetNumClasses()

cvbval_t PMGetNumClasses ( TCLF  clf)

Returns the number of classes trained in a classifier if its usage is CU_ClassifyOneVersusAll or CU_ClassifyOneVersusOne.

Otherwise it returns zero.

Parameters
[in]clfPointer to classifier.
Returns
Number of classes represented in classifier (or zero if the classifier has been trained for regression).

◆ PMGetOutputDimension()

cvbval_t PMGetOutputDimension ( TCLF  clf)

Returns the number of parameters estimated for numerical prediction by the classifier if the classifier's usage mode is CU_Regression.

For classifiers generated with CU_ClassifyOneVersusAll the returned value is the number of classes; for classifiers generated with CU_ClassifyOneVersusOne the returned value is PMGetNumClasses*(PMGetNumClasses-1)/2 (the number of possible pairs of classes).

Parameters
[in]clfPointer to classifier.
Returns
Number of parameters estimated for numerical prediction.

◆ PMInterpretSpecification()

cvbbool_t PMInterpretSpecification ( TSCLF  searchClf,
const TGeometrySpec specification,
double(&)  t[16] 
)

Translate a geometry description.

This method translates a geometry description as given by a TGeometrySpec structure into an array of doubles that corresponds to the specified classifier's view on geometries. This is necessary for example when using the function PMInspect or PMInspectD to correctly specify the starting point for the iteration.

Parameters
[in]searchClfThe search classifiers whose geometry interpretation is to be used for interpretation.
[in]specificationGeometry description to be interpreted.
[out]tArray of 16 doubles that describes the classifier's interpretation of the specification parameter
Returns
TRUE if reformatting succeeded, FALSE if interpretation was not possible because the classifier referenced by searchClf is invalid.

◆ PMPredictVector()

cvbbool_t PMPredictVector ( TCLF  simpleClf,
IMG  img,
cvbdim_t  X,
cvbdim_t  Y,
double *  resultVector 
)

Numerical prediction of vector-valued function depending on the neighborhood of a point (X,Y) in an image according to the specified classifier.

The classifier usage setting (retrieve with PMGetClfTrainParams) must be CU_Regression for this function to be able to work with the classifier.

Parameters
[in]simpleClfPointer to classifier.
[in]imgImage handle.
[in]XX coordinate of the point in the image to classify.
[in]YY coordinate of the point in the image to classify.
[out]resultVectorPointer to a double array to be filled with the components of the prediction result vector. Length of the array must be PMGetOutputDimension * sizeof(double).
Returns
TRUE if numerical prediction was successful, FALSE if not.