CogAcqContrast Contrast Property Cognex VisionPro 9.22
Reads or sets the contrast level. Contrast values are in the range 0-1 inclusive.

Namespace: Cognex.VisionPro.Implementation.Internal
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 87.0.0.0
Syntax

public virtual double Contrast { get; set; }

Property Value

Type: Double

Implements

ICogAcqContrast Contrast
Events

Event TypeReason
ICogChangedEvent Changed

Fires when the contrast is changed.

The following state flag may be affected:

Exceptions

ExceptionCondition
ArgumentExceptionValue is less than 0 or Value is greater than 1.0.
NotImplementedExceptionThe attached hardware is an L4000 or an L38. Note that this behavior is different from most other cameras which do not provide contrast support. Those cameras will return a null ICogAcqContrast interface. Your code should be prepared to handle both scenarios.
Remarks

Sets or gets the contrast level. This value ranges from 0.0 (least contrast) to 1.0 (most contrast).

Not all FIFOs support this property. Check whether the FIFO supports it, as in the example, before using this property.

The contrast and brightness values control how different light levels are mapped to pixel values. Assume that you are working with an 8-bit image. All the light levels entering the camera must be mapped to a pixel value from 0 to 255.

Contrast determines how the light levels are mapped to the 256 light levels. A low value closer to 0.0 maps more light values to the pixel value range.

A high value closer to 1.0 maps fewer light values to the pixel value range. Light values that are below or above the contrast threshold are mapped to the lowest and highest pixel values, respectively.

For multichannel FIFOs, Contrast sets the contrast of all channels to the same value. To set the contrast of individual channels, use ICogAcqContrastMultiChannel.SetContrastMultiChannel(Int32, Double).

Default Value: CDC-50 camera: 0.15 CDC-100 camera: 0.66 CDC-200 camera: 0.45 All other cameras: 0.35

See Also