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 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: 75.1.0.0
Syntax
The CogOCVMaxPoseHelper type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogOCVMaxPoseHelper | ||
| CogOCVMaxPoseHelper(CogOCVMaxPoseHelper) | ||
| CogOCVMaxPoseHelper(SerializationInfo, StreamingContext) |
Methods
| Name | Description | |
|---|---|---|
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
| Equals | (Inherited from Object.) | |
| Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
| FinalPoseComplete(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. | |
| FinalPoseComplete(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. | |
| FinalPosePrepare | Prepare to compute the final pose by creating an appropriate interactive graphic and caching certain data describing its initial state. | |
| FinalPosePrepareRectangleAffine | Prepare to compute the final pose by creating an interactive affine rectangle graphic and caching certain data describing its initial state. | |
| GetAttributes |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetClassName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetComponentName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetConverter |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultEvent |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultProperty |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEditor |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetObjectData |
Implements the GetObjectData method of the ISerializable interface.
(Inherited from CogSerializableObjectBase.) | |
| GetProperties |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetProperties( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetPropertyOwner |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| InitialPoseEstimate | 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. | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
| OnChanged(Int64) |
This method should be called internally whenever the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) | |
| OnChanged(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.) | |
| OnDeserialization | ||
| ResumeAndRaiseChangedEvent |
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.) | |
| SetText( 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. | |
| SetText(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. | |
| SetText( 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. | |
| SuspendChangedEvent |
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.) | |
| ToString | (Inherited from Object.) |
Fields
| Name | Description | |
|---|---|---|
| SfFinalPoseData | This bit will be set in the EventArgs of a Changed event every time the value returned by FinalPoseData may have changed. | |
| SfFinalPosePrepared | This bit will be set in the EventArgs of a Changed event every time the value returned by FinalPosePrepared may have changed. | |
| SfFont | This bit will be set in the EventArgs of a Changed event every time the value returned by Font may have changed. | |
| SfFontRenderParams | This bit will be set in the EventArgs of a Changed event every time the value returned by FontRenderParams may have changed. | |
| SfInitialPose | This bit will be set in the EventArgs of a Changed event every time the value returned by InitialPose may have changed. | |
| SfNextSf | ||
| SfText | This bit will be set in the EventArgs of a Changed event every time the value returned by Text may have changed. |
Properties
| Name | Description | |
|---|---|---|
| ChangedEventSuspended |
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.) | |
| FinalPosePrepared | 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(). | |
| Font | Get or set the font used to compute the desired pose. | |
| FontRenderParams | Get or set the CogOCVMaxFontRenderParams used to compute the desired pose. | |
| HasChanged | (Inherited from CogSerializableChangedEventBase.) | |
| InitialPose | 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. | |
| StateFlags |
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.) | |
| Text | 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). |
Events
| Name | Description | |
|---|---|---|
| Changed |
This event is raised when one or more parts of the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) |
See Also