CogPatInspectPattern ClassCognex VisionPro 9.20
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 Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.PatInspect CogPatInspectPattern

Namespace: Cognex.VisionPro.PatInspect
Assembly: Cognex.VisionPro.PatInspect (in Cognex.VisionPro.PatInspect.dll) Version: 80.0.0.0
Syntax

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

The CogPatInspectPattern type exposes the following members.

Constructors

  NameDescription
Public methodCogPatInspectPattern 
Constructs a new instance of this class.
Public methodCogPatInspectPattern(IntPtr)
Constructs a new instance of this class using com pointer.
Public methodCogPatInspectPattern(CogPatInspectPattern)
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 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 methodEndStatisticalTraining
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.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExecute
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.
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 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 an image that represents the currently trained pattern. This is a template image that incorporates pixel data from all of the statistically trained images.
Public methodGetTrainedPatternImageMask
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.
Public methodGetTrainedThresholdImage
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.
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.)
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 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 methodStatisticalTrain
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.
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 PatInspect pattern. If the pattern is already trained then it will be untrained and retrained.
Public methodUntrain
Untrain this pattern. All statistical trained data will be lost.
Top
Fields

  NameDescription
Protected field__com
Protected field__disposed
Protected fieldStatic member__factory
Protected fieldStatic memberCreator
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 memberSfGetTrainedThresholdImage
This bit will be set in the EventArgs of a Changed event every time the value returned by GetTrainedThresholdImage may have changed.
Public fieldStatic memberSfInterpolationMode
This bit will be set in the EventArgs of a Changed event every time the value returned by InterpolationMode 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 memberSfSobelOffset
This bit will be set in the EventArgs of a Changed event every time the value returned by SobelOffset may have changed.
Public fieldStatic memberSfSobelScale
This bit will be set in the EventArgs of a Changed event every time the value returned by SobelScale may have changed.
Public fieldStatic memberSfStatisticalTrainingEnded
This bit will be set in the EventArgs of a Changed event every time the value returned by StatisticalTrainingEnded may have changed.
Public fieldStatic memberSfThresholdOffset
This bit will be set in the EventArgs of a Changed event every time the value returned by ThresholdOffset may have changed.
Public fieldStatic memberSfThresholdScale
This bit will be set in the EventArgs of a Changed event every time the value returned by ThresholdScale 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 memberSfTrainedCount
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedCount 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 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.
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.
Public propertyHasChanged
If true, the serializable state of this object has changed since the last time it was serialized.
Public propertyInterpolationMode
Specifies how affine transforms are applied.
Public propertyOrigin
A 6 DOF origin for the pattern. This transform maps from "Pattern Space" to the selected space of TrainImage.
Public propertySobelOffset
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.
Public propertySobelScale
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.
Public propertyStatisticalTrainingEnded
Gets whether (statistical) training of this pattern has been ended.
Public propertyThresholdOffset
The threshold coefficients are used to compute a threshold image from the standard deviation image. Threshold Pixel = [ThresholdScale * Standard Deviation Pixel] + ThresholdOffset.
Public propertyThresholdScale
The threshold coefficients are used to compute a threshold image from the standard deviation image. Threshold Pixel = [ThresholdScale * Standard Deviation Pixel] + ThresholdOffset.
Public propertyTrained
True if the pattern is trained.
Public propertyTrainedCount
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.
Public propertyTrainImage
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.
Public propertyTrainImageMask
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).
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 propertyTrainRegion
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.
Public propertyTrainRegionMode
Specifies how the TrainRegion is applied to the TrainImage.
Top
Events

  NameDescription
Public eventChanged
Occurs when one or more parts of the object's state may have changed.
Top
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