Provides access to the train time parameters and to the results of training a PatInspect pattern. The pattern must be trained via the Train method prior to performing an inspection which is done by calling the Execute method.
Inheritance Hierarchy
System MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.PatInspect CogPatInspectPattern
Namespace: Cognex.VisionPro.PatInspect
Assembly: Cognex.VisionPro.PatInspect (in Cognex.VisionPro.PatInspect.dll) Version: 69.0.0.0
Syntax
The CogPatInspectPattern type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogPatInspectPattern | Constructs a new instance of this class. | |
| CogPatInspectPattern(IntPtr) | Constructs a new instance of this class using com pointer. | |
| CogPatInspectPattern(CogPatInspectPattern) | 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 | |
| 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) | ||
| EndStatisticalTraining | End statistical training on this pattern. No further statistical training may be performed after calling this method. Calling this method will free some internal data, causing this object to use less memory. | |
| Equals | (Inherited from Object.) | |
| Execute | Perform a PatInspect inspection on the provided input image. The Pose maps from "Pattern Space" to the selected space of the input image and is used to align the pattern with the features that will be inspected in the input image. | |
| 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.) | |
| 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 an image that represents the currently trained pattern. This is a template image that incorporates pixel data from all of the statistically trained images. | |
| GetTrainedPatternImageMask | Gets an image representing the mask 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. | |
| GetTrainedThresholdImage | Gets an image representing the currently trained threshold image. Pixel differences at run-time that are greater than the corresponding threshold image pixel are considered defects. This image is the same size as the GetTrainedPatternImage. | |
| 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.) | |
| 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 | ||
| 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. | |
| StatisticalTrain | Statistically incorporates the provided image into the existing pattern. The Pose maps from "Pattern Space" to the selected space of StatisticalTrainImage and is used to align the features of the original TrainImage with the StatisticalTrainImage. | |
| 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 PatInspect pattern. If the pattern is already trained then it will be untrained and retrained. | |
| Untrain | Untrain this pattern. All statistical trained data will be lost. |
Fields
| Name | Description | |
|---|---|---|
| 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. | |
| SfGetTrainedThresholdImage | This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedThresholdImage may have changed. | |
| SfInterpolationMode | This bit will be set in the EventArgs of a Changed event every time the value returned by InterpolationMode 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. | |
| SfSobelOffset | This bit will be set in the EventArgs of a Changed event every time the value returned by SobelOffset may have changed. | |
| SfSobelScale | This bit will be set in the EventArgs of a Changed event every time the value returned by SobelScale may have changed. | |
| SfStatisticalTrainingEnded | This bit will be set in the EventArgs of a Changed event every time the value returned by StatisticalTrainingEnded may have changed. | |
| SfThresholdOffset | This bit will be set in the EventArgs of a Changed event every time the value returned by ThresholdOffset may have changed. | |
| SfThresholdScale | This bit will be set in the EventArgs of a Changed event every time the value returned by ThresholdScale 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. | |
| SfTrainedCount | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedCount 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. | |
| 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. |
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. | |
| HasChanged | If true, the serializable state of this object has changed since the last time it was serialized. | |
| InterpolationMode | Specifies how affine transforms are applied. | |
| Origin | A 6 DOF origin for the pattern. This transform maps from "Pattern Space" to the selected space of TrainImage. | |
| SobelOffset | The Sobel coefficients are used to compute a pseudo standard deviation image when the pattern has been trained from a single image. Standard Deviation Pixel = [SobelScale * Sobel Magnitude Pixel Value] + SobelOffset. | |
| SobelScale | The Sobel coefficients are used to compute a pseudo standard deviation image when the pattern has been trained from a single image. Standard Deviation Pixel = [SobelScale * Sobel Magnitude Pixel Value] + SobelOffset. | |
| StatisticalTrainingEnded | Gets whether (statistical) training of this pattern has been ended. | |
| ThresholdOffset | The threshold coefficients are used to compute a threshold image from the standard deviation image. Threshold Pixel = [ThresholdScale * Standard Deviation Pixel] + ThresholdOffset. | |
| ThresholdScale | The threshold coefficients are used to compute a threshold image from the standard deviation image. Threshold Pixel = [ThresholdScale * Standard Deviation Pixel] + ThresholdOffset. | |
| Trained | True if the pattern is trained. | |
| TrainedCount | The number of images that are statistically incorporated into the pattern. This number is equal to the number of times StatisticalTrain has been called plus one for the initial call to Train. | |
| TrainImage | Image used to train PatInspect. Additional images may be incorporated into the pattern using the StatisticalTrain method. The TrainRegion is applied to this TrainImage in order to define the region that will be used to train the pattern. | |
| TrainImageMask | Mask used when training the PatInspect pattern. The mask allows the user to identify areas of the pattern as "Care" (128-255) or "Don't Care" (0-127). | |
| 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. | |
| TrainRegion | Region of interest in the TrainImage that will be used to train the pattern. A NULL TrainRegion indicates that the entire TrainImage will be used to train the PatInspect pattern. | |
| TrainRegionMode | Specifies how the TrainRegion is applied to the TrainImage. |
Events
| Name | Description | |
|---|---|---|
| Changed | Occurs when one or more parts of the object's state may have changed. |
Remarks
Provide access to the train time parameters and the trained pattern. The pattern must be trained using the Train method before performing an inspection. Perform the inspection by calling the Execute method.
See Also