CogPMAlignPattern ClassCognex VisionPro 9.22 SR1
Class which holds a single PMAlign pattern used for locating features within an image. Primary interface provides access to the training parameters, a method to train the pattern, results of training the pattern, and a method to execute an inspection.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.PMAlign CogPMAlignPattern

Namespace: Cognex.VisionPro.PMAlign
Assembly: Cognex.VisionPro.PMAlign (in Cognex.VisionPro.PMAlign.dll) Version: 87.1.0.0
Syntax

[SerializableAttribute]
public class CogPMAlignPattern : CogObjectBase, 
	ICogNetInternal, IDisposable, ICloneable, ISerializable, ICogHasChanged, 
	IDeserializationCallback, ICogChangedEvent

The CogPMAlignPattern type exposes the following members.

Constructors

  NameDescription
Public methodCogPMAlignPattern 
Constructs a new instance of this class.
Public methodCogPMAlignPattern(IntPtr)
Constructs a new instance of this class using com pointer.
Public methodCogPMAlignPattern(CogPMAlignPattern)
Constructs a new instance of this class as a deep copy of the given instance.
Top
Methods

  NameDescription
Protected methodattachCom
Protected methodClone
Returns a deep copy of this class instance. Derived classes that implement Clone should override this method; other clients who wish to clone this instance should call ICloneable.Clone. See also CogSerializer.DeepCopyObject
Public methodCreateGraphicsCoarse
Gets a collection of graphics that can be used to display the coarse pattern features.
Public methodCreateGraphicsComposite
Gets a collection of graphics that can be used to display the pattern features transformed for the item specified by the composite selected index.If the SelectedIndex is -1, then the graphics returned are for the initial train image.
Public methodCreateGraphicsCompositeFeatures
Gets a collection of graphics that can be used to display the trained features for the item specified by the composite selected index. If the SelectedIndex is -1, then the graphics returned are for the initial train image.
Public methodCreateGraphicsFine
Gets a collection of graphics that can be used to display the fine pattern features.
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.)
Public methodExecute
Run this PMAlign pattern on the given region/image with the given runtime parameters. A results collection will be created and filled with CogPMAlignResult classes in order of decreasing score.
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 methodGetInfoIDs
Public methodGetInfoStrings
Gets train-time diagnostic message text string(s) for this pattern. If there are no messages then the collection will be empty. The corresponding message ID(s) can be obtained from GetInfoIDs.
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetObjectData
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 methodGetTrainedPatternImage
Gets the image used to train the PMAlign pattern. This is the smallest possible sub-image of TrainImage that contains the TrainRegion. Actual features within the sub-image that are trained depends on the TrainRegionMode and TrainImageMask.
Public methodGetTrainedPatternImageMask
Gets the actual mask image used to train the current pattern. This mask is the combination of the TrainImageMask and any mask that may be required by TrainRegionMode. This mask is the same size as the image returned by GetTrainedPatternImage.
Public methodGetTrainedPatternShapeModels
Gets the actual shape models used to train the current pattern. The user provided shape models are clipped using the pixel aligned bounding box of TrainRegion when TrainRegion is not nothing.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodImportFromCvlArchive
Loads a ccPMAlignPattern class from the specified CVL archive file into this CogPMAlignPattern class. The archive should contain only a single ccPMAlignPattern class. Non-CVL parameters are set to their default VisionPro values.
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 methodOnDeserialization
Public methodPCPLoadFromFile
Customizes this PMAlign pattern using the customization string (PCP) in the file specified by Filename.
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called. Also 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.
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.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodTrain
Trains this PMAlign pattern. If the pattern is already trained then it will be untrained and retrained.
Public methodUntrain
Untrain this pattern.
Top
Fields

  NameDescription
Protected field__com
Protected field__disposed
Protected fieldStatic member__factory
Protected fieldStatic memberCreator
Public fieldStatic memberSfAutoEdgeThresholdEnabled
This bit will be set in the EventArgs of a Changed event every time the value returned by GetAutoEdgeThresholdEnabled may have changed.
Public fieldStatic memberSfComposite
This bit will be set in the EventArgs of a Changed event every time the value returned by Composite may have changed.
Public fieldStatic memberSfCreateGraphicsCoarse
This bit will be set in the EventArgs of a Changed event every time the value returned by CreateGraphicsCoarse may have changed.
Public fieldStatic memberSfCreateGraphicsFine
This bit will be set in the EventArgs of a Changed event every time the value returned by CreateGraphicsFine may have changed.
Public fieldStatic memberSfEdgeThreshold
This bit will be set in the EventArgs of a Changed event every time the value returned by GetEdgeThreshold may have changed.
Public fieldStatic memberSfElasticity
This bit will be set in the EventArgs of a Changed event every time the value returned by Elasticity may have changed.
Public fieldStatic memberSfExpectedDeformationRate
This bit will be set in the EventArgs of a Changed event every time the value returned by ExpectedDeformationRate may have changed.
Public fieldStatic memberSfGetInfoIDs
This bit will be set in the EventArgs of a Changed event every time the value returned by GetInfoIDs may have changed.
Public fieldStatic memberSfGetInfoStrings
This bit will be set in the EventArgs of a Changed event every time the value returned by GetInfoStrings may have changed.
Public fieldStatic memberSfGetTrainedPatternImage
This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedPatternImage may have changed.
Public fieldStatic memberSfGetTrainedPatternImageMask
This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedPatternImageMask may have changed.
Public fieldStatic memberSfGetTrainedPatternShapeModels
This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedPatternShapeModels may have changed.
Public fieldStatic memberSfGrainLimitAutoSelect
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitAutoSelect may have changed.
Public fieldStatic memberSfGrainLimitCoarse
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitCoarse may have changed.
Public fieldStatic memberSfGrainLimitFine
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitFine may have changed.
Public fieldStatic memberSfHighSensitivityParameter
This bit will be set in the EventArgs of a Changed event every time the value returned by HighSensitivityParameter may have changed.
Public fieldStatic memberSfIgnorePolarity
This bit will be set in the EventArgs of a Changed event every time the value returned by IgnorePolarity may have changed.
Public fieldStatic memberSfOrigin
This bit will be set in the EventArgs of a Changed event every time the value returned by Origin may have changed.
Public fieldStatic memberSfPCPString
This bit will be set in the EventArgs of a Changed event every time the value returned by PCPString may have changed.
Public fieldStatic memberSfRepeatingPatterns
This bit will be set in the EventArgs of a Changed event every time the value returned by GetRepeatingPatterns may have changed.
Public fieldStatic memberSfRuntimeScoringMethod
This bit will be set in the EventArgs of a Changed event every time the value returned by RuntimeScoringMethod may have changed.
Public fieldStatic memberSfTrainAlgorithm
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainAlgorithm may have changed.
Public fieldStatic memberSfTrained
This bit will be set in the EventArgs of a Changed event every time the value returned by Trained may have changed.
Public fieldStatic memberSfTrainImage
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImage may have changed.
Public fieldStatic memberSfTrainImageMask
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImageMask may have changed.
Public fieldStatic memberSfTrainImageMaskOffsetX
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImageMaskOffsetX may have changed.
Public fieldStatic memberSfTrainImageMaskOffsetY
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImageMaskOffsetY may have changed.
Public fieldStatic memberSfTrainMode
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainMode may have changed.
Public fieldStatic memberSfTrainRegion
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainRegion may have changed.
Public fieldStatic memberSfTrainRegionMode
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainRegionMode may have changed.
Public fieldStatic memberSfTrainShapeModels
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainShapeModels may have changed.
Public fieldStatic memberSfTrainShapeModelsTransform
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainShapeModelsTransform may have changed.
Top
Properties

  NameDescription
Public propertyAutoEdgeThresholdEnabled
If true, an automatically computed edge threshold will be used for training. If false, the user provided edge threshold will be used.
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.
Public propertyComposite
Gets or sets the CogPMAlignComposite object.
Public propertyEdgeThreshold
Train-time edge threshold, under which, the edges will be ignored. Valid value is from 0.0 to 65535.0. Default value is 10.0.
Public propertyElasticity
The elasticity value is the amount of feature variance, in pixels, that PMAlign allows. Setting a nonzero elasticity value permits PMAlign to find pattern instances with nonlinear geometric variation to be found.
Public propertyExpectedDeformationRate
The expected deformation rate of the PatFlex pattern. This has no effect unless the TrainAlgorithm is PatFlex.
Public propertyGrainLimitAutoSelect
If true then PMAlign will automatically generate grain limits during training. If false then the values stored in the pattern prior to training will be used.
Public propertyGrainLimitCoarse
Coarse granularity limit. User can manually set the grain limit if GrainLimitAutoSelect is false. Valid range is 1.0 to 25.5 inclusive. Coarse must be greater than or equal to fine. Setting coarse less than fine will also set fine to the new value.
Public propertyGrainLimitFine
Fine granularity limit. User can manually set the grain limit if GrainLimitAutoSelect is false. Valid range is 1.0 to 25.5 inclusive. Coarse must be greater than or equal to fine. Setting fine greater than coarse will also set coarse to the new value.
Public propertyHasChanged
If true, the serializable state of this object has changed since the last time it was serialized.
Public propertyHighSensitivityParameter
Control the sensitivity parameter used by PatMax when TrainAlgorithm is cogPMAlignTrainAlgorithmPatMaxHighSensitivity.
Public propertyIgnorePolarity
If true, pattern polarity is ignored. If false, only patterns with polarity matching the trained pattern will be found.
Public propertyOrigin
A 6 DOF origin for the pattern. This transform maps from "Pattern Space" to the selected space of TrainImage.
Public propertyPCPDiagMessage
Diagnostic data string for use by Cognex.
Public propertyPCPString
Customization string (PCP) used to customize this PMAlign pattern. The PCP string can be set by either setting the PCPString property directly or calling the PCPLoadFromFile method. An empty string indicates that no PCP is set for this pattern.
Public propertyRepeatingPatterns
If true and training algorithm is Patmax, the pattern will be trained specially for repeating patterns. Otherwise, the pattern will be trained as before.
Public propertyRuntimeScoringMethod
Instructs the pattern how to treat non-visible pixels at run-time.
Public propertyTrainAlgorithm
Algorithm(s) used to train this PMAlign pattern. The PMAlign pattern can only be executed using the algorithms that were enabled at train-time. The algorithm actually used at run-time is specified in ICogPMAlignRunParams.
Public propertyTrained
True if the pattern is trained.
Public propertyTrainImage
Pattern image used to train PMAlign. The TrainRegion is applied to this TrainImage in order to define the region that will be used to train the pattern. The TrainRegionMode property specifies how the region will be applied to this image.
Public propertyTrainImageMask
Mask used when training the PMAlign pattern. The mask allows the user to identify areas of the pattern as "Care" or "Don't Care". The "Don't Care" areas can also be subclassified into "Score" and "Don't Score" with regards to clutter.
Public propertyTrainImageMaskOffsetX
X offset value in pixels. The X & Y offset values measure the offset from the upper-left corner of the TrainImage to the upper-left corner of the TrainImageMask in image coordinates of the TrainImage.
Public propertyTrainImageMaskOffsetY
Y offset value in pixels. The X & Y offset values measure the offset from the upper-left corner of the TrainImage to the upper-left corner of the TrainImageMask in image coordinates of the TrainImage.
Public propertyTrainMode
Train mode indicates whether a PMAlign pattern should be trained based on the pixel content of the training image or trained based on a synthetic pattern described by a collection of shape models.
Public propertyTrainRegion
Region of interest indicating portion of TrainImage or TrainShapeModels that will be used to train the pattern. A NULL TrainRegion indicates that the entire TrainImage or TrainShapeModels will be used to train the PMAlign pattern.
Public propertyTrainRegionMode
Specifies how the TrainRegion is applied to the TrainImage.
Public propertyTrainShapeModels
A collection of shape models used to train a PMAlign pattern when the TrainMode property is either cogPMAlignTrainModeShapeModelsWithImage or cogPMAlignTrainModeShapeModelsWithTransform.
Public propertyTrainShapeModelsTransform
Transform defines the space of all shape models when TrainMode is cogPMAlignTrainModeShapeModelsWithTransform, otherwise, this transform is ignored. This is a pixel from shape model space transform.
Top
Events

  NameDescription
Public eventChanged
Occurs when one or more parts of the object's state may have changed.
Top
Remarks

The <see cref="T:Cognex.VisionPro.PMAlign.CogPMAlignPattern"/> interface provides access to all of the properties that define the pattern you are searching for.<para>Finally, be aware that <see cref="T:Cognex.VisionPro.PMAlign.CogPMAlignPattern"/> requires that the handedness of the train-time coordinate space and the handedness of the run-time coordinate space be the same. They may both be left handed, or they may both be right handed, but they may not differ. Observe that a handedness swap is conceptually a 180 degree skew. And this pattern matching algorithm does not support skew as a degree of freedom over which it will search for matches.
See Also