CogOCRMaxTool SwapCharSet Property Cognex VisionPro
The set of characters which have been predetermined to be "swappable" (They appear similar and are hard to distinguish, e.g. '0' (zero) and 'O' (capital oh)).

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

public CogOCRMaxSwapCharSet SwapCharSet { get; set; }

Property Value

Type: CogOCRMaxSwapCharSet
The SwapCharSet value. The default value is a default constructed CogOCRMaxSwapCharSet instance.
Events

Event TypeReason
ICogChangedEvent Changed

Fires when this property changes.

The following state flag may be affected:

  • SfSwapCharSet
Exceptions

ExceptionCondition
ArgumentNullException Thrown if SwapCharSet is set to null.
Remarks

SwapChars are used by the classifier and fielding. The classifier will ignore swap chars when calculating its confidence score. Additionally the AlternateCharacters in the OCRMax result will never contain a character that is a SwapChar of the primary result.

A user may configure the swap chars to prevent the classifier from being confused by otherwise understandable string due to the similarity between two or more characters which are known to have very similar appearances (e.g. '0' (zero) and 'O' (captial oh)). By setting up swap chars the user can determined that it does not matter if the tool reads a '0' (zero) or an 'O' (capital oh), because the correct string can be determined by the surrounding context or by using prior knowledge of the text being read.

To illustrate: The information contained in the string "0ctober 2Oth" is still evident despite the fact that the CogOCRMaxTool read '0' (zero) and 'O' (capital oh) in the incorrect positions.

See Also