Balluff - BVS CA-MLC / BVS CA-IGC Technical Documentation
Optimizing the color/luminance fidelity of the camera

Purpose of this chapter is to optimize the color image of a camera, so that it looks as natural as possible on different displays and for human vision.

This implies some linear and nonlinear operations (e.g. display color space or Gamma viewing LUT) which are normally not necessary or recommended for machine vision algorithms. A standard monitor offers, for example, several display modes like sRGB, "Adobe RGB", etc., which reproduce the very same color of a camera color differently.

It should also be noted that users can choose for either

  • camera based settings and adjustments or
  • host based settings and adjustments or
  • a combination of both.

Camera based settings are advantageous to achieve highest calculating precision, independent of the transmission bit depth, lowest latency, because all calculations are performed in FPGA on the fly and low CPU load, because the host is not invoked with these tasks. These camera based settings are

Host based settings save transmission bandwidth at the expense of accuracy or latency and CPU load. Especially performing gain, offset, and white balance in the camera while outputting RAW data to the host can be recommended.

Of course host based settings can be used with all families of cameras (e.g. also mvBlueFOX).

Host based settings are:

  • look-up table (LUTOperations)
  • color correction (ColorTwist)

To show the different color behaviors, we take a color chart as a starting point:

Figure 1: Color chart as a starting point

If we take a SingleFrame image without any color optimizations, an image can be like this:

Figure 2: SingleFrame snap without color optimization
Figure 3: Corresponding histogram of the horizontal white to black profile

As you can see,

  • saturation is missing,
  • white is more light gray,
  • black is more dark gray,
  • etc.
Note
You have to keep in mind that there are two types of images: the one generated in the camera and the other one displayed on the computer monitor. Up-to-date monitors offer different display modes with different color spaces (e.g. sRGB). According to the chosen color space, the display of the colors is different.

The following figure shows the way to a perfect colored image

Figure 4: The way to a perfect colored image

including these process steps:

  1. Do a Gamma correction (Luminance),
  2. make a White balance and
  3. Improve the Contrast.
  4. Improve Saturation, and use a "color correction matrix" for both
    1. the sensor and / or
    2. the monitor.

The following sections will describe the single steps in detail.

Step 1: Gamma correction (Luminance)

First of all, a Gamma correction can be performed to change the image in a way how humans perceive light and color.

For this, you can change either

  • the exposure time,
  • the aperture or
  • the gain.

You can change the gain via ImpactControlCenter like the following way:

  1. Click on "Setting → Base → Camera". There you can find

    1. "AutoGainControl" and
    2. "AutoExposeControl".
    Figure 5: ImpactControlCenter: Setting → Base → Camera

    You can turn them "On" or "Off". Using the auto controls you can set limits of the auto control; without you can set the exact value.

After gamma correction, the image will look like this:

Figure 6: After gamma correction
Figure 7: Corresponding histogram after gamma correction
Note
As mentioned above, you can do a gamma correction via ("Setting → Base → ImageProcessing → LUTOperations"):

Figure 8: LUTOperations dialog

Just set "LUTEnable" to "On" and adapt the single LUTs like (LUT-0, LUT-1, etc.).

Step 2: White Balance

As you can see in the histogram, the colors red and blue are below green. Using green as a reference, we can optimize the white balance via "Setting → Base → ImageProcessing" ("WhiteBalanceCalibration"):

Please have a look at "White Balancing A Color Camera" in the "Impact Acquire SDK GUI Applications" manual for more information for an automatic white balance with ImpactControlCenter.

To adapt the single colors you can use the "WhiteBalanceSettings-1".

After optimizing white balance, the image will look like this:

Figure 9: After white balance
Figure 10: Corresponding histogram after white balance

Step 3: Contrast

Still, black is more a darker gray. To optimize the contrast you can use "Setting → Base → ImageProcessing → LUTControl" as shown in Figure 8.

The image will look like this now:

Figure 11: After adapting contrast
Figure 12: Corresponding histogram after adapting contrast

Step 4: Saturation and Color Correction Matrix (CCM)

Still saturation is missing. To change this, the "Color Transformation Control" can be used ("Setting → Base → ImageProcessing → ColorTwist"):

  1. Click on "Color Twist Enable" and
  2. click on "Wizard" to start the saturation via "Color Transformation Control" wizard tool (since firmware version 1.4.57).

    Figure 13: Selected Color Twist Enable and click on wizard will start wizard tool
  3. Now, you can adjust the saturation e.g. "1.1".

    Figure 14: Saturation via Color Transformation Control dialog
  4. Afterwards, click on "Enable".
  5. Since driver version 2.2.2, it is possible to set the special color correction matrices at
    1. the input (sensor),
    2. the output side (monitor) and
    3. the saturation itself using this wizard.
  6. Select the specific input and output matrix and
  7. click on "Enable".
  8. As you can see, the correction is done by the host ("Host Color Correction Controls").
    Note
    It is not possible to save the settings of the "Host Color Correction Controls" in the mvBlueFOX. Unlike in the case of Figure 14, the buttons to write the "Device Color Correction Controls" to the mvBlueFOX are not active.
  9. Finally, click on "Apply".

After the saturation, the image will look like this:

Figure 15: After adapting saturation
Figure 16: Corresponding histogram after adapting saturation