ICogAcqBrightness Brightness Property Cognex VisionPro 9.5
Reads or sets the brightness level.

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

double Brightness { get; set; }

Property Value

Type: Double
Events

Event TypeReason
ICogChangedEvent Changed

Fires when the brightness is changed.

The following state flag may be affected:

Exceptions

ExceptionCondition
ArgumentException

Value is < 0 or Value > 1.0.

Remarks

Sets or gets the brightness level. This value ranges from 0.0 (darkest) to 1.0 (lightest).

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.

Brightness determines where the center of the contrast mapping window falls relative to the range of light levels. Brightness values closer to 0.0 place the center of the mapping window toward the higher light levels, resulting in a darker image.

Brightness values closer to 1.0 place the window toward the lower light levels, resulting in a brighter image.

For multichannel FIFOs, Brightness sets the brightness of all channels to the same value. To set the brightness of individual channels, use ICogAcqBrightnessMultiChannel.SetBrightnessMultiChannel(Int32, Double).

Default Value: CDC-50 camera: 0.58 CDC-100 camera: 0.50 CDC-200 camera: 0.50 All other cameras: 1.0

Examples

using Cognex.VisionPro;

private CogFrameGrabbers myFrameGrabbers;
private ICogFrameGrabber myFrameGrabber;
private ICogAcqFifo myAcqFifo;

private void InitializeFifo()
{
    const string VIDEO_FORMAT = "Sony XC75 640x480";
    ICogAcqBrightness brightnessParams;

    myFrameGrabbers = new CogFrameGrabbers();
    myFrameGrabber = myFrameGrabbers[0];
    myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, 
        Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);

    brightnessParams = myAcqFifo.OwnedBrightnessParams;
    if (brightnessParams != null)
        brightnessParams.Brightness = .75;
}
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 = "Sony XC75 640x480"
    Dim myBrightnessParam As Cognex.VisionPro.ICogAcqBrightness

    myFrameGrabbers = New CogFrameGrabbers
    myFrameGrabber = myFrameGrabbers.Item(0)
    myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, CogAcqFifoPixelFormatConstants.Format8Grey, 0, False)

    myBrightnessParam = myAcqFifo.OwnedBrightnessParams

    If Not myBrightnessParam Is Nothing Then
        myBrightnessParam.Brightness = 0.75
    End If
End Sub
See Also