Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 87.0.0.0
Property Value
Type: DoubleImplements
ICogAcqContrast Contrast| Event Type | Reason |
|---|---|
| ICogChangedEvent Changed | Fires when the contrast is changed. The following state flag may be affected: |
| Exception | Condition |
|---|---|
| ArgumentException | Value is less than 0 or Value is greater than 1.0. |
| NotImplementedException | The 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. |
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