CogCNLSearchPattern ClassCognex VisionPro 9.10
Class which holds a single CNLSearch 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.CNLSearch CogCNLSearchPattern

Namespace: Cognex.VisionPro.CNLSearch
Assembly: Cognex.VisionPro.CNLSearch (in Cognex.VisionPro.CNLSearch.dll) Version: 79.0.0.0
Syntax

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

The CogCNLSearchPattern type exposes the following members.

Constructors

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

  NameDescription
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 methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExecute
Run this CNLSearch pattern on the given region/image with the given runtime parameters. A results collection will be created and filled with CogCNLSearchResult 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 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 current pattern. How this image is generated depends on the TrainRegionMode. Actual features within this image that are trained also depends on the TrainRegionMode, as well as the 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 methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodImportFromCvlArchive
Loads a ccCnlSearchModel class from the specified CVL archive file into this CogCNLSearchPattern class. The archive should contain only a single ccCnlSearchModel 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 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 CNLSearch pattern. If the pattern is already trained then it will be untrained and retrained.
Public methodUntrain
Untrain this pattern.
Top
Fields

  NameDescription
Public fieldStatic memberSfAccuracies
This bit will be set in the EventArgs of a Changed event every time the value returned by Accuracies may have changed.
Public fieldStatic memberSfAdvancedTrainingEnabled
This bit will be set in the EventArgs of a Changed event every time the value returned by AdvancedTrainingEnabled may have changed.
Public fieldStatic memberSfAlgorithms
This bit will be set in the EventArgs of a Changed event every time the value returned by Algorithms may have changed.
Public fieldStatic memberSfEdgeThresholdHigh
This bit will be set in the EventArgs of a Changed event every time the value returned by EdgeThresholdHigh may have changed.
Public fieldStatic memberSfEdgeThresholdLow
This bit will be set in the EventArgs of a Changed event every time the value returned by EdgeThresholdLow 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 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 memberSfOriginX
This bit will be set in the EventArgs of a Changed event every time the value returned by OriginX may have changed.
Public fieldStatic memberSfOriginY
This bit will be set in the EventArgs of a Changed event every time the value returned by OriginY may have changed.
Public fieldStatic memberSfPartialMatchLimitDown
This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitDown may have changed.
Public fieldStatic memberSfPartialMatchLimitLeft
This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitLeft may have changed.
Public fieldStatic memberSfPartialMatchLimitRight
This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitRight may have changed.
Public fieldStatic memberSfPartialMatchLimitUp
This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitUp 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 memberSfTrainedEdgeImage
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedEdgeImage may have changed.
Public fieldStatic memberSfTrainedPatternHeight
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedPatternHeight may have changed.
Public fieldStatic memberSfTrainedPatternWidth
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedPatternWidth 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 propertyAccuracies
Specifies the accuracies for which to train this CNLSearch pattern. Multiple accuracies may be trained by performing a bitwise OR of the accuracy constants.
Public propertyAdvancedTrainingEnabled
Advanced training only applies to the Linear Search algorithm. It should only be enabled if CNLSearch is returning inaccurate result locations. Enabling advanced training will cause longer training time and may effect execution time.
Public propertyAlgorithms
Specifies the algorithm(s) for which to train this CNLSearch pattern. Multiple algorithms may be trained by performing a bitwise OR of the algorithm constants.
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 propertyEdgeThresholdHigh
All edges with strengths above the high threshold are included in the trained pattern. Only applies to NonLinear CNLPAS.
Public propertyEdgeThresholdLow
Edges with strengths below the low threshold are excluded from the trained pattern. Edges with strengths between low & high (inclusive) are included if 8-connected to an edge already belonging to the trained pattern. Only applies to NonLinear CNLPAS.
Public propertyHasChanged
If true, the serializable state of this object has changed since the last time it was serialized.
Public propertyIgnorePolarity
If true, pattern polarity is ignored. If false, only patterns with polarity matching the trained pattern will be found. Only applies to linear search. Linear CNLPAS never ignores polarity. NonLinear CNLPAS always ignores polarity.
Public propertyOriginX
The X component of the origin of this CNLSearch pattern. The location returned by a CogCNLSearchResult is the position of the origin in the search image.
Public propertyOriginY
The Y component of the origin of this CNLSearch pattern. The location returned by a CogCNLSearchResult is the position of the origin in the search image.
Public propertyPartialMatchLimitDown
Limit-down specifies how many rows of pixels at the bottom of the pattern may lie outside of the search region and still be found. Partial match results are not supported by the CNLPAS algorithms.
Public propertyPartialMatchLimitLeft
Limit-left specifies how many columns of pixels on the left side of the pattern may lie outside of the search region and still be found. Partial match results are not supported by the CNLPAS algorithms.
Public propertyPartialMatchLimitRight
Limit-right specifies how many columns of pixels on the right side of the pattern may lie outside of the search region and still be found. Partial match results are not supported by the CNLPAS algorithms.
Public propertyPartialMatchLimitUp
Limit-up specifies how many rows of pixels at the top of the pattern may lie outside of the search region and still be found. Partial match results are not supported by the CNLPAS algorithms.
Public propertyTrained
True if the pattern is trained.
Public propertyTrainedEdgeImage
Gets an image containing the trained edge pattern. Pixels in the TrainedEdgeImage will be either 255 if the pixel is part of the edge pattern or 0 if the pixel is not part of the edge pattern.
Public propertyTrainedPatternHeight
Gets the height (in pixels) of the trained pattern. This is the same as the height of the images returned by GetTrainedPatternImage, GetTrainedPatternImageMask, & TrainedEdgeImage.
Public propertyTrainedPatternWidth
Gets the width (in pixels) of the trained pattern. This is the same as the width of the images returned by GetTrainedPatternImage, GetTrainedPatternImageMask, & TrainedEdgeImage.
Public propertyTrainImage
Pattern image used to train CNLSearch. 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
A mask which allows the user to identify areas of the pattern as care or don't care. TrainImage pixels that correspond to don't care mask pixels are not trained as part of the pattern. Mask is not supported by the CNLPAS algorithms.
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 CNLSearch 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

Provides access to all of the train time parameters and to the results of training a CNLSearch pattern. You must train the pattern by calling Train  before searching. You locate the trained pattern by calling Execute(CogImage8Grey, ICogRegion, CogCNLSearchRunParams).

See Also