imaqWriteOCRFile

NI Vision for LabWindows/CVI Function

imaqWriteOCRFile

Usage

int imaqWriteOCRFile(const char* fileName, const CharSet* set, const char* setDescription, const ReadTextOptions* readOptions, const OCRProcessingOptions* processingOptions, const OCRSpacingOptions* spacingOptions);

Purpose

Stores a character set and the values of the appropriate NI Vision structures in the file specified by fileName.

Parameters

Name

Type

Description

fileName const char* File that the function uses for this operation. This parameter is required and cannot be NULL.
set const CharSet* The trained characters to store in the file. Set this parameter to NULL to write an empty character set to the file.
setDescription const char* The trained character set description to store in the file. The description must not exceed 255 characters. Set this parameter to NULL if you do not need to store this information.
readOptions const ReadTextOptions* The options for reading text to store in the file. Set this parameter to NULL to write the default reading options.
processingOptions const OCRProcessingOptions* The options for image processing to store in the file. Set this parameter to NULL to write the default processing options.
spacingOptions const OCRSpacingOptions* The character size and spacing options to store in the file. Set this parameter to NULL to write the default character size and spacing options.

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

readOptions—Set readOptions to NULL to use the following default reading options:

validChars NULL
numValidChars 0
substitutionChar ?
readStrategy IMAQ_READ_AGGRESSIVE
acceptanceLevel 700
aspectRatio 400
readResolution IMAQ_LOW_RESOLUTION

processingOptions—Set processingOptions 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 spacingOptions 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