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 MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.PMAlign CogPMAlignPattern
Namespace: Cognex.VisionPro.PMAlign
Assembly: Cognex.VisionPro.PMAlign (in Cognex.VisionPro.PMAlign.dll) Version: 69.0.0.0
Syntax
The CogPMAlignPattern type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogPMAlignPattern | Constructs a new instance of this class. | |
| CogPMAlignPattern(IntPtr) | Constructs a new instance of this class using com pointer. | |
| CogPMAlignPattern(CogPMAlignPattern) | Constructs a new instance of this class as a deep copy of the given instance. |
Methods
| Name | Description | |
|---|---|---|
| Clone | 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 | |
| CreateGraphicsCoarse | Gets a collection of graphics that can be used to display the coarse pattern features. | |
| CreateGraphicsComposite | 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. | |
| CreateGraphicsCompositeFeatures | 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. | |
| CreateGraphicsFine | Gets a collection of graphics that can be used to display the fine pattern features. | |
| 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.) | |
| Dispose | ||
| Dispose(Boolean) | ||
| Equals | (Inherited from Object.) | |
| Execute | 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. | |
| Finalize | (Overrides Object Finalize .) | |
| 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.) | |
| GetInfoIDs | ||
| GetInfoStrings | 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. | |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetObjectData | ||
| 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.) | |
| GetTrainedPatternImage | 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. | |
| GetTrainedPatternImageMask | 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. | |
| GetTrainedPatternShapeModels | 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. | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| ImportFromCvlArchive | 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. | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| 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.) | |
| OnDeserialization | ||
| PCPLoadFromFile | Customizes this PMAlign pattern using the customization string (PCP) in the file specified by Filename. | |
| ResumeAndRaiseChangedEvent | 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. | |
| 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. | |
| ToString | (Inherited from Object.) | |
| Train | Trains this PMAlign pattern. If the pattern is already trained then it will be untrained and retrained. | |
| Untrain | Untrain this pattern. |
Fields
| Name | Description | |
|---|---|---|
| SfAutoEdgeThresholdEnabled | This bit will be set in the EventArgs of a Changed event every time the value returned by GetAutoEdgeThresholdEnabled may have changed. | |
| SfComposite | This bit will be set in the EventArgs of a Changed event every time the value returned by Composite may have changed. | |
| SfCreateGraphicsCoarse | This bit will be set in the EventArgs of a Changed event every time the value returned by CreateGraphicsCoarse may have changed. | |
| SfCreateGraphicsFine | This bit will be set in the EventArgs of a Changed event every time the value returned by CreateGraphicsFine may have changed. | |
| SfEdgeThreshold | This bit will be set in the EventArgs of a Changed event every time the value returned by GetEdgeThreshold may have changed. | |
| SfElasticity | This bit will be set in the EventArgs of a Changed event every time the value returned by Elasticity may have changed. | |
| SfExpectedDeformationRate | This bit will be set in the EventArgs of a Changed event every time the value returned by ExpectedDeformationRate may have changed. | |
| SfGetInfoIDs | This bit will be set in the EventArgs of a Changed event every time the value returned by GetInfoIDs may have changed. | |
| SfGetInfoStrings | This bit will be set in the EventArgs of a Changed event every time the value returned by GetInfoStrings may have changed. | |
| SfGetTrainedPatternImage | This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedPatternImage may have changed. | |
| SfGetTrainedPatternImageMask | This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedPatternImageMask may have changed. | |
| SfGetTrainedPatternShapeModels | This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedPatternShapeModels may have changed. | |
| SfGrainLimitAutoSelect | This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitAutoSelect may have changed. | |
| SfGrainLimitCoarse | This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitCoarse may have changed. | |
| SfGrainLimitFine | This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitFine may have changed. | |
| SfHighSensitivityParameter | This bit will be set in the EventArgs of a Changed event every time the value returned by HighSensitivityParameter may have changed. | |
| SfIgnorePolarity | This bit will be set in the EventArgs of a Changed event every time the value returned by IgnorePolarity may have changed. | |
| SfOrigin | This bit will be set in the EventArgs of a Changed event every time the value returned by Origin may have changed. | |
| SfPCPString | This bit will be set in the EventArgs of a Changed event every time the value returned by PCPString may have changed. | |
| SfRepeatingPatterns | This bit will be set in the EventArgs of a Changed event every time the value returned by GetRepeatingPatterns may have changed. | |
| SfRuntimeScoringMethod | This bit will be set in the EventArgs of a Changed event every time the value returned by RuntimeScoringMethod may have changed. | |
| SfTrainAlgorithm | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainAlgorithm may have changed. | |
| SfTrained | This bit will be set in the EventArgs of a Changed event every time the value returned by Trained may have changed. | |
| SfTrainImage | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImage may have changed. | |
| SfTrainImageMask | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImageMask may have changed. | |
| SfTrainImageMaskOffsetX | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImageMaskOffsetX may have changed. | |
| SfTrainImageMaskOffsetY | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainImageMaskOffsetY may have changed. | |
| SfTrainMode | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainMode may have changed. | |
| SfTrainRegion | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainRegion may have changed. | |
| SfTrainRegionMode | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainRegionMode may have changed. | |
| SfTrainShapeModels | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainShapeModels may have changed. | |
| SfTrainShapeModelsTransform | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainShapeModelsTransform may have changed. |
Properties
| Name | Description | |
|---|---|---|
| AutoEdgeThresholdEnabled | If true, an automatically computed edge threshold will be used for training. If false, the user provided edge threshold will be used. | |
| 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. | |
| Composite | Gets or sets the CogPMAlignComposite object. | |
| EdgeThreshold | 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. | |
| Elasticity | 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. | |
| ExpectedDeformationRate | The expected deformation rate of the PatFlex pattern. This has no effect unless the TrainAlgorithm is PatFlex. | |
| GrainLimitAutoSelect | 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. | |
| GrainLimitCoarse | 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. | |
| GrainLimitFine | 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. | |
| HasChanged | If true, the serializable state of this object has changed since the last time it was serialized. | |
| HighSensitivityParameter | Control the sensitivity parameter used by PatMax when TrainAlgorithm is cogPMAlignTrainAlgorithmPatMaxHighSensitivity. | |
| IgnorePolarity | If true, pattern polarity is ignored. If false, only patterns with polarity matching the trained pattern will be found. | |
| Origin | A 6 DOF origin for the pattern. This transform maps from "Pattern Space" to the selected space of TrainImage. | |
| PCPDiagMessage | Diagnostic data string for use by Cognex. | |
| PCPString | 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. | |
| RepeatingPatterns | If true and training algorithm is Patmax, the pattern will be trained specially for repeating patterns. Otherwise, the pattern will be trained as before. | |
| RuntimeScoringMethod | Instructs the pattern how to treat non-visible pixels at run-time. | |
| TrainAlgorithm | 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. | |
| Trained | True if the pattern is trained. | |
| TrainImage | 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. | |
| TrainImageMask | 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. | |
| TrainImageMaskOffsetX | 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. | |
| TrainImageMaskOffsetY | 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. | |
| TrainMode | 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. | |
| TrainRegion | 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. | |
| TrainRegionMode | Specifies how the TrainRegion is applied to the TrainImage. | |
| TrainShapeModels | A collection of shape models used to train a PMAlign pattern when the TrainMode property is either cogPMAlignTrainModeShapeModelsWithImage or cogPMAlignTrainModeShapeModelsWithTransform. | |
| TrainShapeModelsTransform | 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. |
Events
| Name | Description | |
|---|---|---|
| Changed | Occurs when one or more parts of the object's state may have changed. |
Remarks
The CogPMAlignPattern interface provides access to all of the properties that define the pattern you are searching for.
See Also