CogPMRedLinePattern ClassCognex VisionPro 9.5
Class that represents a PMRedLine pattern. You can use the methods of this class to train a new pattern and to search for instances of the trained pattern in a runtime image. You can also search for pattern instances using the tool class, CogPMRedLineTool.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro.PMRedLine CogPMRedLinePattern

Namespace: Cognex.VisionPro.PMRedLine
Assembly: Cognex.VisionPro.PMRedLine (in Cognex.VisionPro.PMRedLine.dll) Version: 69.0.0.0
Syntax

[SerializableAttribute]
public class CogPMRedLinePattern : CogSerializableChangedEventBase, 
	IDisposable

The CogPMRedLinePattern type exposes the following members.

Constructors

  NameDescription
Public methodCogPMRedLinePattern 
Constructs a default CogPMRedLinePattern object. You must train this object before you can use it to search for pattern instances.
Public methodCogPMRedLinePattern(CogPMRedLinePattern)
Constructs a deep copy of the supplied CogPMRedLinePattern object.
Protected methodCogPMRedLinePattern(SerializationInfo, StreamingContext)
Serialization constructor for CogPMRedLinePattern 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 methodCreateTrainedGraphics
Gets a collection of graphics that can be used to display the trained pattern features.
Public methodDispose 
Releases all resources used by this CogPMRedLinePattern object.
Protected methodDispose(Boolean)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExecute
Searchs the given inputImage for instances of this pattern. The search is performed using the supplied runParams within the given region.
Protected methodFinalize
Releases all unmanaged resources used by this CogPMRedLinePattern object.
(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
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 methodPrecompute
Precompute internal data for the pattern. Cognex internal use only.
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 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 PMRedLine pattern. If the pattern is already trained then it will be untrained and retrained.
Public methodUntrain
Untrains this PMRedLine pattern.
Top
Fields

  NameDescription
Public fieldStatic memberSfCreateTrainedGraphics
This bit will be set in the EventArgs of a Changed event every time the value returned by CreateTrainedGraphics may have changed.
Public fieldStatic memberSfFeatureThreshold
This bit will be set in the EventArgs of a Changed event every time the value returned by FeatureThreshold may have changed.
Public fieldStatic memberSfGrainLimitCoarse
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitCoarse may have changed.
Public fieldStatic memberSfGrainLimitCoarseAutoSelect
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitCoarseAutoSelect may have changed.
Public fieldStatic memberSfGrainLimitFine
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitFine may have changed.
Public fieldStatic memberSfGrainLimitFineAutoSelect
This bit will be set in the EventArgs of a Changed event every time the value returned by GrainLimitFineAutoSelect may have changed.
Protected fieldStatic memberSfNextSf
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 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 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.
Public fieldStatic memberSfTrainTimeout
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainTimeout may have changed.
Public fieldStatic memberSfTrainTimeoutEnabled
This bit will be set in the EventArgs of a Changed event every time the value returned by TrainTimeoutEnabled 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.
(Inherited from CogSerializableChangedEventBase.)
Public propertyFeatureThreshold
Gets or sets the feature threshold. This value controls how many features are included in the trained pattern. Raising the threshold reduces the number of trained features.
Public propertyGrainLimitCoarse
Gets or sets the coarse granularity limit. This is the maximum amount of subsampling that will be applied to the input image when PMRedLine searchs for instances of your pattern. If GrainLimitCoarseAutoSelect is "true" this granularity limit will be recomputed automatically when the pattern is trained, overwriting the previous value.
Public propertyGrainLimitCoarseAutoSelect
Gets or sets whether to automatically recompute the coarse granularity limit during pattern training. If "true", the limit computed during training will overwrite the existing GrainLimitCoarse. Otherwise, it will remain unchanged.
Public propertyGrainLimitFine
Gets or sets the fine granularity limit. This is the minimum amount of subsampling that will be applied to the input image when PMRedLine searchs for instances of your pattern. If GrainLimitFineAutoSelect is "true" this granularity limit will be recomputed automatically when the pattern is trained, overwriting the previous value.
Public propertyGrainLimitFineAutoSelect
Gets or sets whether to automatically recompute the fine granularity limit during pattern training. If "true", the limit computed during training will overwrite the existing GrainLimitFine. Otherwise, it will remain unchanged.
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyOrigin
Gets or sets a six degree of freedom (DOF) origin for the pattern. This linear transform maps points from "Pattern Space" to the selected space of the train image.
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 train this PMRedLine pattern. Pattern features will be found and trained only from portions of the image within the train region.
Public propertyTrainImageMask
Gets or sets the mask to be used when training a CogPMRedLine pattern. The mask allows you to identify areas of the train image as "Care" or "Don't Care".
Public propertyTrainImageMaskOffsetX
Gets or sets the X offset (in pixels) for the train image mask.
Public propertyTrainImageMaskOffsetY
Gets or sets the Y offset (in pixels) for the train image mask.
Public propertyTrainRegion
Gets or sets the train region. Only the portion of the train image that lies within this region will be trained by PMRedLine. If the supplied region object is null, the entire train image will be trained.
Public propertyTrainRegionMode
Gets or sets the train region mode. This mode specifies how the train region is applied to the train image.
Public propertyTrainTimeout
Gets or sets the maximum execution time (in msec) allowed when a PMRedLine tool is trained. This value only applies if TrainTimeoutEnabled is set to "true".
Public propertyTrainTimeoutEnabled
Gets or sets whether to enable the train timeout.
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 PMRedLine pattern must be trained (using the Train  method) before it can be used to search for pattern instances. The trained pattern holds information needed for fast searching at runtime. For example, it holds the location of the pattern features that are to be found in the runtime input image.

The pattern object also holds parameters that control the training process. 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.

The only properties that do not untrain the pattern when changed are:

Once your pattern is trained you can search for instances of the pattern in a runtime input image. You can do this in one of two ways:

  1. You can call the Execute(ICogImage, ICogRegion, CogPMRedLineRunParams) method of this class, or
  2. You can call the Run  method of a CogPMRedLineTool class that contains this pattern object.

See Also