imaqTrainChars
Usage
int imaqTrainChars(const Image* image, CharSet* set, int index, const char* charValue, const ROI* roi, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions);
Purpose
Assigns character values to the identifiable objects in the image and appends the newly trained characters to the character set.
Image Types Supported
IMAQ_IMAGE_U8, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL
Parameters
Name
|
Type
|
Description
|
---|---|---|
image | const Image* | The source image for this operation. |
set | CharSet* | The character set this function operates on. To create a character set, use imaqCreateCharSet(). This parameter is required and cannot be NULL. |
index | int | The index of the object identified within the ROI that you want to train. Pass IMAQ_ALL_OBJECTS to train all the objects that the function identifies in the ROI. |
charValue | const char* | A null-terminated string of characters that specifies the value of the object at the index. The length of the string must not exceed 255 characters. If you set index to IMAQ_ALL_OBJECTS, each character in charValue is the value for the object at the corresponding index in the set of objects identified within the ROI. For example, the character in the first position of charValue is the value for the object at index 0. If you set index to IMAQ_ALL_OBJECTS, the length of charValue must match the number of objects identified within the ROI. |
roi | const ROI* | The ROI that the function performs this operation on. Pass NULL to use the entire image for this operation. |
processingOptions | const OCRProcessingOptions* | The options you use to configure how the function processes the contents of the image before attempting to read text. |
spacingOptions | const OCRSpacingOptions* | The size and spacing constraints you can apply to characters in the image. |
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(). |
Parameter Discussion
processingOptions—Set the processingOptions parameter to NULL to use the following default processing options:
mode | IMAQ_COMPUTED_UNIFORM |
lowThreshold | 0 |
highThreshold | 255 |
blockCount | 4 |
fastThreshold | FALSE |
biModalCalculation | FALSE |
darkCharacters | TRUE |
removeObjectsTouchingROI | FALSE |
erosionCount | 0 |
spacingOptions—Set the spacingOptions parameter to NULL to use the following default spacing options:
minCharSpacing | 1 |
minCharSize | 20 |
maxCharSize | 65536 |
maxHorizontalElementSpacing | 1 |
maxVerticalElementSpacing | 0 |
minBoundingRectWidth | 1 |
maxBoundingRectWidth | 65536 |
minBoundingRectHeight | 1 |
maxBoundingRectHeight | 65536 |
autoSplit | FALSE |