Now we'll talk about brightness correction which can improve all contrast in image.
Image contrast is one of the common image defects.
There are two main reasons for it.
First, is the limited range of sense of sensitivity.
The second reason is bad sense of transmission function,
meaning bad conversion from light energy to perceived pixels brightness.
With bad I mean these transmission functions
differ from human function which works in the brain.
In the specific lighting conditions,
you can use different transmission function from brightness to the pixel value.
To evaluate the tone transfer in image,
we need to first build the brightness histogram.
The brightness histogram is the chart of brightness distribution in image.
On horizontal axis, brightness varies from black to white, are represented.
On the vertical axis,
the number of pixels absolute or normalized is the respective brightness value.
On the slide I give two examples of images with poor contrast.
On the first image from this histogram,
we can see that brightness range is not fully used.
There are no black or white colors in the image.
On the second histogram,
full range of brightness is used.
But brightness values are concentrated around certain peaks.
So, most of the pixels lie with the same brightness values.
The most basic image point operator which can
improve contrast in image, is point operators.
Point operators map input pixel value to output pixel value.
All pixels are processed independently and equally.
We write the pointer operator function as inverted F,
because the color throw brightness from measurement of brightness.
The most basic operation is linear correction.
It is a point operator that come compensated limited histogram range.
The idea is to play such linear transformation that
map the lowest brightness value in image to total black,
and map the highest brightness value to white.
To calculate the parameters of such linear transformation,
you must first find the minimum and maximum value of brightness in current image.
We can visualize the linear transformation on the chart.
You can see that it maps the minimum value of brightness in image to the black value,
and the maximum value of brightness in image to the white value.
Here's the example of linear correction.
We have a test pattern with poor contrast.
It consists of several samples of a fixed brightness.
The brightness is lowered from left to right of the pattern.
After a linear correction,
the darkest column has become black.
The brightness has become white.
See how the difference between neighbor cones has
become more prominent after linear correction.
Linear correction always improves image perception.
This is why it does generally apply to all images in all image processing pipelines.
There is no need to not fully use the brightness range in our image.
But sometimes simple linear correction can not help.
Like in this example,
we have a portion of brightly lit water and the rest of the image is very dark.
So, simple linear transformation will not improve the contrast in very dark area,
because we have very dark and very bright pixels in the image.
If linear correction cannot solve the problem,
then it can apply nonlinear correction,
via a short device the parameters of
nonlinear transformation in such a way so that contrast in dark areas should be improved,
and in bright areas,
the contrast can be reduced or flattened.
You can visualize the mapping function with a curve.
The most basic parametric form for such curve is Gama transformation.
Gamma transformation is often used for contrast enhancement.
By controlling the value of parameter Gamma,
we can control the Gamma transformation.
And we can select the parameter,
the value of Gamma to get the most perceptually pleasing result.
In this example, the best results of doing these Gamma equal 0.5.
In many image processing application,
user can specify the contr of brightness making function himself. Here's one example.
When contrast in the middle of the histogram is
improved by flitting in the areas of both bright and dark pixels.
One other example of such free for transformation is
automatically estimate called histogram equalization.
The goal is to make that commulative brightness histogram near linear.
Such transformation can improve
the visual perception and automatic recognition of images,
and is often used for image recognition.