Table of Contents

Advertisement

AW00136902000
11.5.2

Contrast

Adjusting the contrast changes the degree of difference between light and dark areas in the image.
The more contrast you apply, the more defined the difference will be.
You can adjust the contrast by setting the BslContrast parameter. The parameter value can range
from -1 to 1. By default, the parameter is set to 0, and no contrast adjustment is performed.
How the BslContrast parameter works depends on the contrast mode set. You can select the
contrast mode by setting the BslContrastMode parameter to one of the following values:
Linear: This is the default contrast mode. When this contrast mode is set, a linear function is
used to adjust the contrast. Increasing or decreasing the BslContrast parameter increases or
decreases the slope of the linear function.
8-bit pixel values shown
as an example
250
200
150
100
50
0
50
Input pixel values
Fig. 40: Contrast = 0, Brightness = 0,
Linear Contrast Mode
The higher the slope of the linear function, the more output pixel values will be set to completely
black (0) or completely white (maximum pixel value). In the example shown in
values from 0 to approximately 50 are set to completely black, and input values from
approximately 205 to 255 are set to completely white.
This means that the overall range of tonal values, i.e, the dynamic range of the image, is
decreased. The darkest and lightest regions of the image will appear completely black or
completely white, but the other areas will appear more defined.
Decreasing the contrast has the opposite effect.
S-Curve: When this contrast mode is set, an S-curve function is applied to adjust the contrast.
This allows you to improve perceived contrast while preserving the dynamic range of the
image.
When the contrast mode is set to S-curve and both BslContrast and BslBrightness are set to 0,
the Brightness/Contrast function looks as shown in
however, the graph of the function is shaped like an "S":
Basler dart BCON
100
150
200
250
Dynamic
250
200
150
100
50
0
50
100
Input pixel values
Fig. 41: Contrast = 0.3, Brightness = 0,
Linear Contrast Mode
Figure
40. If you increase the contrast,
Features
150
200
250
Figure
41, input
87

Advertisement

Table of Contents
loading

Table of Contents