CogOCRMaxSwapCharSet ClassCognex VisionPro
This class is a container that holds multiple CogOCRMaxSwapChars. Each CogOCRMaxSwapChar holds a set of character codes that are "swappable" with each other.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro.OCRMax CogOCRMaxSwapCharSet

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

[SerializableAttribute]
public class CogOCRMaxSwapCharSet : CogSerializableChangedEventBase, 
	IDisposable

The CogOCRMaxSwapCharSet type exposes the following members.

Constructors

  NameDescription
Public methodCogOCRMaxSwapCharSet 
Construct a default CogOCRMaxSwapCharSet object.
Public methodCogOCRMaxSwapCharSet(CogOCRMaxSwapCharSet)
Constructs a deep copy of the supplied CogOCRMaxSwapCharSet object.
Protected methodCogOCRMaxSwapCharSet(SerializationInfo, StreamingContext)
Serialization constructor for CogOCRMaxSwapCharSet.
Top
Methods

  NameDescription
Public methodAdd
Adds a group of swap characters to this set.
Public methodCanSwap
Returns whether characterCode1 and characterCode2 exist in the same swap character group within this set.
Public methodContains
Returns whether any swap character group in this set contains characterCode.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose 
Protected methodDispose(Boolean)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Overrides Object Finalize .)
Protected methodGetAttributes
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetClassName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetComponentName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetConverter
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultEvent
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultProperty
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEditor
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetObjectData (Overrides CogSerializableObjectBase GetObjectData(SerializationInfo, StreamingContext).)
Protected methodGetProperties 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetProperties( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetPropertyOwner
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetString 
Returns a string which represents this CogOCRMaxSwapCharSet.
Public methodGetString(String)
Returns a string which represents this CogOCRMaxSwapCharSet.
Public methodGetSwapCharacter
Returns the swap character that contains characterCode.
Public methodGetSwapCharacters
Get a copy of all swap character groups in this set.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone 
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Protected methodOnChanged(Int64)
This method should be called internally whenever the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Protected methodOnChanged(CogChangedEventArgs)
This method may be called internally whenever a derived object's state may have changed and the derived object expresses this change via a derived CogChangedEventArgs class.
(Inherited from CogSerializableChangedEventBase.)
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called, and raises the Changed event if the ChangedEventSuspended count is reduced to zero and any changes were made while events were suspended. Must be called once for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventBase.)
Public methodSetSwapCharacters( CogOCRMaxSwapChar )
Set the swap characters in this set. Each swap character in this set contains a list of characters which are "swappable" (They appear similar and are hard to distinguish, e.g. '0' (zero) and 'O' (capital oh)).
Public methodSetSwapCharacters(String, String)
Set the swap characters in this set. Each swap character in this set contains list of characters which are "swappable" (They appear similar and are hard to distinguish, e.g. '0' (zero) and 'O' (capital oh)).
Public methodSuspendChangedEvent
Temporarily suspends the raising of the Changed event. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventBase.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Fields

  NameDescription
Public fieldStatic memberSfGetString
This bit will be set in the EventArgs of a Changed event every time the value returned by GetString may have changed.
Public fieldStatic memberSfGetSwapCharacters
This bit will be set in the EventArgs of a Changed event every time the value returned by GetSwapCharacters may have changed.
Protected fieldStatic memberSfNextSf
Top
Properties

  NameDescription
Public propertyChangedEventSuspended
If nonzero, indicates that the raising of the Changed event has been suspended. This value is incremented when SuspendChangedEvent is called and decremented when ResumeAndRaiseChangedEvent is called.
(Inherited from CogSerializableChangedEventBase.)
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyStateFlags
Returns the complete set of state flags supported on this object. The flags may be indexed by name as shown in the following C# code snippet: if (changedObject.StateFlags["Color"] & eventArgs.StateFlags) { ... }
(Inherited from CogSerializableChangedEventBase.)
Top
Events

  NameDescription
Public eventChanged
This event is raised when one or more parts of the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Top
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