Skip to main content
Designer and manufacturer of advanced imaging equipment
Thursday, 15 October 2026

Article

Black Level and Separate Red, Green and Blue Adjustment in ALTRON

rahni

We follow a simple rule when setting up any industrial camera: black first, then color. When the blacks in the image look slightly gray and the contrast looks flat, it is tempting to raise the contrast or gamma. But the root of the problem is usually the black level. Until it is right, every subsequent color adjustment rests on a crooked foundation. In this article we explain how to set the black level and the red, green and blue balance on the ALTRON line-scan camera, and what is different on the area-scan camera.

Separate red, green and blue sliders in the ALTRON line scan camera panel
Separate red, green and blue sliders in the ALTRON line scan camera panel

What is black level, and why does it drift?

Even in total darkness, the sensor does not output zero. It has an electronic offset that shifts with exposure, gain and temperature. If this offset is not corrected, blacks turn gray, contrast drops and every subsequent measurement also contains an error.

Another important point: the camera applies the offset before the gain stage. So every time you change the gain, the black level shifts with it.

On the line-scan camera: three pairs of sliders in the camera panel

In the line scan cameras panel, each color channel has two separate sliders:

  • Brightness (R / G / B): raises and lowers the dark level of each channel in the camera itself. BLC calibration adjusts these same sliders.
  • Contrast (R / G / B): is the gain of each channel in the camera. If you raise a channel's value, that color is amplified and the white balance changes. White balance calibration adjusts these same sliders.

Both groups are saved with the camera settings and are sent to the camera again on every Start. When automatic calibration runs, these sliders themselves move, so you can always see what the calibration has done. Keep manual changes for fine-tuning only.

BLC plug-in: measurement and correction in one place

The Black Level Correction (BLC) plugin is specific to the line-scan camera and, in the ready-made line-scan camera graph, sits right after the camera node. Select the BLC node to see these settings in the right column:

  • Black Level (R / G / B): The black level value of each channel. On a monochrome camera only R is used.
  • Pedestal: is the value that black settles on, and its default is 2. If you set it to zero, the lower half of the dark noise is crushed into a single peak at zero and can no longer be measured. With 2 to 3 units, the entire distribution is preserved.
  • Rescale to full: After the black level is subtracted, this stretches the remaining range to full scale so that white does not turn darker.
  • Auto on start (re-measure each run): Measures the black level once each time the chain starts. Because the black level changes with exposure, gain and lamp condition, the value from the previous run is usually no longer valid.

The Activate switch runs the black calibration. First the program asks you to put the lens cap on. Then it changes each channel's Brightness until the dark level settles on Pedestal. If the switch is green, a black level has been applied. If it is red, no level has been applied. DeActive resets everything to zero.

Four-step color calibration

In the same BLC panel there is an Auto White Balance section. First choose the balancing method:

  • White point (white sheet): You hold a white sheet in front of the lens and the gains are adjusted until white looks white. If you have a white reference, choose this method.
  • Grey world (scene): No card is needed. The gains are adjusted so that the average color of the scene becomes neutral. This works well on a colorful scene. But if the scene has a dominant color, for example green, the image also shifts toward that color.

Then check Set Analog Gain First. The full calibration is carried out in four steps, and before each step a window tells you what to do:

  1. Put the lens cap on. The black level is measured with the gains at zero.
  2. Remove the cap. The gains are raised until the brightest color reaches 90 percent of full scale, and the other colors are matched to it. The scene lighting must be the same as the lighting of the actual application.
  3. Put the cap back on. The black level is measured again at the new gain.
  4. Remove the cap. The balance is established once more, and the job is done.

Take step three seriously. If you skip it, the dark end of the image is still set for the old gain.

What is different on an area-scan camera?

The BLC plugin is not intended for area-scan cameras. In the panel area scan cameras you have a global Brightness and a global Contrast, plus the Black Level group. With Auto checked, the camera calibrates the black level itself. If you uncheck it, you set the offset yourself with the slider in this group.

Common mistakes

  • Running black calibration while light leaks in around the lens cap.
  • Changing the gain after calibration without measuring the black level again.
  • Setting the Pedestal to zero to make the image look blacker.
  • Using Grey world on a scene that has a dominant color.

Don't forget the correct order either: first set the exposure so that nothing saturates, then move on to black level and color.

A short general reference on image sensors: Wikipedia (English).

If you still see a color cast or gray blacks after calibration, get in touch with us through contact form.

Where our equipment is used

Organizations, universities, industries and companies that have used our products

  • Hedayat Hooshmand Nozhan Sepehr