Image Enhancement In Video Analytics Systems
Recently, video analytics systems are rapidly evolving, and the effectiveness of their work depends primarily on the quality of operations at the initial level of the entire processing process, namely the quality of segmentation of objects in the scene and their recognition. Successful performance o...
Gespeichert in:
Datum: | 2020 |
---|---|
1. Verfasser: | |
Format: | Artikel |
Sprache: | English |
Veröffentlicht: |
Міжнародний науково-навчальний центр інформаційних технологій і систем НАН та МОН України
2020
|
Schriftenreihe: | Control systems & computers |
Schlagworte: | |
Online Zugang: | http://dspace.nbuv.gov.ua/handle/123456789/181231 |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Назва журналу: | Digital Library of Periodicals of National Academy of Sciences of Ukraine |
Zitieren: | Image Enhancement In Video Analytics Systems / O.M. Golovin // Control systems & computers. — 2020. — № 6. — С. 3-20. — Бібліогр.: 17 назв. — англ. |
Institution
Digital Library of Periodicals of National Academy of Sciences of Ukraineid |
irk-123456789-181231 |
---|---|
record_format |
dspace |
spelling |
irk-123456789-1812312021-11-09T01:26:41Z Image Enhancement In Video Analytics Systems Golovin, O.M. Fundamental Problems in Computer Science Recently, video analytics systems are rapidly evolving, and the effectiveness of their work depends primarily on the quality of operations at the initial level of the entire processing process, namely the quality of segmentation of objects in the scene and their recognition. Successful performance of these procedures is primarily due to image quality, which depends on many factors: technical parameters of video sensors, low or uneven lighting, changes in lighting levels of the scene due to weather conditions, time changes in illumination, or changes in scenarios in the scene. This paper presents a new, accurate, and practical method for assessing the improvement of image quality in automatic mode. The method is based on the use of nonlinear transformation function, namely, gamma correction, which reflects properties of a human visual system, effectively reduces the negative impact of changes in scene illumination and due to simple adjustment and effective implementation is widely used in practice. The technique of selection in an automatic mode of the optimum value of the gamma parameter at which the corrected image reaches the maximum quality is developed. Розроблено метод для визначення оптимального значення параметра гамма-корекції зображень, при якому забезпечується вибір в автоматичному режимі найбільш якісного зображення сцени для подальшої обробки. Метод відрізняється здатністю приведення якості зображення до максимально можливого рівня якості в автоматичному режимі та наявними елементами адаптивності до змін у режимі освітленості сцени уваги. Разработан метод для определения оптимального значения параметра гамма коррекции изображений, при котором обеспечивается выбор в автоматическом режиме наиболее качественного изображения сцены для дальнейшей обработки. Метод отличается способностью приведения качества изображения к максимально возможному уровню качества в автоматическом режиме и имеющимися элементами адаптивности к изменениям в режиме освещенности сцены внимания. 2020 Article Image Enhancement In Video Analytics Systems / O.M. Golovin // Control systems & computers. — 2020. — № 6. — С. 3-20. — Бібліогр.: 17 назв. — англ. 2706-8145 DOI https://doi.org/10.15407/csc.2020.06.003 http://dspace.nbuv.gov.ua/handle/123456789/181231 364.2:331 en Control systems & computers Міжнародний науково-навчальний центр інформаційних технологій і систем НАН та МОН України |
institution |
Digital Library of Periodicals of National Academy of Sciences of Ukraine |
collection |
DSpace DC |
language |
English |
topic |
Fundamental Problems in Computer Science Fundamental Problems in Computer Science |
spellingShingle |
Fundamental Problems in Computer Science Fundamental Problems in Computer Science Golovin, O.M. Image Enhancement In Video Analytics Systems Control systems & computers |
description |
Recently, video analytics systems are rapidly evolving, and the effectiveness of their work depends primarily on the quality of operations at the initial level of the entire processing process, namely the quality of segmentation of objects in the scene and their recognition. Successful performance of these procedures is primarily due to image quality, which depends on many factors: technical parameters of video sensors, low or uneven lighting, changes in lighting levels of the scene due to weather conditions, time changes in illumination, or changes in scenarios in the scene. This paper presents a new, accurate, and practical method for assessing the improvement of image quality in automatic mode. The method is based on the use of nonlinear transformation function, namely, gamma correction, which reflects properties of a human visual system, effectively reduces the negative impact of changes in scene illumination and due to simple adjustment and effective implementation is widely used in practice. The technique of selection in an automatic mode of the optimum value of the gamma parameter at which the corrected image reaches the maximum quality is developed. |
format |
Article |
author |
Golovin, O.M. |
author_facet |
Golovin, O.M. |
author_sort |
Golovin, O.M. |
title |
Image Enhancement In Video Analytics Systems |
title_short |
Image Enhancement In Video Analytics Systems |
title_full |
Image Enhancement In Video Analytics Systems |
title_fullStr |
Image Enhancement In Video Analytics Systems |
title_full_unstemmed |
Image Enhancement In Video Analytics Systems |
title_sort |
image enhancement in video analytics systems |
publisher |
Міжнародний науково-навчальний центр інформаційних технологій і систем НАН та МОН України |
publishDate |
2020 |
topic_facet |
Fundamental Problems in Computer Science |
url |
http://dspace.nbuv.gov.ua/handle/123456789/181231 |
citation_txt |
Image Enhancement In Video Analytics Systems / O.M. Golovin // Control systems & computers. — 2020. — № 6. — С. 3-20. — Бібліогр.: 17 назв. — англ. |
series |
Control systems & computers |
work_keys_str_mv |
AT golovinom imageenhancementinvideoanalyticssystems |
first_indexed |
2025-07-15T22:02:34Z |
last_indexed |
2025-07-15T22:02:34Z |
_version_ |
1837752077972930560 |
fulltext |
iSSN 2706-8145, control systems and computers, 2020, № 6 3
doi https://doi.org/10.15407/csc.2020.06.003
Udc 364.2:331
o.m. GoloVIn, ph.d. eng. Sciences, Senior research associate,
v.m.glushkov institute of cybernetics of the NaS of Ukraine,
glushkov ave., 40, kyiv, 03187, Ukraine,
o.m.golovin.1@gmail.com
ImAGe enHAnCement In VIDeo AnAlytICs systems
Recently, video analytics systems are rapidly evolving, and the effectiveness of their work depends primarily on the quality of
operations at the initial level of the entire processing process, namely the quality of segmentation of objects in the scene and their
recognition. Successful performance of these procedures is primarily due to image quality, which depends on many factors: tech-
nical parameters of video sensors, low or uneven lighting, changes in lighting levels of the scene due to weather conditions, time
changes in illumination, or changes in scenarios in the scene. This paper presents a new, accurate, and practical method for as-
sessing the improvement of image quality in automatic mode. The method is based on the use of nonlinear transformation function,
namely, gamma correction, which reflects properties of a human visual system, effectively reduces the negative impact of changes
in scene illumination and due to simple adjustment and effective implementation is widely used in practice. The technique of se-
lection in an automatic mode of the optimum value of the gamma parameter at which the corrected image reaches the maximum
quality is developed.
Keywords: gamma correction, image enhancement, video analytics system, gamma parameter, histogram, computer vision, seg-
mentation.
Fundamental problems
in Computer science
Introduction
The main purpose of any video analytics system is
to understand the situation in the scene [1] . And the
way to achieve it is through the selection of all or
certain objects in the scene of attention, determining
cause-and-effect relationships between them, and
predicting future events . Therefore, to make the
only correct decision regarding the situation, high-
quality images with good contrast and uniform
illumination of all its areas are necessary . It is
unrealistic to assume that applications of computer
vision will process only perfect images while their
running . Practice shows that everything is much
more complicated . The quality of images obtained
by the video processing system is affected by
too many factors: technical parameters of video
sensors, low or uneven lighting level, change in
scene illumination level due to weather conditions
(heavy cloud, fog, absence or presence of sunlight),
time changes (day and night illumination level)
or changes in scenarios in the scene (for example,
bright light from headlights of a car or a moving
train) . Images taken in such conditions contain
contrast distortion and low light intensity of the
whole image and its parts, have a narrow dynamic
range and high noise .
In practice, for example, low light conditions can
lead to confusion of textures and objects, poor ima-
ge recognition efficiency, poor segmentation, and
visual quality for visual inspection . In some cases,
poor quality of images obtained can lead to an
incorrect decision regarding events in the scene,
as well as to a complete failure of the system (for
example, a face recognition system in low light
conditions) .
The need for a successful solution to the problem
in obtaining quality data as a primary stage in the
4 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
whole process of image processing is substantiated
by the fact that the functioning of video analytics
systems provides maximum removal of a human
from the process of collecting and processing
images . This is because video systems receive too
much video data and they are usually redundant
and monitoring of images and adjustment of system
parameters by a human operator is monotonous
and difficult, but responsible . One of the options
to increase the capabilities of video information
processing systems is an automatic mode of
operation, in which a person has an opportunity
to intervene only to make decisions in some cases
based on images, the enhancement of which should
also be performed automatically .
Enhancements cover various aspects of image
correction, such as saturation, sharpness, noise
reduction, tonal adjustment, tonal balance, and
contrast correction/enhancement . To convert
images already taken by appropriate fixation
devices into a state more suitable for both
analysis and processing, a sufficient number of
quality enhancement methods have already been
developed, which can be divided into three groups:
global, local, and hybrid .
Global methods are applied to the entire image
and each pixel of the image must be changed under a
single transformation function for the entire image .
Local methods are used in cases where certain parts
of the image need different types of enhancement,
and their implementation is more complex . Hybrid
methods combine features of both local and global
groups . Occasionally, global contrast enhancement
techniques may cause problems with insufficient
or excessive pixel transformation in some parts
of the image [2] . In some cases, this problem can
be solved using local enhancement techniques,
where the conversion of an image pixel depends
on the information of adjacent pixels . However,
sometimes in such a situation, due to a lack of
global information about brightness, local artifacts
can occur [3] . Since video analytics systems, as a
rule, operate in extremely complex (in terms of
illumination) conditions and with images far from
an ideal quality, it is not always possible to use
local and hybrid methods of image enhancement .
It follows that the system must be balanced in
determining parameters at which captured images
and video sequences achieve the highest level
of enhancement with available means and in
automatic mode [4] . The last remark is especially
important because of illumination changes over
time (day/night, time movement of the sun), due
to weather conditions (rain, clouds, shadows) and
dynamic changes in scenarios (light of vehicle
lights), etc .
Image enhancement
Image enhancement boils down to improving
display quality and analysis, with the result that
one or more attributes of the image are changed .
The choice of attributes and the way they are
modified are specific to each application and often
enhancement methods are developed empirically .
The importance of the image enhancement
procedure is especially relevant in a presence of
feedback from the application (Fig . 1) .
Much attention is paid to the development of
methods for enhancing digital images [2, 5], espe-
cially in automated video analytics systems . And
many of them are focused on improving over dar-
kened or lightened images, which are a particular
problem for automatic video processing systems .
Among the significant number of image enhan-
cement methods, high efficiency has been proven
by methods that use nonlinear transformation func-
tions on the basis of the input data transformation
process [6] . This group includes methods of
enhancement based on gamma correction, which
effectively reflects properties of a human visual
Fig.1. Block diagram of an image enhancement process in
an automated image processing system with feedback
iSSN 2706-8145, control systems and computers, 2020, № 6 5
Image Enhancement in Video Analytics Systems
system (Human Visual System, HVS) and due to
simple adjustment and effective implementation
has found wide application . Gamma correction,
as one of the options for modifying the histogram,
converts a uniform distribution of grey levels to
increase the contrast of the image [7–8], providing
high efficiency at low computational complexity .
Gamma Correction
Gamma correction methods are a family of general
methods for modifying histograms obtained simply
by a variable adaptive parameter γ .
Values of γ are usually determined experimentally
by passing a calibration target with a full range
of known luminance values through the imaging
system (for example, the Macbeth diagram [9]) .
But often such calibration is not available or direct
access to the imaging device is not possible, for
example, when downloading an image from the
Internet . Also, in most commercial digital cameras,
a gamma parameter γ changes dynamically . It
should be noted that with a significant expansion
of various surveillance systems, video analytics,
machine vision, etc ., which usually use a wide
range of different means of capturing images, and
existing difficult illumination conditions, it is very
important to eliminate poor lighting, contrast and
more . All of the above forms the purpose of the
work, which is to develop an efficient approach to
providing a video analytics system with high-quality
images of the scene in an automatic mode with
elements of adaptation to changes in illumination .
This paper presents a novel, accurate, and
practical method for estimating the optimal
gamma parameter for a given image, which opens
the possibility for further work towards obtaining
enhanced images in video analytics systems .
The method requires neither knowledge of the
cameras used (model, settings, etc .) nor geometric
calibration in contrast to [10] or [11], and it
can be used in large variations of viewpoint and
illumination of the scene . The paper presents a
method for estimating the optimal value of a gamma
parameter in automatic mode for video analytics,
surveillance, and other applications in conditions
of probable changes in scene illumination due to
weather conditions, time changes, or changes
in the scene scenario, excluding direct human
intervention in the selection of this parameter .
It’s common knowledge that the biggest
problem for automated video processing systems
is the lighting mode of the scene . This means that
the quality of images at the input of a video system
depends directly on illumination and a situation
in the scene, which is an almost uncontrolled
and unpredictable process . Due to unpredictable
changes in lighting, images at the input of a system
become darker or too light . In this case histograms
of images also change their appearance . When
illumination changes a majority of histogram
bins shift towards minimum values (indicating
an increase of the number of pixels that reflect
darker intensity levels) or towards maximum values
(indicating an increase of the number of pixels that
reflect lighter intensity levels) of the lighting scale .
Correspondence of gamma correction to a human
visual system and good results in its application in
practice force researchers, to return to methods of
image enhancement based on gamma correction
and look for ways to automatically determine
a parameter of gamma γ in image processing
systems .
Gamma Correction and Images
Many devices used to capture, print, or display
images typically use gamma correction, also
known as a power-law transformation [6], on each
pixel of the image . The power function as a transfer
function is most often used in the form
γ
out inV AV= , (1)
where A is a coefficient and the input inV and the
output outV are non-negative real numbers . In a
general case, if A = 1, then the input and output
values are in the range from 0 to 1 (in a normalized
form) . Figure 2 shows transformation functions at
values of intensity levels from 0 to 255 . If γ = 1, the
characteristic of semitones is linear, and differences
in luminance of the object in light and dark tones
are the same . If γ < 1, then the brightness of the
image is shifted to the darker side of the spectrum,
otherwise, when γ > 1, the brightness of the image
is shifted to the opposite lighter part of the spec-
6 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
trum . This is seen in the histogram of the images
(Fig . 3) . The value of a gamma parameter equal to
one (γ = 1) will not affect the brightness of the input
image in any way .
Gamma is an image parameter that affects the
intensity of pixels of the original image . However,
not all image pixels are subject to change, but only
those that have medium brightness, i .e . not the
darkest and not the lightest . The intensity values of
the darkest and lightest pixels remain unchanged .
Which intensity values will not be affected, depends
on the specific value of a gamma parameter . Thus,
gamma adjustment only affects mid-tones .
Intuitively, image enhancement should lead
to higher contrast, higher edge intensity, and the
preservation of local and global information .
The simulation results of the gamma parameter
influence on the image quality using the developed
software prove that:
1 . the image quality varies depending on the value
of a gamma parameter γ, and hence the distribution
of intensity levels along the scale from 0 to 255;
2 . the contrast of the image directly depends on
the width of the range of intensity levels distribution:
the wider the range of intensity levels distribution,
the more pronounced the contours of objects;
3 . the contrast of objects in the image directly
reflects the ability to define contours of objects, for
example, using a Canny edge detector .
When studying the influence of a gamma
parameter on the image quality, it is also im-
portant to obtain a behaviour of some statistical
characteristics of test images and their compliance
with qualitative changes in variations of a gamma
parameter γ . If for the test image of size M×N
intensity levels of pixels are denoted through z
i
,
1,2,3, , 1i L= − , then a probability p(z
k
) of the
intensity z
k
in the image is estimated by the value
( )
×
k
k
np z
M N
= , (2)
where n
k
is the number of pixels with the intensity
z
k
in the image and M×N is the total number of
pixels .
Knowing p(z
k
) you can get such important
quantitative characteristics of the image as:
1 . Mathematical expectation (average value) of
the intensity of the whole image
( )
1
0
μ
L
k k
k
z p z
−
=
= ∗∑ . (3)
2 . A variance of intensity as a magnitude of the
scatter of intensity levels z around the mathematical
expectation . The variance is a convenient measure
of the image contrast, its dimension is equal to the
square of intensity values . Often for convenience
when comparing the contrast level instead of the
variance they usually use the standard deviation
σ (square root of the variance), because it has the
same unit of measure as the intensity
( ) ( )
1
22
0
σ
L
k k
k
z m p z
−
=
= − ∗∑ . (4)
3 . Image entropy — a parameter that characteri-
zes the variability of intensity
. (5)
The entropy is equal to 0 for the region of con-
stant intensity, i .e . when all p(z
k
) are zero and takes
the maximum value in case of equally probable
cases, i .e . when all p(z
k
) are equal to each other .
4 . The proportion of image pixels that belong to
edges in the image, relative to the total number of
pixels of the entire image detected by, for example,
a Canny edge detector
1
contourC N
M N
= ∗
∗ ; (6)
Fig.2. Power function of transformation at different
values of gamma parameter γ
( ) ( )
1
2
0
= – log
L
k k
k
E p z p z
−
=
∗∑
iSSN 2706-8145, control systems and computers, 2020, № 6 7
Image Enhancement in Video Analytics Systems
Fig. 3. Tank image and its histograms: a – the original image at γ = 1; b – the image at γ = 2,5; c – the image at γ = 7,0
(hereinafter, the vertical dotted reflect the first and last non-zero bins of the histogram)
a
b
c
8 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
where N
contour
— the total number of pixels, that
belong to edges in the image, detected by a Canny
edge detector .
All the above-mentioned characteristics provi-
de additional opportunities in determining the
optimal parameter of gamma γ [12] without any
additional means .
The results of simulation the influence of a
gamma parameter on the histogram of the test Tank
image (Fig . 2) state the fact of direct dependence of
indicated statistical characteristics of the image:
1 . The mathematical expectation or average
value of the image intensity changes from 0 towards
the intensity level 255 as the parameter gamma
increases (Fig . 4) .
2 . The intensity variance σ2, and hence the
standard deviation σ, as a magnitude of the inten-
sity scatter around the mathematical expectation,
varies, reaching maximum at a certain value of
a gamma parameter (Fig . 5) . Having calculated
variance values, it is possible to determine at which
values of a gamma parameter the adjusted images
should be assigned to the class of low or high contrast .
This can be determined under the equation [13]:
( ) 1
2
θ , 1 / τ,
θ , ,
D
g I
otherwise
≤
=
(7)
where D = diff (µ +2σ), (µ-2σ)) and τ are parame-
ters according to which the contrast of the image
is determined, σ and µ are the standard deviation
and the average intensity of the image, respectively .
Using equation (7), it is possible to classify the
image as low-contrast (when most of intensity
values of the image pixel accumulate in a small
range (Fig . 2a, c) . The criterion in equation (7) is
chosen according to the Chebyshev non-equation,
which states that at least 75% of the values of any
distribution are within 2σ around the mean on
both sides [14] . This leads to a simplified version
of the criterion for classifying the image as low-
contrast, namely as 4σ≤1/τ . In [13] determined
that τ = 3 is a suitable choice for characterizing
the contrasts of different images .
The corridor with a width of ± 2σ around the
graph representing how the average intensity
of the image depends on a gamma parameter
Fig.4. Dependence of the average intensity of the Tank
image on a gamma parameter (dotted horizontal line
shows the average value of the intensity scale, i .e . 128)
Fig.5. Dependence of the variance of image intensity on a
gamma parameter
Fig. 6. The corridor with a width of ± 2γ around the graph
showing how the average value of image intensity depends
on a gamma parameter
iSSN 2706-8145, control systems and computers, 2020, № 6 9
Image Enhancement in Video Analytics Systems
(Fig . 6) shows that not all values of a gamma
parameter corridor around the average intensity
curve are equal to 2σ on both sides (at γ<1,8 and
γ>5,1) . This does not correspond to Chebyshev
inequality [14], and thus leads to clustering values
of intensity and, as a result, to low image quality .
Also, the small value of the intensity va-
riance indicates a modest scatter of the values
of the intensity and a small difference between
the colors of the adjacent areas (Fig . 2,a
and 2,c) . From the graph showing how the in-
tensity variance depends on a gamma para-
meter (Fig . 5), it is seen that the value of the
intensity variance of the images in Fig . 2,a and 2,c
are well below the maximum .
3 . Entropy, as an indicator of variability of the
intensity values, reaches its maximum value within
limits of a gamma parameter, when the corridor
fully corresponds to the value of ±2σ (Fig . 7) . The
higher the value of entropy, the higher the intensity
variability, which indicates a much larger amount
of information that can be extracted from the
image . The entropy (5) takes the maximum value
in the case of equally probable values of intensity
levels, i .e . when all p(z
k
) are equal to each other .
4 . If the video analytics system is intended to
select objects in the scene, then as an option,
the ability to detect contours in the image, for
example, using a Canny edge detector at different
standard deviations of intensity (Fig . 8) can be
taken as a quality estimation for selecting the
gamma parameter . The percentage of defined pixels
belonging to contours determined by the detector
is taken as an estimate .
Gamma-Correction and an Image Histogram
A histogram (Fig . 3, right images) is a special di-
agram, which is somewhat similar to a mountain
range, illustrating the distribution of all colors (for
color images) or intensity levels (for gray images)
in the image (the graph shows the number of pixels
at each intensity level . A histogram allows you to
determine whether the image contains enough deta-
ils in shadows (left part of the histogram), in middle
tones (middle part of the histogram), and the ligh-
test areas of the image (right part of the histogram),
that is very important for quality image correction .
A histogram provides an idea of a tonal diagram
of the image (or type of image key) . In the image
in a lower key, details are concentrated in shadows;
high-key images contain the most details in bright
areas; and in the image in a middle key, details
are concentrated in middle tones . The width of a
histogram represents a tonal range of the image —
the range of colors from the darkest pixels to the
lightest — on a scale from 0 to 255 . Pure black (0) is
at the left end of the intensity scale, and pure white
(255) is at the right end of the intensity scale .
Fig.7. Graph of the dependence of the image intensity
entropy on a gamma parameter
Fig.8. Graph of the dependence showing the percentage
of image pixels, which belong to contours in the image,
detected by a Canny edge detector, from a gamma
parameter
10 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
Ideal from the point of view of color transfer
is the situation when the histogram is distributed
evenly over the entire area of the scale (Fig . 3, b),
i .e . it is placed between the left and right edges
of the histogram more or less evenly or at least
without zero values at the edges . If, after all, similar
zero values of the histogram take place at the edges
(Fig . 3, c in the range of intensity levels 230–255),
then, shifting the histogram in an appropriate di-
rection and removing empty spaces at the edges,
you can significantly improve the image quality —
remove from it cloudy, grayish shades, etc .
To study histograms of images and the effect
of gamma correction on the image quality, the
program was developed . It gives an opportunity to
set the value of a gamma parameter in the range
of 0,1 and beyond with a certain step . The gamma
parameter value of the image to be tested in the
developed software has a value of 1 . For certain
studies, this parameter can be changed in one
direction or another and analyze both the image
and its histograms . Fig . 9 presents a 3D family of
histograms of the Tank image at values of a gamma
parameter from 0,1 to 20,0 in steps of 0,1 . The
program gives a complete idea of the distribution
of histogram width, intensity values, mathematical
expectation, and variance of intensity depending
on a gamma parameter .
The result of these studies is to determine and
select the best image in terms of ensuring an optimal
segmentation of objects in the image and its visual
representation to the human operator .
Given that a histogram of the image shows
the relationship between intensity levels and
their corresponding frequency in the image, you
can adjust the gamma value based on calculated
histograms, you can see that the range of intensity
expands or narrows . But at the same time, there
is still some share of both the darkest (black) and
lightest (white) pixels (Fig . 2) .
From the analysis results of a large number of
test images and their histograms and [15–16], the
following conclusions follow:
in a dark image, gray levels (and, consequently,
the histogram) are grouped at the lower end of the
intensity scale (Fig . 3,a);
in a uniformly bright image, gray levels are grou-
ped at the upper end of the intensity scale (Fig . 3 c);
in a brightly balanced contrast image, gray
levels are more evenly distributed over a significant
part of the range (Fig . 3,b);
a narrow histogram indicates that a tonal range
(and hence a difference between the darkest and
lightest pixels) of the image is too narrow . Most
likely, the image at the same time looks flat enough
and it lacks details and contrast;
too uneven ridge indicates that colors of
the image are not balanced . Some colors may be
enough in the image, but too few others;
if the left edge of the histogram is a sharp peak,
the image is likely to have shadows cut off (when
shooting or scanning) . If the peak is located on
the right edge, bright areas of the image can be
cut off;
if the “mountain range” is shifted to the
left (towards black, i .e . zero), and the “plain”
stretches to the right, the image is underexposed
(it is too dark);
if the “ridge” is shifted to the right (towards
white, i .e . 255), and the “plain” is on the left, the
image is overexposed (it is too bright);
the image with a good balance of dark and light
colors gives a wide “mountain range”, occupying
the entire width of the histogram, quite long and
uniform in height .
Fig. 9. The family of histograms (3D) of the Tank image at
values of a gamma parameter from 0,1 to 20,0
iSSN 2706-8145, control systems and computers, 2020, № 6 11
Image Enhancement in Video Analytics Systems
Based on the above conclusions and analysis as
well as modeling of the effect of gamma correction
on a histogram and visual quality of test images, the
following results were obtained:
1 . When changing the gamma value from the mi-
nimum (γ
min
=0,10) to the maximum (γ
max
=20,0)
the histogram passes the process of transforming
the shape from the peak near zero bin of the
histogram at γ
min
to the peak near the 255 bin of the
histogram at γ
max
(Fig .10) .
2 . When changing the gamma value from the
minimum value (γ
min
=0,10) to the maximum
(γ
max
=30,0), the image changes from “very dark” to
“very bright” .
3 . The most favorable image for visual perception
corresponds to the most scattered histogram of the
image (Fig . 3) .
Thus, all of the above leads to the conclusion
that the highest quality image in a whole set of
images with different values of a gamma parameter
corresponds to the value of a gamma parameter at
which:
the image histogram is mostly scattered
throughout the intensity scale, that indicates the
most possible scatter of intensity(variance) and
the greatest dissimilarity of colors in adjacent
areas of images, and hence the presence of more
information in the image;
the mathematical expectation of intensity is as
close as possible to the average value of the intensity
scale, that ensures compliance with the Chebyshev
inequality when at least 75% of the values of any
distribution are within 2σ around the mean value
on both sides [14] .
Also, the practice of applying the “rule of three
sigmas” proves that in its implementation there is
every reason to consider the law of distribution of a
random variable normal . In this case, respectively,
the law of distribution of values of image intensity
is normal with all the consequences: mathematical
expectation, mode, and median take the same
value in some cases .
For more information on the distribution of
intensity levels, it is appropriate to pay attention to
the construction of a cumulative histogram of the
image .
Gamma Correction and
a Cumulative Histogram of the Image
A cumulative histogram of the image is nothing
more than a function of the probability distribution
of intensity levels . A distribution function in
probability theory is a function that characterizes
the distribution of a random variable . In our
case, a random variable is the intensity of pixels,
which takes values from 0 to 255 . A value of the
probability distribution function of intensity levels
is a probability that the random variable X (pixel
intensity level) will take a value less than or equal
to x, where x — arbitrary real number .
It is necessary to pay attention once again to the
above-mentioned statements, namely that:
1 . the best image corresponds to the value of
a gamma parameter, in which the histogram of
intensity levels is scattered across its width;
2 . the value of entropy takes the maximum in
case of equal probability of certain intensity level
occurrence, i .e . when all p(z
k
) from equation (5)
are equal to each other .
Fig.10. An example of changing the histogram peak position on the intensity scale of the Tank image depending on a gamma
parameter (hereinafter dotted vertical lines reflect the average values of intensity levels – red and median – yellow)
12 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
These two statements lead to the conclusion
that an “ideal” image will be with the following
data: all intensity levels have the same probability
of occurrence and the image histogram occupies
the entire width of the intensity scale from 0
to 255 . The probability function, in this case,
takes a piecewise linear view from 256 intervals
(the number of intensity levels) from 0 to 1,0 (or
from 0 to the total number of pixels in the image
without normalization) . This conclusion makes
it possible to consider the image with the above
data as an “ideal” sample image to compare the
images corrected by applying gamma correction
with an appropriate parameter . The cumulative
histogram of the “ideal” sample-image represents
a graph in form of an up-going staircase with 256
(the number of bins of the image histogram) equal
steps . Approximating the values of the cumulative
histogram of the “ideal” sample-image leads to the
conversion of the histogram into a straight line with
coordinates (0,0) – (1,255) (Fig .11) or an «identity
line» (hereinafter in the figures highlighted by a red
dotted line) [17] .
Fig .11 shows how the appearance of a cumulative
histogram of the image changes after adjustment .
Analysis of image histograms shows that the
Fig.11. Samples of cumulative histograms (normalized along the y—axis) of corrected images
and the «identity line» of the “ideal” image-sample
Fig.12. Graph of the dependence of MSE values on a gamma parameter on an example of the
Tank image (γopt
=2,5)
iSSN 2706-8145, control systems and computers, 2020, № 6 13
Image Enhancement in Video Analytics Systems
corrected image with the corresponding gamma
parameter has the best appearance for visual
representation when its cumulative histogram is
as close as possible to the cumulative histogram
of the “ideal” sample image . The degree of this
comparison can be estimated using the Mean
Squared Error (MSE) that is the average squared
difference between the normalized cumulative
histogram of the “ideal” sample image and the
cumulative histogram of the adjusted image for
each of the intensity levels:
( ) ( )
1
2
0
1
256
L
k
M SE c k Cdf k
−
=
= − ∑ , (8)
where c(k) and Cdf(k) are respectively values of the
normalized cumulative histogram of the “ideal”
sample-image and the cumulative histogram of the
corrected image, k — the intensity level .
Thus, having determined the minimum value
of MSE at a certain value of a gamma parameter,
we can say that this value of a gamma parameter
is optimal γ
opt
. This value indicates that γ
opt
is
the only value from all considered values of a
gamma parameter, which provides the maximum
approximation of value distribution of the image
intensity to the “identity line” of the “ideal”
sample-image (Fig .12) .
experimental results
Determining the optimal value of a gamma parameter
γ
opt
by the proposed method makes it possible to
adjust the quality of images entering a processing
unit of the video analytics system, automatically and
without human intervention . The developed method
for determining an optimal gamma parameter was
tested on a large number of images with different
characteristics and gave good results .
The conducted research of results allows us to
draw the following conclusions:
1 . The use of an “ideal” image sample, which
has a uniform distribution of intensity levels across
the intensity scale from 0 to 255, and the same
probability values of intensity levels, as a reference
for comparison is an effective mechanism for
determining the optimal value of a gamma
parameter .
2 . The optimal value of a gamma parameter
corresponds to the image for which:
the most dispersed set of values of intensity
levels throughout the intensity scale;
values of statistical characteristics of a
probability density function of image intensity
are closer to a normal law of intensity dispersion:
mode, median, and mean occupy positions in the
middle (128) of the intensity scale;
most levels of image intensity under the
Chebyshev inequality fall in the range from
± 2σ to ± 3σ on both sides of the average image
intensity;
percentage of pixels belonging to contours in
the image, which are detected by an edge detector,
for example, a Canny edge detector at 2σ, 3σ,
and hysteresis in the range of 50 ÷ 200, is the
maximum .
3 . Variance and standard deviation of the
intensity can in no case be used as a criterion for
selecting the optimal value of a gamma parame-
ter since for images with a wide dynamic range
(for example, the Street image in Fig . 13 and the
Knight image in Fig . 14 the peak of intensity shifts
from the beginning of the scale towards the end
of the scale, as a gamma parameter increases .
This is especially evident in Fig .13,h and 13,i .
Also, in Fig . 13,h it is seen that the curve of the
average image intensity disperses with the main
set of intensity values, which forms the image
itself, due to the high peak at the beginning of the
scale . Because of this, there is a situation where
the average value of the image intensity is in the
middle of the scale, the variance is largely due to
peaks on both sides of the scale, and the ability
of an edge detector to detect contours in the
image decreases significantly . It is the proposed
method that allows in such a situation to identify
the optimal value of a gamma parameter with the
most dispersed distribution of intensity levels .
4 . Selecting the “ideal” sample image as a
reference to determine the optimal value of a
gamma parameter of adjusted images gives an
additional advantage . Of course, for an image with
a normalized cumulative histogram, a graphical
representation of which is a line (as for the «ideal»
sample image) with coordinates (0, 0) – (1, 256),
14 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
a
b
c
d
iSSN 2706-8145, control systems and computers, 2020, № 6 15
Image Enhancement in Video Analytics Systems
the average intensity value is 128! Therefore,
to determine the optimal value of a gamma
parameter, you can also use the dependence of the
average image intensity on the value of a gamma
parameter (Fig . 13, i)) . This graph indicates that
the intersection point ordinate (X-axis) of the
graph of dependence of the average image intensity
on a gamma parameter with the average level (128)
of intensity scale corresponds to the optimal value
of the gamma parameter γ
opt
.
Conclusions
A method has been developed for determining the
optimal value of a gamma correction parameter
of the image, which ensures the selection in
automatic mode of the best quality scene image
for further processing . To achieve the set goal of
this work, the concept of an “ideal” image sample
was introduced into the process of determining
the optimal value of a gamma parameter, which
Fig.13. Results of selecting the optimal value of a gamma parameter on the example of the Street image: a – the original
and selected adjusted image; b – histograms of the original image; c – histograms of the image with a gamma parameter
(γ
opt
=3,2); d – selection of the optimal gamma parameter (γ
opt
=3,2); e – proportion of image pixels belonging to edges
detected by the Canny edge detector in the image with γ
opt
=3,2; f – dependence of the average image intensity on a gamma
parameter; h – the family of histograms of images at different values of the gamma parameter; i – dependence of the
standard deviation of intensity on the value of the gamma parameter
e f
h i
16 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
Fig.14. Example of a very bright image: a – original and selected adjusted images; b – selection of the optimal gamma
parameter (γ
opt
= 0,17); c – cumulative histograms of original and adjusted images; d – a graph of dependence of detector
edge Canny ability to determine the contours in the image at different values of the standard deviation of intensity; e – the
intersection of the dependence curve of the average image intensity on a gamma parameter and the average level of intensity
scale at γ
opt
a
b
c
d
e
iSSN 2706-8145, control systems and computers, 2020, № 6 17
Image Enhancement in Video Analytics Systems
Fig. 15. Example of application of gamma correction to a darkened image: a – original and selected adjusted images;
b – selection of the optimal gamma parameter (γ
opt
=1,85); c – cumulative image histogram at γ
opt
=1,85; d – the intersection
of the dependence curve of the average image intensity on a gamma parameter and the average level of the intensity scale
at γ
opt
; e – the ordinary histogram and the contour of the corrected image histogram with a mean (red vertical line) and
median (yellow vertical line)
a
b
c
d
e
18 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
REFERENCES
1 . Golovin O ., 2019 . “Analiz natovpu lyudey iz zastosuvannyam metodiv kompyuternoho zo-ru” [“Analysis of the crowd
of people using computer vision”], Computer tools, networks, and systems, 18, pp . 45–57 . (In Ukrainian) .
2 . Cheng H ., Shi X ., 2004 . “A simple and effective histogram equalization approach to image enhancement”, Digital
Signal Process, 14 (2), pp . 158–170 .
3 . Celik T ., Tjahjadi T ., 2011 . “Contextual, and variational contrast enhancement”, Image Process . IEEE Trans, 20 (12),
pp . 3431–3441 .
4 . Boyun V ., 2016 . “Directions of development of intelligent real-time video systems”, 2016 Int . Conf . Radio Electron .
Info Commun . pp . 1–7 .
5 . Coltuc D ., Bolon P ., Chassery J .-M ., 2006 . “Exact histogram specification”, Image Process . IEEE Trans ., 15 (5), pp .
1143–1152 .
6 . Gonzalez R . C ., Woods R . E ., 2008 . Digital Image Processing, Addison-Wesley, Boston, MA, USA .
7 . Kaur M ., Kaur J ., 2011 . “Survey of contrast enhancement techniques based on histogram equalization”, Int . J . Adv
Comput . Sci . Appl ., 2 (7), pp . 137–141 .
8 . Arici T ., Dikbas S ., Altunbasak Y ., 2009 . “A histogram modification framework and its application for image contrast
enhancement”, IEEE Trans . Image Process, 18 (9), pp . 1921-1935 .
9 . Chang Y .-C ., Reid J . F ., 1996 . “RGB calibration for analysis in machine vision”, IEEE Transactions on Pattern
Analysis and Machine Intelligence, 5 (10), pp . 1414–1422 .
10 . D’γaz M ., Sturm P ., 2011 . “Radiometric Calibration using Photo Collections”, IEEE International Conference on
Computational Photography, ICCP 2011, Pittsburgh, Etats-Unis, pp . 1–8 .
11 . Debevec P .E ., Malik J ., 1997 . “Recovering high dynamic range radiance maps from photographs”, Proceedings of the
24th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH ’97, ACM Press/Addison-
Wesley Publishing Co ., New York, NY, USA, pp . 369–378 . DOI: 10 .1145/258734 .258884 .
12 . Farid H ., 2001 . “Blind inverse gamma correction”, Image Processing, IEEE Transactions, 10, pp . 1428–1433 .
13 . Rahman S ., Rahman M . M ., Abdullah-Al-Wadud M ., Al-Quaderi G . D ., Shoyaib M ., 2016 . “An adaptive gamma
is characterized by the same probability of the
appearance of image intensity levels and the
dispersion of the image histogram over the
entire intensity scale . With such image data, the
probability function of intensity levels takes a
piecewise linear form with 256 intervals (in terms
of the number of intensity levels) from 0 to 1,0 (or
from 0 to the total number of pixels in the image
without normalization) . The cumulative histogram
of such an “ideal” image sample represents a graph
in the form of an ascending staircase with 256 (in
terms of the number of intensity levels) equal steps,
and the approximation of cumulative histogram
values of the “ideal” image sample results in the
transformation of the histogram into a straight
line with coordinates (0, 0) – (1,255) (Fig . 11) or
“identity line” .
The method is based on minimizing the root-
mean-square difference between the cumulative
histogram of the gamma-corrected image and
the corresponding histogram in the form of an
“identity line” of the introduced “ideal” image
sample .
The developed toolkit for automatic determina-
tion of the optimal value of the gamma parameter,
and then of the best image for visualization and
subsequent processing, significantly increases the
efficiency of video analytics systems, segmentation,
and image processing processes by reducing the
negative effect of a scene illumination mode on
image quality .
The proposed method is distinguished by the
ability to bring the image quality to the highest
possible level of quality in automatic mode and by
the available elements of adaptability to changes in
an illumination mode of the scene of attention . The
effectiveness of the method allows it to be applied
to a wide range of images and video sequences .
iSSN 2706-8145, control systems and computers, 2020, № 6 19
Image Enhancement in Video Analytics Systems
correction for image enhancement”, EURASIP Journal on Image and Video Processing, 35 (2016) . DOI: 10 .1186/
s13640-016-0138-1 .
14 . Saw J . G ., Yang M . C ., Mo T . C ., 1984 . “Chebyshev inequality with estimated mean and variance”, The American
Statistician, 38 (2), pp . 130–132 .
15 . McAndrew A . A ., 2015 . Computational Introduction to Digital Image Processing, Chapman and Hall / CRC: Boca
Raton, FL, USA .
16 . Snider L . 2014 . Photoshop CC: The Missing Manual . 2nd ed . O’Reilly Media .
17 . Bertalmγo M ., 2019 . Vision models for high dynamic range and wide color gamut imaging: techniques and
applications, Academic Press, New York .
Received 24 .11 .2020
О.М.Головін, кандидат техічних наук, старший науковий співробітник,
Інститут кібернетики імені В .М Глушкова НАН України,
03187, м, Київ, просп . Академіка Глушкова, 40, Україна,
o .m .golovin .1@gmail .com
ПОКРАЩЕННЯ ЗОБРАЖЕНЬ В СИСТЕМАХ ВІДЕОАНАЛІТИКИ
Вступ . Досягнення основної мети системи відеонаналітікі, а саме, розуміння сцени вирішується через процеси
виявлення та розпізнавання об’єктів і встановлення причинно-наслідкових зв’язків між ними . Ефективність і
якість роботи подібної системи безпосередньо пов’язанo з обробкою великої кількості зображень і не завжди
високої якості . Потреба в успішному вирішенні проблеми отримання якісних даних, як початкової ланки всього
процесу обробки зображень, посилюється тим, що в системах відеоаналітики передбачається максимальне
усунення людини від процесу збору і обробки зображень . Це обумовлено тим, що відеосистеми отримують
занадто великі обсяги відеоданих і вони, як правило, надлишкові, а контроль зображень і регулювання
параметрів системи з боку людини-оператора є монотонним і важким, але відповідальним . Одним з варіантів
підвищення ефективності систем обробки відеоінформації є автоматичний режим функціонування, при якому
людині залишається можливість втручання лише для прийняття рішень в окремих випадках на основі зображень,
поліпшення якості яких має також виконуватися в автоматичному режимі .
Мета статті . Системи відеоаналітики функціонують в автоматичному режимі з великою кількістю зображень і
відеопослідовностей та з мінімальним втручанням людини в процес їх здобуття і обробки . Однією з найвагоміших
проблем, від вирішення якої залежить ефективність роботи системи відеоаналітики, є якість здобутих зображень,
на які впливає багато зовнішніх чинників . Одним з них є зміни в режимі освітлення сцени, які складно не тільки
усунути, а й передбачити (погодні умови, часові зміни, ситуація в сцені та інше) . Зображення, зняті в таких
умовах, містять спотворення контрасту і низьку інтенсивність освітлення як усього зображення, так і окремих
його ділянок, мають вузький динамічний діапазон і сильний шум . Складнощі, що виникають в результаті змін
освітлення, призводять не тільки до некоректної роботи всієї системи, а й до повного відказу . Все вищесказане
формує мету роботи, яка полягає в розробці ефективного підходу до забезпечення системи відеоаналітики
якісними зображеннями сцени в автоматичному режимі з елементами адаптації до змін освітленості .
Методи дослідження базуються на системному підході, програмному моделюванні, аналізі .
Результати . Розроблено метод для визначення оптимального значення параметра гамма-корекції зображень,
при якому забезпечується вибір в автоматичному режимі найбільш якісного зображення сцени для подальшої
обробки . Метод відрізняється здатністю приведення якості зображення до максимально можливого рівня якості
в автоматичному режимі та наявними елементами адаптивності до змін у режимі освітленості сцени уваги .
Висновки . Розроблено метод для визначення оптимального значення параметра гамми-корекції зображень,
при якому забезпечується вибір в автоматичному режимі найбільш якісного зображення сцени для подальшої
обробки . Для досягнення поставленої мети цієї роботи в процес визначення оптимального значення параметра
гамма введено поняття «ідеального» зразка зображення, яке характеризується однаковою ймовірністю появи
рівнів яскравості зображення та розосередженням гістограми зображення по всій шкалі яскравості зображення .
20 iSSN 2706-8145, системи керування та комп'ютери, 2020, № 6
O.M. Golovin
При таких даних зображення функція ймовірності рівнів яскравості приймає кусочно-лінійний вигляд з 256
інтервалів (за кількістю рівнів яскравості) від 0 до 1,0 (або від 0 за загальною кількістю пікселів в зображенні
без нормалізації) . Кумулятивна гістограма такого «ідеального» зразка-зображення представляє графік у формі
висхідних сходів з 256 (за кількістю рівнів яскравості) однакових сходинок, а апроксимація значень кумулятивної
гістограми «ідеального» зразка-зображення призводить до перетворення гістограми в пряму лінію з координатами
(0,0) – (1,255) (рис . 11) або «лінію ідентичності» .
В основі методу лежить мінімізація середньоквадратичної різниці між кумулятивною гістограмою скори-
гованого за допомогою гамма-корекції зображення та відповідною гістограмою введеного «ідеального» зразка-
зображення у вигляді «лінії ідентичності» .
Розроблений інструментарій визначення в автоматичному режимі оптимального значення параметра гамма,
а відтак і найкращого зображення для візуалізації та подальшої обробки суттєво підвищує ефективність систем
відеоаналітики, процесів сегментації та обробки зображень за рахунок зниження негативного впливу режиму
освітлення сцени на якість зображень .
Запропонований метод відрізняється здатністю приведення якості зображення до максимально можливого
рівня якості в автоматичному режимі та наявними елементами адаптивності до змін у режимі освітленості сцени
уваги . Ефективність методу дозволяє застосовувати його до широкого спектра зображень і відеопослідовностей .
Ключові слова: гамма-корекція, покращення зображення, система відеоаналітики, гамма параметр, гістограма,
комп’ютерний зір, сегментація .
|