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 MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.CNLSearch CogCNLSearchPattern
Namespace: Cognex.VisionPro.CNLSearch
Assembly: Cognex.VisionPro.CNLSearch (in Cognex.VisionPro.CNLSearch.dll) Version: 87.0.0.0
Syntax
The CogCNLSearchPattern type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogCNLSearchPattern | Constructs a new instance of this class. | |
| CogCNLSearchPattern(IntPtr) | Constructs a new instance of this class using com pointer. | |
| CogCNLSearchPattern(CogCNLSearchPattern) | Constructs a new instance of this class as a deep copy of the given instance. |
Methods
| Name | Description | |
|---|---|---|
| attachCom | ||
| 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) | ||
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
| Execute | 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. | |
| 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 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. | |
| 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. | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| ImportFromCvlArchive | 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. | |
| 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. | |
| 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 | Returns a String that represents the current Object. (Inherited from Object.) | |
| Train | Trains this CNLSearch pattern. If the pattern is already trained then it will be untrained and retrained. | |
| Untrain | Untrain this pattern. |
Fields
| Name | Description | |
|---|---|---|
| __com | ||
| __disposed | ||
| __factory | ||
| Creator | ||
| SfAccuracies | This bit will be set in the EventArgs of a Changed event every time the value returned by Accuracies may have changed. | |
| SfAdvancedTrainingEnabled | This bit will be set in the EventArgs of a Changed event every time the value returned by AdvancedTrainingEnabled may have changed. | |
| SfAlgorithms | This bit will be set in the EventArgs of a Changed event every time the value returned by Algorithms may have changed. | |
| SfEdgeThresholdHigh | This bit will be set in the EventArgs of a Changed event every time the value returned by EdgeThresholdHigh may have changed. | |
| SfEdgeThresholdLow | This bit will be set in the EventArgs of a Changed event every time the value returned by EdgeThresholdLow 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. | |
| SfIgnorePolarity | This bit will be set in the EventArgs of a Changed event every time the value returned by IgnorePolarity may have changed. | |
| SfOriginX | This bit will be set in the EventArgs of a Changed event every time the value returned by OriginX may have changed. | |
| SfOriginY | This bit will be set in the EventArgs of a Changed event every time the value returned by OriginY may have changed. | |
| SfPartialMatchLimitDown | This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitDown may have changed. | |
| SfPartialMatchLimitLeft | This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitLeft may have changed. | |
| SfPartialMatchLimitRight | This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitRight may have changed. | |
| SfPartialMatchLimitUp | This bit will be set in the EventArgs of a Changed event every time the value returned by PartialMatchLimitUp 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. | |
| SfTrainedEdgeImage | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedEdgeImage may have changed. | |
| SfTrainedPatternHeight | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedPatternHeight may have changed. | |
| SfTrainedPatternWidth | This bit will be set in the EventArgs of a Changed event every time the value returned by TrainedPatternWidth 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 | |
|---|---|---|
| Accuracies | Specifies the accuracies for which to train this CNLSearch pattern. Multiple accuracies may be trained by performing a bitwise OR of the accuracy constants. | |
| AdvancedTrainingEnabled | 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. | |
| Algorithms | 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. | |
| 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. | |
| EdgeThresholdHigh | All edges with strengths above the high threshold are included in the trained pattern. Only applies to NonLinear CNLPAS. | |
| EdgeThresholdLow | 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. | |
| HasChanged | If true, the serializable state of this object has changed since the last time it was serialized. | |
| IgnorePolarity | 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. | |
| OriginX | 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. | |
| OriginY | 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. | |
| PartialMatchLimitDown | 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. | |
| PartialMatchLimitLeft | 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. | |
| PartialMatchLimitRight | 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. | |
| PartialMatchLimitUp | 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. | |
| Trained | True if the pattern is trained. | |
| TrainedEdgeImage | 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. | |
| TrainedPatternHeight | Gets the height (in pixels) of the trained pattern. This is the same as the height of the images returned by GetTrainedPatternImage, GetTrainedPatternImageMask, & TrainedEdgeImage. | |
| TrainedPatternWidth | Gets the width (in pixels) of the trained pattern. This is the same as the width of the images returned by GetTrainedPatternImage, GetTrainedPatternImageMask, & TrainedEdgeImage. | |
| TrainImage | 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. | |
| TrainImageMask | 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. | |
| 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 CNLSearch 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
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