Rakhmanov Hoshim Erdanovich, Ph D., doctorant the Faculty of Computer Engineering Tashkent University of Information Technologies named after Muhammad al-Khwarizmi E-mail: [email protected]
H =
0, 60°
60°
60°
60°
H e [0,360],S,V,R,G,B e [0,l].
MAX = MIN
MAX - MIN
B -R
MAX - MIN
B - R
MAX - MIN
R -G
MAX - MIN
S =
+ 0°,
+ 360°,
+120°,
+ 240°, 0, if else
if MAX = R and G > B , if MAX = R and G < B , if MAX = G
, if MAX = B
MAX = 0 MIN
ALGORITHM FOR LOCALIZING THE IMAGE OF A ROAD SIGN USING COLOR AND CONTOUR ANALYSIS METHODS
Abstract: This article offers an efficient algorithm for preprocessing digital images for further detection of traffic signs in real time. The article considers the possibility of using the HSV color space, HSL for red color extraction.
Keywords: pattern recognition, localization, correlation, contour analysis, color analysis.
Quite often, novice and already experienced drivers face a number of problems while driving a vehicle. The driver needs ro, f
to keep track of the markings on the road and see all road signs q - %
in order to avoid emergency and unforeseen situations. To facilitate the life of motorists, road sign recognition systems are being developed. For the first time they were installed in 2008 on expensive cars of the BMW 7 series, and then on the Mercedes-Benz S-Class. Modern systems that detect signs of speed limits can be found throughout Europe.
The recognition of a road sign can be divided into two stages: the localization of the sign on the image and the process of recognizing the localized sign. To date, many methods eise i — of recognition have been developed [1, 8-9].
Modern road signs are designed in such a way that the driver can almost immediately identify the road sign. This is possible due to a limited set of possible colors, geometric shapes and sizes. In particular, only four colors are used: white, red, yellow and blue [2, 484-488].
Specific conditions of illumination significantly affect the possibility of correct perception of the color of objects of the scene being shot [3, 226-228]. When shooting a real road situation on signs, a number of different lighting conditions arise, greatly complicating the detection of objects: direct sunlight, reflected light, shading, car headlights in the dark. Moreover, different distorting effects can be present on one road sign simultaneously.
Thus, on images obtained from a camera installed in a car, it is not always possible to select the area of interest by color by simply applying a threshold filter directly to the RGB (Red, Green, Blue) color space [4, 402-404].
To extract the color (red, blue, white, yellow) from the input image, it is necessary to use information about the color of each pixel, regardless of its uncontrolled light intensity. For these purposes, we can use the HSV (Hue, Saturation and S = Value) or HSL (Hue, Saturation, Lightness) color space.
Most digital sensors receive input images in RGB format. Below is its conversion formula from the RGB color scheme.
MAX V = MAX
where R, G, B - color values in the RGB color model, values in the range (R - red, G - green, B - blue); MAX - maximum of three values (R, G, B); MIN - minimum of three values (R, G, B); H is the hue [0; 360); S is the saturation [0; 1]; L is the value of[0; 1].
The HSL(Hue, Saturation, Lightness). Below is its conversion formula from the RGB color scheme. unknown if MAX = MIN
G - B _„
if
H =
60° •
60° •
60° •
60° •
MAX - MIN
G -B
MAX - MIN
B -R
MAX - MIN
R - G
+ 0°
MAX = R and G > B
MAX - MIN 0, eenu L = 0 unu MAX = MIN MAX - MIN MAX - MIN
+ 360° if MAX = R and G < B +120° if MAX = G + 240° if MAX = B
MAX + MIN MAX - MIN
2 -(MAX + MIN ) 1, ecnuL = 1
2L
MAX - MIN 2 - 2L
, ecnu 0 < L < — 2
,ec7iu— < L < 1 2
L = ^ (MAX + MIN),
where R, G, B are the color values in the RGB color model, values in the range (0; 1) (R is red, G is green, B is blue); MAX - maximum of three values (R, G, B); MIN - minimum of three values (R, G, B); H is the hue (0; 360); S is the saturation (0; 1); L is the lightness (0; 1).
This method of localization, which is a modification of the generalized Huff transformation. The developed algorithm shows effective results and works well with pre-processed images. Figures 1 (a) and 1 (b) show fragments of the original images with road signs marked on them.
a) b)
Figure 1. Example of a localized sign
Algorithm for the localization of the sign using the meth- 1) Considering the size of the sign, we perform the de-
ods of contour analysis and the detector Canny:
tection procedure based on the Canny detector with certain parameters (see Fig. 2).
a) b)
Figure 2. The result of the detection: a) a fixed frame; b) the image at the output of the Canny detector
to scan the scene in order to find the upper left boundary pixel of the contour. The second step is to trace the contour line, according to the boundary points. In the third step, we need to generate the code that will describe the outline. Thus, at the output of the Rosenfeld algorithm, a contour of the selected object will be formed, which is a vector of complex numbers r = {Yk }0 K formed according to the following rule, presented in (Fig. 3).
In computer vision systems, there are several ways of encoding the contour, the most famous of which is the complex-Figure 3. Coordinrates of the elementary vector with valued Freeman code, in which the contour is encoded by a complex-valued coding. sequence of complex numbers that determine the displace-
2) We construct contours on the basis of the Rosenfeld ment of the current contour point relative to the previous one. algorithm [5, 68-71]. To form the contour, Rosenfeld's algo- Each displacement vector is represented by a complex number rithm is used, which consists of several steps. The first step is of the form a + i -b, where a is the displacement of the point
along the axis X b is the displacement along the axis Y, i is the imaginary unit. To uniquely determine the position of the contour in the raster, we must also store the starting point of the contour, which determines the position of the contour relative to the coordinate axes of the raster. The contours are always closed and can not have self-intersection. This makes it possible to uniquely determine the path bypassing the contour (up to the direction of the by pass, either clockwise or counterclockwise). The last vector of the contour always leads to the starting point[6, 157-158].
3) For each loop found, we produce a consistent filtering ofits length N with references contour ro = {i ,i ,i,___,1,1,1}
, r ={1,1,1,... - i, -i, —'}, r2 = {—i, -i, -i,...,-1,-1,-1}
, r3 = {—1,—1,—1,___,i,i,ij ,which correspond to the four
corners of the rectangle. For this, we calculate the values of the reports of the mutual-correlation function between the current contour r and all standard contours T0, r1, T2 and r3 using the formula[7, 528-530]:
r(m) _ h —
n=0
-I )mod K
■Y
where ||r
,(' )
(i )
V 1 ■fr ||
-norm of the contour
, i = 0,...,K-1. (1)
r(i ) =
(I )
0,N-1
r I - norms of the standard contours,
Yn Y(n+1 )modK '
m = 0,...,3.
Degree of proximity of the contour section
r(i )
erence contours T0, ri, T2, r3 is determined by the value of the module of the current report of the normalized cyclic cross-correlation function between these standard contours
(m)
i = 0,.,K-1, m = 0,...,3 . If the value
(m)
'l I — "V -w I>i
greater than the threshold value U0, then the angle m is considered found, and the index of the report of the normalized cyclic cross-correlation function with the value |r/m' | > U0 will set the offset of the starting point of the contour relative to the reference:
ind = i, ecra
(m)
> U
(2)
l0
4) A rectangle is considered to be found correctly if its corners were found one after the other in the following order:
(r0, ri, r2, r0 , (Г1, ^2 , ^ r^ , (r2 , Гз, Г0, r0 HAH
(Гз,^Гl,r2).
In (Fig. 4). Graphs of the values of the correlation function between the contour of the sign and the reference contours are presented.
Figure 4. Graphs of the values of the cross-correlation function between the contour of the quadrangular sign and the reference contours
5) Knowing the starting point of the processed contour, we find the angles of the sign.
6) Knowing the coordinates of the angles of the sign plate from the previous steps, we draw a sign (see Fig. 5).
Figure 5. Localized traffic sign
Despite the disadvantages inherent in contour analysis when merging contours of closely located objects, the methods of contour analysis are attractive due to their simplicity and speed. In the presence of a clearly expressed object on a contrasting background, contour analysis methods are good at recognizing the plate of a road sign.
The method of color analysis has proved itself well, for extraction of colors (red, blue, white, yellow), which is applied to road signs. The color space of HSV(Hue, Saturation and Value), HSL(Hue, Saturation, Lightness) was used.
References:
1.
2.
3.
Nikonorov A. Traffic sign detection on GPU using color shape regular expressions / A. Nikonorov, P. Yakimov, P. Maksimov // VISIGRAPP IMTA-42013.- 2013.- Paper - No. 8.
Belaroussi R. Road Sign Detection in Images / R. Belaroussi, P. Foucher, J. P. Tarel, B. Soheilian, P. Charbonnier, N. Paparoditis // A Case Study, 20th Inter- national Conference on Pattern Recognition (ICPR) - 2010.- P. 484-488. Yakimov P. Detection and color correction of artifacts in digital images / S. Bibikov, R. Zakharov, A. Nikonorov, V. Fursov, P. Yakimov // Optoelectronics, Instrumentation and Data Processing.- 2011.- Vol. 47. issue 3.- P. 226-232.
4. Yakimov P. Preliminary processing of digital imagesin the systems of localization and recognition of road signs / Computer Optics,- 2013.- Vol. 37. - No. 3.- P. 401-405.
5. Rakhmanov H. E. Solution of the problem of recognition of vehicle license plates by the method of contour analysis / Rakhmanov Kh.E. // Bulletin of the PSTU, "Radio technical and infocommunication systems",- No. 3.- 2014.- P. 66-73.
6. Rakhmanov H. E. Recognition of texts by the method of contour analysis / A. N. Leukhin, N. V. Parsaev // Reports of the 67s All-Russian Conference with International Participation "Scientific Session on the Day of Radio - RDC-2012",-Moscow,- 2012.- P. 157-158.
7. Rakhmanov H. E. Algorithm for localization of the image of the registration number plate of the car using the methods of contour analysis / A. N. Leukhin, N. V. Parsaev, Kh. E. Rakhmanov // Reports of the 16th International Conference "Digital Signal Processing and its Application - DSPA-2014",- Moscow,- 2014.- Vol. 2.- P. 528-530.