Balluff - BVS CA-GX0 / BVS CA-GX2 Technical Documentation
Working With Gain And Black-Level Values Per Color Channel

In many low-lighting applications the gain needs to be increased to enhance the brighness of the images. However, while the image brightness is increased, the black-level of the image is also increased, which in many cases should be avoided. With the help of the GainOffsetKnee filter it is possible to correct/adjust the overall black-level as well as the black-level per color channel, even when the gain is applied. Figure 1 shows the working principle of the GainOffsetKnee filter.

Figure 1: The GainOffsetKnee filter working principle

The GainOffsetKnee filter is one of the image processing methods performed on the host. It allows you to adjust:

  • The overall offset (i.e. overall black-level) of an image.
  • The individual gain per color channel.
  • The individual offset (i.e. individual black-level) per color channel.

Configuration in ImpactControlCenter

Here is how to configure the GainOffsetKnee filter in ImpactControlCenter and the impact the filter has on an image:

  1. The GainOffsetKnee filter is located under "Setting → Base → ImageProcessing".
    Figure 2: The GainOffsetKnee filter option in ImpactControlCenter

  2. Once the GainOffsetKnee filter is activated, the configuration field will be displayed (see Figure 3). As an example, the current RGB image is shown in Figure 4 and its histogram in Figure 5.
    Figure 3: The configuration field for the GainOffsetKnee filter

    Figure 4: An image without the GainOffsetKnee filter

    Figure 5: The histogram of Figure 3

  3. The overall offset can be assigned using the 'GainOffsetKneeMasterOffset_pc'. A positive offset increases the black-level of the image, whereas a negative offset reduces it. To visualize the effect, an offset of 5% is given as an example, which means that the overall black-level of the image will be increased by 5% of the max. pixel value (i.e. 255 in this example). As a result, the overall black-level in the current histogram (see Figure 8) has been increase by 12.75 (which is 5% x 255) comparing to the original histogram (see Figure 5).
    Figure 6: Assign overall/master offset to the image

    Figure 7: The image with 5% overall offset

    Figure 8: The histogram with 5% overall offset

  4. Among the GainOffsetKneeChannels there are 4 channels. For mono images, only channel 0 is used. For RGB images, channel 0-2 are used: red channel, green channel and blue channel respectively. For Bayer images, channel 0-3 are used. For more description please refer to Figure 3. As an example, a gain of 1.0625dB is applied to the red channel. As shown in Figure 10 and Figure 11, the grey-level of the red channel is increased while the other two channels remain the same.
    Figure 9: Assign individual gain to the red channel

    Figure 10: The image with 1.0625dB gain in the red channel

    Figure 11: The histogram with 1.0625dB gain in the red channel

  5. The individual black-level can be assigned using the channel specific 'Offset_pc'. Analogous to 'GainOffsetKneeMasterOffset_pc', a positive offset increases the black-level of the channel, whereas a negative offset reduces it. To visualize the effect, an offset of 5% is given as an example in the red channel. The histogram (see Figure 14) shows therefore a 12.75 (which is 5% x 255) offset increase in the red channel.
    Figure 12: Assign individual offset to the red channel

    Figure 13: The image with 5% offset in the red channel

    Figure 14: The histogram with 5% offset in the red channel

Configuration Using The API

Depending on the programming language you are working with the names of classes, namespaces and properties might vary slightly. For C++ please refer to the GainOffsetKneeChannelParameters class and the Image Processing class for some guidance, for other languages when searching for the offset or knee properties similar things can be found.