CogIPOneImageSubSampler ClassCognex VisionPro 9.25 SR1
Class that subsamples the pixels in a image by blocks specified by SampleX and SampleY to produce an image of reduced size. Pixels selected will be the closest to each blocks center or the average pixel value if SpatialAverage is enabled.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.ImageProcessing CogIPOneImageSubSampler

Namespace: Cognex.VisionPro.ImageProcessing
Assembly: Cognex.VisionPro.ImageProcessing (in Cognex.VisionPro.ImageProcessing.dll) Version: 93.1.0.0
Syntax

[SerializableAttribute]
public class CogIPOneImageSubSampler : CogObjectBase, 
	ICogNetInternal, IDisposable, ICogIPOneImageOperator, ICogIPOneImageOperatorParams, ICloneable, 
	ISerializable, ICogHasChanged, ICogChangedEvent

The CogIPOneImageSubSampler type exposes the following members.

Constructors

  NameDescription
Public methodCogIPOneImageSubSampler 
Constructs a new instance of this class.
Public methodCogIPOneImageSubSampler(IntPtr)
Constructs a new instance of this class using com pointer.
Public methodCogIPOneImageSubSampler(CogIPOneImageSubSampler)
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 methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExecute
Perform a single image operation using the input image and region to produce the output 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 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.)
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.)
Top
Fields

  NameDescription
Protected field__com
Protected field__disposed
Protected fieldStatic member__factory
Protected fieldStatic memberCreator
Public fieldStatic memberSfEnabled
This bit will be set in the EventArgs of a Changed event every time the value returned by Enabled may have changed.
Public fieldStatic memberSfOperatorName
This bit will be set in the EventArgs of a Changed event every time the value returned by OperatorName may have changed.
Public fieldStatic memberSfSampleX
This bit will be set in the EventArgs of a Changed event every time the value returned by SampleX may have changed.
Public fieldStatic memberSfSampleY
This bit will be set in the EventArgs of a Changed event every time the value returned by SampleY may have changed.
Public fieldStatic memberSfSpatialAverage
This bit will be set in the EventArgs of a Changed event every time the value returned by SpatialAverage 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 propertyEnabled
Whether this one image operator will be used to compute the output image.
Public propertyHasChanged
If true, the serializable state of this object has changed since the last time it was serialized.
Public propertyOperatorName
Returns/sets a displayable operator name.
Public propertySampleX
The factor used to divide the image into blocks of SampleX pixels along its width. The output image is produced from either most central pixel of each block specified by SampleX and SampleY, or if SpatialAverage is enabled, the average of the block.
Public propertySampleY
The factor used to divide the image into blocks of SampleY pixels along its height. The output image is produced from either most central pixel of each block specified by SampleX and SampleY, or if SpatialAverage is enabled, the average of the block.
Public propertySpatialAverage
A flag designating that the image should be averaged, and not merely sampled. The pixel values from each pixel in the sample-size blocks are summed, and the result is divided by the number of pixels in the block.
Top
Events

  NameDescription
Public eventChanged
Occurs when one or more parts of the object's state may have changed.
Top
Remarks

Primary interface of a CogIPOneImageSubSampler object. This object samples an image in the x- and y-directions to produce a new image. You can configure this object to perform spatial averaging instead of sampling.

Subsampling divides an image into blocks of SampleX by SampleY pixels and selects the pixel closest to each block’s center. When there is no pixel at the exact center of a subsampling block (as is the case in the figure), the pixel to the upper left of center is selected.

Spatial averaging divides an image into of SampleX by SampleY pixels. The pixel values from each pixel in the block are summed, and the result is divided by the number of pixels in the block. The averaged pixel value from the block of pixels is then applied to a single pixel in the destination window. Partial blocks in the image are ignored during spatial averaging.

If you specify an even subsampling rate and you do not use spatial averaging, the tool selects the pixel above and to the left of the center of the sampling area. This introduces a one-half pixel shift in the locations of features in the sampled image. The tool automatically adjusts the output image coordinate space tree by shifting the coordinate space by one-half pixel. Because spatial averaging averages pixel values evenly across the sampling area regardless of its size, no such adjustment is required when spatial averaging is enabled.

See Also