CogOCVMaxPoseHelper ClassCognex VisionPro
This class provides help in defining a pose for a text paragraph. The general usage model assumes that you have: a) An image depicting the actual text in question, b) A font object, and c) The text (one or more strings), and from these you wish to determine a pose at which the CogOCVMax operator or tool might process the image. There are five basic steps. First, set up the CogOCVMaxPoseHelper object by setting the Font and Text properties (and optionally modifying the FontRenderParams property). Second, call the InitialPoseEstimate() method to get a first guess at what the desired pose might be. Third, call the FinalPosePrepare() method to create a CogCompositeShape graphic using the estimated initial pose. Fourth, add the graphic to the interactive display and allow the user to dynamically adjust the position, rotation, size, scale, or skew of this graphic so as to superimpose the graphic on the corresponding text in the image. Fifth, call the FinalPoseComplete() method with the (user modified) CogCompositeShape graphic. This final step will yield a CogTransform2DLinear that describes the user specified pose.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro.OCVMax CogOCVMaxPoseHelper

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

[SerializableAttribute]
public class CogOCVMaxPoseHelper : CogSerializableChangedEventBase, 
	IDeserializationCallback

The CogOCVMaxPoseHelper type exposes the following members.

Constructors

  NameDescription
Public methodCogOCVMaxPoseHelper 
Public methodCogOCVMaxPoseHelper(CogOCVMaxPoseHelper)
Protected methodCogOCVMaxPoseHelper(SerializationInfo, StreamingContext)
Top
Methods

  NameDescription
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 methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFinalPoseComplete(CogCompositeShape)
Compute the final pose based upon the differences between the cached initial state of the interactive graphic and the current state of the supplied graphic. The presumption is that you are calling this method after the user has finished graphically manipulating the input CogCompositeShape.
Public methodFinalPoseComplete(CogRectangleAffine)
Compute the final pose based upon the differences between the cached initial state of the interactive graphic and the current state of the supplied graphic. The presumption is that you are calling this method after the user has finished graphically manipulating the input CogRectangleAffine.
Public methodFinalPosePrepare
Prepare to compute the final pose by creating an appropriate interactive graphic and caching certain data describing its initial state.
Public methodFinalPosePrepareRectangleAffine
Prepare to compute the final pose by creating an interactive affine rectangle graphic and caching certain data describing its initial state.
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
Implements the GetObjectData method of the ISerializable interface.
(Inherited from CogSerializableObjectBase.)
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 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.)
Public methodInitialPoseEstimate
Compute an initial estimate of the desired pose using the currently set Font, FontRenderParams, and Text. This estimated pose will size and position the current text to fit easily within the center of the supplied image. The computed pose will be cached internally as well as returned by this method.
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 methodOnDeserialization
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 methodSetText( Int32 )
Set the Text property using the supplied string. Note that this assumes that the character keys in the font correspond to Unicode code point values.
Public methodSetText(String)
Set the Text property using the supplied string. Note that this assumes that the character keys in the font correspond to Unicode code point values.
Public methodSetText( String )
Set the Text property using the supplied array of strings. Here each array element corresponds to a line in the paragraph. Note that this assumes that the character keys in the font correspond to Unicode code point values.
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 memberSfFinalPoseData
This bit will be set in the EventArgs of a Changed event every time the value returned by FinalPoseData may have changed.
Public fieldStatic memberSfFinalPosePrepared
This bit will be set in the EventArgs of a Changed event every time the value returned by FinalPosePrepared may have changed.
Public fieldStatic memberSfFont
This bit will be set in the EventArgs of a Changed event every time the value returned by Font may have changed.
Public fieldStatic memberSfFontRenderParams
This bit will be set in the EventArgs of a Changed event every time the value returned by FontRenderParams may have changed.
Public fieldStatic memberSfInitialPose
This bit will be set in the EventArgs of a Changed event every time the value returned by InitialPose may have changed.
Protected fieldStatic memberSfNextSf
Public fieldStatic memberSfText
This bit will be set in the EventArgs of a Changed event every time the value returned by Text may have changed.
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 propertyFinalPosePrepared
Get the validity of cached internal data describing the initial state of the graphical object that will be manipulated by the user to specify the final pose. This property is set to True by successfully calling FinalPosePrepare(). This property is set to False whenever Font is changed or modified, whenever FontRenderParams is changed or modified, whenever Text is changed, and whenever InitialPose is changed or modified. This property must be True before calling FinalPoseComplete().
Public propertyFont
Get or set the font used to compute the desired pose.
Public propertyFontRenderParams
Get or set the CogOCVMaxFontRenderParams used to compute the desired pose.
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyInitialPose
Get or set the cached InitialPose. Note that in addition to setting this value directly, one might more typically set this property by calling the InitialPoseEstimate() method.
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.)
Public propertyText
Get or set the actual text used to compute the desired pose. Note that this text is represented as an ArrayList of ArrayList(s) of Int32. The outer array list holds one or more entries, each of which corresponds to a line of text within a single paragraph. Each such entry is itself an ArrayList. Every inner ArrayList holds zero or more Int32s. Each Int32 entry is the key value of a character. While a single line may have zero entries (that is, be empty), there must be at least one character in the paragraph. Note that there are several SetText methods that serve the same function as this setter but accept more convenient representations of the desired text (e.g. an array of strings, a single string, or an array of Int32s).
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
See Also