Image Processing & Communications, vol. 20, no. 4, pp.5-12 DOI: 10.1515/ipc-2015-0039
5
HISTORY DEPENDENT VITERBI ALGORITHM FOR NAVIGATION PURPOSES OF LINE FOLLOWING ROBOT
G RZEGORZ M ATCZAK P RZEMYSLAW M AZUREK Department of Signal Processing and Multimedia Engineering West Pomeranian University of Technology Szczecin, 26. Kwietnia 10 St., 71126 Szczecin, Poland
[email protected],
[email protected]
Abstract. Line following robots are applied
robot.
in numerous applications and the best perfor-
Line following robots are robust if the quality of line is
mance could be obtained if the forward looking
high. Mobile robot body could be used as a shield for
camera is applied. Variable light and line condi-
the surrounding lights and apply own illumination sys-
tions influence the line estimation and quality of
tem, that is used in simplest cases. Forward looking cam-
the robot navigation. Proposed History Depen-
era needs advanced image processing algorithms and op-
dent Viterbi Algorithm and Viterbi Algorithm
tical techniques for the suppression of variable condition
are compared. Obtained results using Monte
of line surface illumination. Intentionally created lines
Carlo tests show improved performance of the
could be controlled and corrected by humans, so the qual-
proposed algorithm for assumed model.
ity of them could be high. There are some applications areas where it is impossible and the line is not directly ob-
1
served. Such lines are contaminated by numerous factors
Introduction
so SN R (Signal–to–Noise Ratio) is low. Extremely cases
Line following robots are applied in numerous application occur for SN R < 1 so line is hidden in the noise floor. because they use very simple navigation system. Optical or magnetic sensors are used for the estimation of inten-
1.1
Related works
tionally created track. Machine vision system could be The first line following robots is the Stanford Cart [13] very simple and the simplest uses two pixels, so differ- that uses forward looking camera. There are numerous ence of signal from them could be applied directly for the applications, where the line is well established. Line folrobot control. More advances sensors are used typically lowing robots are applied in automated factories for comand forward looking cameras give the best performance, ponents delivery [4]. Another application is the line debecause the line is not examined under the robot only, but parture warning systems [16]. Lines could be observed the estimation is related to the line shape in a front of the as the edge between two different surfaces due to lightUnauthenticated Download Date | 4/10/16 5:57 PM
6
G. Matczak, P. Mazurek
ness, color or texture variations, that occurs in harvest- the best line. In next windows this algorithm adds a mean ing [12, 1] and runway cleaning tasks. Line following value in all window ranges. The best previously line derobots are used in education and entertainment [2], and a termines the weak disturb line in the next windows. There lot of simple algorithms are proposed. The tracking of the is an influence of the past window on the current window. power lines is also challenging task for UAVs [3]. Addi- Part of value obtained for the best line is preserved and tional trajectory filtering may improve results in the spa- reused in the next window position as an additive component added to V matrix in the Viterbi algorithm. In His-
tial domain [5].
One of the most important contribution for the line fol- tory Dependent Viterbi Algorithm this value is stored for lowing robots is the application of Track–Before–Detect future purpose. The Vnn+1,x values are listed in equation algorithms, that could be applied even for the SN R < 1
1.
cases [15, 7, 8]. The computation cost is not important for available processing devices, nowadays. Viterbi
Vnn+1,x = max(Vn,x+g + dn+1,x n,x+g )
algorithm [17] is applied in communication system and could be used for the image processing for the line estimation [14].
1.2
(1)
The details about depth parameter are described in [6]. New approach was adding into local cost Vnn+1,x /depth
Contribution and Content of the Paper
value. This can be view as equation 2:
New line tracking algorithm (History Dependent Viterbi
dn+1,x n,x+g =
Algorithm) is proposed and tested in the paper. This algo-
n X
X(y 0 , x0 ) + Vnn+1,x /depth,
(2)
(y 0 ,x0 )=l
rithm is considered in Section 2. The analysis of properties is based on the Monte Carlo approach that is described where l is the line between the pixel (n, x + g) and the 0 0 in Section 3. The results for assumed model of line vari- pixel (n + 1, x), with pixels (y , x ). ability and distortions are shown in Section 4. Comparative results for the limited model variance are considered in Section 5. Discussion is provided in Section 6 and fi-
3
Line Model and Monte Carlo Approach
nal conclusions as well as further works are presented in Section 7.
Example results for single tracking case are shown in Fig. 1.
2
History Dependent Viterbi Algorithm
The advantages of the proposed algorithm are visible as a reduced number of white points that spread across image for Viterbi algorithm. This is the results of low SNR
Viterbi algorithm is considered in previous publica- and the property of algorithm that does not use previous tions [9, 10, 11], so detailed description is omitted in this computations. paper. Viterbi algorithm find a most probably line in the
Monte Carlo allows testing algorithms using pseudo
window. The window is moving to about specific amount random number generators, so unbiased results could be forward. That forward phase can be compared to the dis- obtained. This is time consuming task, but allows the testtance that camera walks between a frames. History De- ing if the model of the process is available. The model of pendent Viterbi Algorithm saves the highest value from the line and distortions uses a few independent parameters Unauthenticated Download Date | 4/10/16 5:57 PM
7
Image Processing & Communications, vol. 20, no. 4, pp. 5-12 Noised Image
Disruption = 0.25 50
100
100
100
100
200 10 20 30 40 50 x Viterbi
150
150
200
200
10 20 30 40 50 x History Dependent Viterbi
y
50 y
50
150
150 20
40
200
60
x Disruption = 0.50 50
50
100
100
100
100
150
150
200
200
200 10 20 30 40 50 x
20
40 60 x Disruption = 1
150 20
10 20 30 40 50 x
40
200
60
20
x
40
60
x
Fig. 2: Example line parameters - disruption
Fig. 1: Example of line estimation using both algorithms
Dynamic = 0
and the correct line is available, so the calculation of the error for analyzed algorithms is possible. The main type y
of error that is considered in the paper is the horizontal error. The synthetically generated images, consist of line,
Dynamic = 0.25
50
50
100
100
y
150
y
50
y
50 y
y
Disruption = 0
50 y
y
Orginal Line
150
generated from the bottom to top of the image and this is
150
200
20
the order of analysis for the algorithms also. There are no
40
200
60
x Dynamic = 0.50
significant changes for direction, because such images are
20
40 x Dynamic = 1
60
equivalent to the single or a few image frames. 50
multiple lines that are parallel to the original line. Such
100
100
lines increase the probability of the switching of the estimation algorithm to such false line. Real case is related
y
50 y
Disruption (Fig. 2) is related to cases where there are
150
150
200
20 x
to the surface in manufacture or road where multiple lines are available due to surface deterioration by wheels.
40
60
200
20
40
60
x
Fig. 3: Example line parameters - dynamic
Next parameter is the dynamic value (Fig. 3) and this parameter is responsible for changes of the line direction. Line visibility is also important and is related to the
Monte Carlo test could be used for some fixed or variSNR value (Fig. 4). Fixed value (brightness) of the line is able parameters (global approach). The first approach asassumed and the additive Gaussian noise is added to the sumes the independence of parameters. The second apimage (background and line).
proach is more reliable but it is time consuming. Both
Another parameter is the line width, that could be fixed algorithms are quite fast event if the Matlab implementaor variable. This parameter is controlled also (Fig. 5).
tion is used.
Unauthenticated Download Date | 4/10/16 5:57 PM
8
G. Matczak, P. Mazurek
50
100
100
150
150
200
200 40 x std. dev. = 0.50
20
40 x std. dev. = 1
50
50
100
100
y
y
20
150
150
200
200 40
6
4
2
0
0.2
40
0.4 0.6 std. dev.
0.8
1
x
Fig. 4: Example line parameters - additive noise Line Width = 1
Fig. 6: Global results for Viterbi Algorithm and History Dependent Viterbi Algorithm – std. dev.
Line Width = 2
4
2.5
50
100
100
150
150
200
200 10 20 30 40 50 x Line Width = 3
x 10
Viterbi History Dependent Viterbi
2
10 20 30 40 50 x Line Width = 5
number of trials
50 y
y
Viterbi History Dependent Viterbi
8
0 20
x
mean of horizontal error
50
20
10
std. dev. = 0.25
y
y
std. dev. = 0
1.5
1
50
100
100
y
y
0.5
50
150
0
150
200
0
2
4 6 mean of horizontal error
8
200 10 20 30 40 50 x
10 20 30 40 50 x
Fig. 7: Viterbi Algorithm and History Dependent Viterbi Algorithm histograms
Fig. 5: Example line parameters - line width ..., 20), maximal height of disruption line was 5 and max-
4
Results for Global Approach
imal width of disruption line was 2. The dynamic of line was in range (0, 0.1, 0.2, ..., 2).
Global Monte Carlo test was performing for fixed algo-
The results of Monte Carlo tests for 10 random tracking
rithm parameters but in wide range of line parameters. cases are presented in Fig. 6. Test consist of 10x21x21x2 Fixed algorithm parameters was depth = 16 and Tran- = 41510 single cases. sition set (-4, -3, -2, -1, 0, 1, 2, 3, 4). Gaussian noise in
The histogram comparison is shown in Fig. 7.
std. dev. range (0 − 2.0) every 0.1 value. The width of
Global results with specified range for dynamic line pa-
line has in range (1, 2). The range of disruption is (0, 1, 2, rameters are shown in (Fig. 8) for Viterbi Algorithm, and Unauthenticated Download Date | 4/10/16 5:57 PM
9
Image Processing & Communications, vol. 20, no. 4, pp. 5-12
mean of horizontal error
ing is used for limited number or cases. The properties of both algorithms should depended on few parameters.
12
Proper selection of them is important for practical appli-
10
cations, because there is a difference between global ap-
8
proach (model with high range of parameters) and partic-
6
ular case.
4 2
Chosen parameters were: Gaussian noise with standard
0 2
deviation in range (0.45, 0.46, ..., 0.50); the width of line 100 1 dynamic
30), maximal height of disruption line was 5 and maxi-
50 0
0
is the range (1); the range of disruption is (20, 21, ..., mal width of disruption line was equal 2; the dynamic of
std. dev.
line was equal 1. For this small amount of parameters 20
Fig. 8: Global results for Viterbi Algorithm in dynamic images for tuning algorithms are randomly created. parameter range The results of this attempt for Viterbi Algorithm and for History Dependent Viterbi Algorithm are shown in Fig. 10
mean of horizontal error
and Fig. 11 respectively. This result is a knowledge about 12
parameters. The best results for Viterbi Algorithm have
10
with transition = 1 and depth = 14. The best re-
8
sults for History Dependent Viterbi Algorithm have with
6
transition = 1 and depth = 6. After tuning the param-
4
eters for these two algorithms, 20 different sample group
2
of the same range of parameters was created. The figure
0 2
with mean of horizontal error was created and shown in 100 1 dynamic
the (Fig. 12).
50 0
0
std. dev.
6
Discussion
Fig. 9: Global results for History Dependent Viterbi Al- Additive Gaussian noise disturbs the estimation for both gorithm in dynamic parameter range algorithms (Fig. 6) but History Dependent Viterbi Algorithm is superior and the mean error is reduced (Fig. 7) in (Fig. 9) for History Dependent Viterbi Algorithm.
also. There are interesting results related to the error depending on dynamic and std. dev. (Fig. 8 and Fig. 9) –
5
Example Results for Specific Line Parameters
the main component of the error is std. dev. so both algorithms are nonsensitive to line dynamics. Randomly selected small line parameters show im-
Specific subspace of line parameters was selected. This provement for History Dependent Viterbi Algorithm space consist of small amount of line parameters. This (Fig. 12) and the possibility of parameters tuning for small test shows the example behavior of algorithm if the learn- datasets (Fig. 10 and Fig. 11). Unauthenticated Download Date | 4/10/16 5:57 PM
10
G. Matczak, P. Mazurek 1 Viterbi History Dependent Viterbi 0.8 mean of horizontal error
mean of horizontal error
3
2
1
0
0.6
0.4
0.2
8 0
6
0
2
4 6 number of sample
8
10
4 transition
20
15
10
Fig. 12: Additive mean of horizontal error
5
deep
Fig. 10: Tunning parameters for Viterbi Algorithm
7
Conclusions and Further Works
The proposed algorithm is better for assumed model of line and the computation cost is similar to the Viterbi algorithm. Such algorithm could be applied for another purpose - line tracking in medical application for example. 3 mean of horizontal error
The application of Monte Carlo test allows testing of different algorithms and reliable results could be obtained 2
if stable results are obtained. It is observed during the test. Considered algorithm assumes single line and many
1
false lines. There are numerous applications where two or more correct lines exist and should be processed together without switching of trajectory or rejection of them. Such
0
cases are very important and will be considered in further
8
works. 6 4 transition
20
10
15 deep
5
Acknowledgment
Fig. 11: Tunning parameters for History Dependent This work is supported by the UE EFRR ZPORR project Viterbi Algorithm Z/2.32/I/1.3.1/267/05 "Szczecin University of Technology – Research and Education Center of Modern Multimedia Technologies" (Poland). Unauthenticated Download Date | 4/10/16 5:57 PM
11
Image Processing & Communications, vol. 20, no. 4, pp. 5-12
References
[9] Mazurek, P. (2014). Directional Filter and the Viterbi Algorithm for Line Following Robots. In
[1] Astrand, B., Baerveldt, A.J. (2005). A vision based row-following system for agricultural field machin-
Computer Vision and Graphics (pp. 428-435). Springer International Publishing
ery. Mechatronics, 15(2), 251-269 [10] Mazurek, P. (2014, September). Line estimation us[2] Colak, I., Yildirim, D. (2009, November). Evolving
ing the viterbi algorithm and track-before-detect ap-
a Line Following Robot to use in shopping centers
proach for line following mobile robots. In Methods
for entertainment. In Industrial Electronics, 2009.
and Models in Automation and Robotics (MMAR),
IECON’09. 35th Annual Conference of IEEE (pp.
2014 19th International Conference On (pp. 788-
3803-3807). IEEE
793). IEEE
[3] Golightly, I., Jones, D. (2005, July). Visual con-
[11] Mazurek, P. (2015). Viterbi algorithm for noise line
trol of an unmanned aerial vehicle for power line
following robots. In Image Processing & Commu-
inspection. In Advanced Robotics, 2005. ICAR’05.
nications Challenges 6 (pp. 111-118). Springer In-
Proceedings., 12th International Conference on
ternational Publishing
(pp. 288-295). IEEE
[12] Ollis, M. (1997). Perception algorithms for a har-
[4] Horan, B., Najdovski, Z., Black, T., Nahavandi, S., Crothers, P. (2011, October). OzTug mobile robot for manufacturing transportation. In Systems, Man, and Cybernetics (SMC), 2011 IEEE International Conference on (pp. 3554-3560). IEEE [5] Marchewka, A. (2010). Crack detection on asphalt surface image using local minimum analysis. In Image Processing and Communications Challenges 2
vesting robot. Carnegie Mellon University, The Robotics Institute [13] Schmidt Jr,R.A. (1971). A Study of the Real-Time Control of a Computer Driven Vehicle (No. CS231). STANFORD UNIV CALIF DEPT OF COMPUTER SCIENCE [14] Scott, T.A., Nilanjan, R. (2005). Biomedical Image Analysis: Tracking. Morgan & Claypool
(pp. 353-359). Springer Berlin Heidelberg [15] Stone, L.D., Corwin, T.L., Barlow, C.A. (1999). [6] Matczak, G., Mazurek, P. (2016). Adjustment of Viterbi Algorithm for Line Following Robots. In
Bayesian Multiple Target Tracking. 1st. Artech House
Image Processing and Communications Challenges 7 (pp. 159-166). Springer International Publishing
[16] Taubel, G., Yang, J.S. (2013, June). A lane departure warning system based on the integration of the
[7] Mazurek, P. (2010). Optimization of bayesian track-
optical flow and Hough transform methods. In Con-
before-detect algorithms for GPGPUs implementa-
trol and Automation (ICCA), 2013 10th IEEE Inter-
tions. Przeglad ˛ Elektrotechniczny, 86, 187-189
national Conference on (pp. 1352-1357). IEEE
[8] Mazurek, P. (2013). Code reordering using local
[17] Viterbi, A.J. (1967). Error bounds for convolutional
random extraction and insertion (LREI) operator
codes and an asymptotically optimum decoding al-
for GPGPU-based track-before-detect systems. Soft
gorithm. Information Theory, IEEE Transactions
Computing, 17(6), 1095-1106
on, 13(2), 260-269 Unauthenticated Download Date | 4/10/16 5:57 PM