CogOCRMaxClassifier Execute Method (CogOCRMaxChar, CogOCRMaxClassifierRunParams, CogOCRMaxSwapCharSet)Cognex VisionPro 9.8
Classify a single character. The input CogOCRMaxChar contains an image of the character, as well as a Metrics property which define the character's mark rectangle and cell rectangle. Typically the input CogOCRMaxChar.CharacterCode is set to Unknown because the character has not yet been classified.

Namespace: Cognex.VisionPro.OCRMax
Assembly: Cognex.VisionPro.OCRMax (in Cognex.VisionPro.OCRMax.dll) Version: 75.1.0.0
Syntax

public CogOCRMaxClassifierPositionResult Execute(
	CogOCRMaxChar character,
	CogOCRMaxClassifierRunParams runParams,
	CogOCRMaxSwapCharSet swapCharSet
)

Parameters

character
Type: Cognex.VisionPro.OCRMax CogOCRMaxChar
The character to be classified.
runParams
Type: Cognex.VisionPro.OCRMax CogOCRMaxClassifierRunParams
The run params that specify how to perform classification.
swapCharSet
Type: Cognex.VisionPro.OCRMax CogOCRMaxSwapCharSet
The set of chracters which have been predetermined to be "swappable" (They appear similar and are hard to distinguish, e.g. '0' and 'O').

Return Value

Type: CogOCRMaxClassifierPositionResult
Exceptions

ExceptionCondition
CogSecurityViolationException
CogOCRMaxClassifierParamsException Thrown if:
  • any character's image is not allocated
  • any character's cell rect is not specified
  • the classifier's font contains no characters
CogTimeoutExpiredException Thrown if the Timeout expired.
ArgumentNullException Thrown if character is null. Thrown if runParams is null. Thrown if swapCharSet is null.
Remarks

Note that space characters are a special case. The OCRMax Classifier does not classify space characters. Instead the classifier input (cf. the segmenter output) is responsible for deciding if a particular character is a space. The classifier simply "passes through" space characters and their associated scores. Space characters are not assigned alternative characters, and the confidence score is set to be equal to the regular score in the classifier output.

If the input's CogOCRMaxChar.CharacterCode == 20 (space) the classifier will automatically classify the character as a space. The space character's score and confidence score will be set to the 1 in the classifier output.

See Also