Get or set Y sampling.
Namespace: Cognex.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 91.0.0.0
Syntax
Property Value
Type: Int32Events
| Event Type | Reason |
|---|---|
| ICogChangedEvent Changed | Fires when the value changes. The following state flag may be affected: |
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | The new value is < 0. |
Remarks
Sets or gets y-sampling. You can use subsampling to reduce the image size and may result in faster acquisitions. Subsample values specify the ration of full-frame pixels to sampled pixels. For example, setting SampleY to 8 specifies an 8:1 reduction in the number of pixels along the y-axis.
If SampleValuesLocked is True, changing this value sets SampleY to the same value.
Default Value: 1, no subsampling
Examples
using Cognex.VisionPro; private CogFrameGrabbers myFrameGrabbers; private ICogFrameGrabber myFrameGrabber; private ICogAcqFifo myAcqFifo; private void InitializeFifo() { const string VIDEO_FORMAT = "Cognex CDC-50-33G 640x480"; ICogAcqSample sampleParams; myFrameGrabbers = new CogFrameGrabbers(); myFrameGrabber = myFrameGrabbers[0]; myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false); sampleParams = myAcqFifo.OwnedSampleParams; if (sampleParams != null) sampleParams.SampleX = 4; sampleParams.SampleY = 4; }
Imports Cognex.VisionPro
Private myFrameGrabbers As CogFrameGrabbers
Private myFrameGrabber As Cognex.VisionPro.ICogFrameGrabber
Private myAcqFifo As Cognex.VisionPro.ICogAcqFifo
Private Sub InitializeFifo()
Const VIDEO_FORMAT = "Cognex CDC-50-33G 640x480"
Dim sampleParams As Cognex.VisionPro.ICogAcqSample
myFrameGrabbers = New CogFrameGrabbers
myFrameGrabber = myFrameGrabbers.Item(0)
myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, CogAcqFifoPixelFormatConstants.Format8Grey, 0, False)
sampleParams = myAcqFifo.OwnedSampleParams
If Not sampleParams Is Nothing Then
sampleParams.SampleX = 4
sampleParams.SampleY = 4
End If
End SubSee Also