CogBeadInspectPattern ClassCognex VisionPro 9.10
Class that represents a BeadInspect pattern. You can use the methods of this class to find coarse path candidates for training, to train a new path, and to detect defects in a runtime image.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro.EdgeInspect CogBeadInspectPattern

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

[SerializableAttribute]
public class CogBeadInspectPattern : CogSerializableChangedEventBase, 
	IDisposable

The CogBeadInspectPattern type exposes the following members.

Constructors

  NameDescription
Public methodCogBeadInspectPattern 
Constructs a default CogBeadInspectPattern object. This new pattern contains a default set of find params. You must train this object before you can use it to detect defects.
Public methodCogBeadInspectPattern(CogBeadInspectPattern)
Constructs a deep copy of the supplied CogBeadInspectPattern object.
Protected methodCogBeadInspectPattern(SerializationInfo, StreamingContext)
Serialization constructor for CogBeadInspectPattern object.
Top
Methods

  NameDescription
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 
Releases all resources used by this CogBeadInspectPattern object.
Protected methodDispose(Boolean)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExecute
Examine the given inputImage for defects along the trained bead path. The analysis is performed using the supplied runParams.
Protected methodFinalize
Releases all unmanaged resources used by this CogBeadInspectPattern object.
(Overrides Object Finalize .)
Public methodFind
Finds one or more coarse bead paths.
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
Populates the provided SerializationInfo with the data needed to serialize the object.
(Overrides CogSerializableObjectBase GetObjectData(SerializationInfo, StreamingContext).)
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 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 methodOnChanged(Int64)
This method should be called internally whenever the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Protected methodOnChanged(CogChangedEventArgs)
This method may be called internally whenever a derived object's state may have changed and the derived object expresses this change via a derived CogChangedEventArgs class.
(Inherited from CogSerializableChangedEventBase.)
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called, and 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.
(Inherited from CogSerializableChangedEventBase.)
Public methodSetCoarseContour
Updates the internal bead find result data using the provided coarse contour path. Calling this method will untrain the tool if the coarse path modified is the path used at train time.
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.
(Inherited from CogSerializableChangedEventBase.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodTrain
Trains this pattern. If the pattern is already trained then it will be untrained and retrained.
The train operation also computes a set of run parameters that could be used at runtime. These parameters can be extracted from the train result and used at run time.
The FindResultIndexUsedInTrain will be set to the CurrentFindResultIndex.
Public methodUnfind
Unfinds this pattern. This will also untrain this pattern if it is trained.
Public methodUntrain
Untrains this pattern. This will not unfind the pattern and previous find results will not be removed.
Top
Fields

  NameDescription
Public fieldStatic memberSfCaliperSpacing
This bit will be set in the EventArgs of a Changed event every time the value returned by CaliperSpacing may have changed.
Public fieldStatic memberSfCurrentFindResultIndex
This bit will be set in the EventArgs of a Changed event every time the value returned by CurrentFindResultIndex may have changed.
Public fieldStatic memberSfFindParams
This bit will be set in the EventArgs of a Changed event every time the value returned by FindParams may have changed.
Public fieldStatic memberSfFindResultIndexUsedInTrain
This bit will be set in the EventArgs of a Changed event every time the value returned by FindResultIndexUsedInTrain may have changed.
Public fieldStatic memberSfFindResults
This bit will be set in the EventArgs of a Changed event every time the value returned by FindResults may have changed.
Public fieldStatic memberSfFixedWidth
This bit will be set in the EventArgs of a Changed event every time the value returned by FixedWidth may have changed.
Public fieldStatic memberSfFixedWidthEnabled
This bit will be set in the EventArgs of a Changed event every time the value returned by FixedWidthEnabled may have changed.
Public fieldStatic memberSfFound
This bit will be set in the EventArgs of a Changed event every time the value returned by Found may have changed.
Protected fieldStatic memberSfNextSf
Public fieldStatic memberSfSmoothingFactor
This bit will be set in the EventArgs of a Changed event every time the value returned by SmoothingFactor 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 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 memberSfTrainResult
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainResult may have changed.
Top
Properties

  NameDescription
Public propertyCaliperSpacing
Gets or sets the spacing between caliper center-points, along the chosen coarse bead path. Since there is no empty space between neighboring calipers, this value is also the height of each caliper. The height is measured perpendicular to the "width", which is measured across the bead (from one edge to the other).
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.
(Inherited from CogSerializableChangedEventBase.)
Public propertyCurrentFindResultIndex
Gets or sets the index of the result within the FindResults property to use when calling the SetCoarseContour(CogGeneralContour) method.
Public propertyFindParams
Gets or sets the parameters required to find one or more coarse paths that can be used for training this pattern.
Public propertyFindResultIndexUsedInTrain
Gets the index of the FindResults property that is used by the Train  method.
Public propertyFindResults
Public propertyFixedWidth
Gets or sets the fixed bead width to use when training. This value only applies if FixedWidthEnabled is set to "true".
Public propertyFixedWidthEnabled
Gets or Sets whether training uses a fixed bead width. The value used when training is defined by the FixedWidth property.
Public propertyFound
Gets whether one or more coarse paths have been found.
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertySmoothingFactor
Gets or sets the number of consecutive calipers used (during training) to compute the average values of the the trained path.
Public propertyStateFlags
Returns the complete set of state flags supported on this object. The flags may be indexed by name as shown in the following C# code snippet: if (changedObject.StateFlags["Color"] & eventArgs.StateFlags) { ... }
(Inherited from CogSerializableChangedEventBase.)
Public propertyTrained
Gets whether this pattern is currently trained.
Public propertyTrainImage
Gets or sets the image that will be used to find coarse paths and train this pattern.
Public propertyTrainResult
Top
Events

  NameDescription
Public eventChanged
This event is raised when one or more parts of the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Top
Remarks

A BeadInspect pattern must be found (using the Find  method) before it can be trained, and must be trained (using the Train  method) before it can be used to detect defects in a runtime image.

The pattern contains parameters that affect the finding process and and also parameters that affect the training process. The parameters that affect finding are all contained in the FindParams property while the training parameters are contained directly in the pattern. If you change any of these parameters on a trained pattern object, the pattern will automatically untrain itself. This ensures that the features of a trained pattern are in sync with the parameters that created them.

Once trained, this pattern encapsulates the exact shape and position of the path that is expected at runtime. Any differences between the path trained here and the path inspected in the runtime image will be flagged as defects when the Execute(ICogVisionData, CogBeadInspectRunParams) method of the pattern is called. Note that execute expects the runtime path to be at exactly the trained position, it does not "search" for the path within a region.

The trained pattern will store the bead widths along the bead path when training. By default these bead widths are found from the observed bead path of the training image. If you wish to instead train using a bead path width which remains constant along the entire path you may enable fixed width training by setting the FixedWidthEnabled property to true. You may specify the expected bead width using the FixedWidth propery.

A "bead" can be visualized as a thick line; an elongated region of near-uniform intensity. The center line of this bead is known as the "bead path" and the perpendicular distance between the bead edges is known as the "bead width".

A "bead path" is a sequence of adjacent points within an image where a bead can successfully be located (within a tolerance for small gaps or variances such as the size of the bead). A path will often form a closed loop, but this is not a requirement. A bead path has a start and end point as well as a direction that goes from the start point to the end point along the path.

A "coarse path" is a bead path that has been generated by a find operation. If desired, you can edit the coarse path (to eliminate any blemishes) and then refine it using the Train  method. The resulting "trained path" is smoother and more accurate than the coarse path. It also contains information about the width of the bead along this smoothed path. The trained path is read-only and cannot be edited. It can be used at run-time to detect defects.

See Also