imaqAddClassifierSample
Usage
int imaqAddClassifierSample(Image* image, ClassifierSession* session, const ROI* roi, const char* sampleClass, double* featureVector, unsigned int vectorSize);
Purpose
Adds a sample to a classifier. To add a sample to a custom classification session, use the featureVector and vectorSize parameters. To add a sample to any other type of classification session, use the image parameter.
Image Types Supported
IMAQ_IMAGE_U8
Parameters
|
Name
|
Type
|
Description
|
|---|---|---|
| image | Image* | The image to add to the classifier. This parameter is optional if you are adding a sample to a custom classification session. |
| session | ClassifierSession* | The classifier session to use. |
| roi | const ROI* | The ROI containing the sample to add. Each contour of roi must be a rectangle, rotated rectangle, oval, annulus, or closed contour. Set this parameter to NULL to add the entire image. |
| sampleClass | const char* | The class to which this sample belongs. |
| featureVector | double* | The feature vector to add to the classifier. Use this parameter only when you are using a custom classifier. For any other type of classifier, set this parameter to NULL. |
| vectorSize | unsigned int | The number of elements in featureVector. Use this parameter only when you are using a custom classifier. For any other type of classifier, set this parameter to 0. |
Return Value
| Type |
Description |
|---|---|
| int | On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError(). |