An Image Analysis Algorithm of Estimates Calculation
on a Plane
Valeriy Osipov
The Program Systems Institute RAS, Research Center for Multiprocessor Systems
Pereslavl-Zalessky, Russian Federation
Abstract. An implementation of image recognition algorithms based on esti-
mate calculation (2D AEC) with rectangular support sets is proposed. The ar-
ticle includes the sample. Let we have a photo of starry arch star map. The
problem is to recognize stars on the photo. The algorithm calculates the array of
estimates, and then we apply a decision rule.
1 Statement of the Problem
The article is concerned with an implementation of image recognition algorithms
based on estimate calculation (2D AEC) with rectangular support sets [2]. Let К is a
set of objects. The set K is called class. We have two tables S and T describing ob-
jects. Each table S row and each table T row contains an object description. Class K is
described both in S and in T. We do not know, which rows of the tables S and T de-
scribe the class K. Put this another way, the class K has two descriptions, the first one
is in the table S, the second one is in the table T. The table S and the table Т have an
equal number of columns n.
Some object attributes are changed when system of axes is changed, another
attributes are not changed. Let the first n
1 tables columns are changeable (n1n),
another ones are invariants. In other words, the first n
1 tables’ columns are object
space coordinates, other ones do not depend on object space system of axes.
Suppose space angles are invariants for any object space system of coordinates.
The problem is to find which table S rows and which table T rows are descriptions of
the objects of the class K.
We shall deal with the problem for n
1=2 (a plane).
Definition. By an elementary fragment of table we shall mean a set of three table
rows.
Let
},...,,{
21
S
i
SSS
S
eeeФ = is a set of elementary fragments of the table S,
},...,,{
21
T
i
TTT
T
eeeФ =
is a set of elementary fragments of the table Т, is the sys-
tem of reference subsets of { n
1+1, n1+2,…,n} [1],
ω∈
is a reference set. Suppose
B
ω
is a proximity function [1]. Proximity function has two arguments (table rows). In
our case these arguments can be both from one and from different tables
Osipov V. (2010).
An Image Analysis Algorithm of Estimates Calculation on a Plane.
In Proceedings of the Third International Workshop on Image Mining Theory and Applications, pages 13-18
DOI: 10.5220/0002960400130018
Copyright
c
SciTePress
((,),(,),(,),etc.).
i j ij ij
BSS BTT BST
ωωω
Proximity function takes a value of 1 if
appropriate parts of objects descriptions are similar to each other and zero elsewhere.
Here S
i, Sj are objects of the table S described by rows i, j, Ti, Tj are objects of the table
T described by rows i, j (i n
1, j n1).
Let us extend definition of proximity function to elementary fragments e
S
,e
T
.
1),( =
TS
eeB
ω
, if
1) triangles associated with elementary fragments e
S
and e
T
are similar (we
consider only columns 1,…,n1 here);
2) objects related to equal angles are closely adjacent:
1),( =
ji
TSB
ω
,
and
0),( =
TS
eeB
ω
elsewhere.
2 Estimates Г(S
i
) and Г(Т
j
) with Respect to the Class K
Let
S
i
Ф is a set of elementary fragments of the table S having an object Si. Then
),()(
,
,
TS
Фe
Фe
i
eeBSГ
ST
S
i
S
Ω
=
ω
ω
.
Let
S
j
Ф is a set of elementary fragments of the table T having an object Тj. Then
),()(
,
,
TS
Фe
Фe
j
eeBTГ
T
j
T
SS
Ω
=
ω
ω
3 Decision Rules
if Г(Si)>CS then Si
K
if Г(Т
j)>CT then Тj
K, the constants CS and CT are based on a model.
4 Estimate of Complexity of the Algorithm
Let n1=2, mS is number of rows of the table S, mT is number of rows of the table T,
m = max(mS, mT).. Considering that number of elementary fragments of a table is no
more than
3
m
⎛⎞
⎜⎟
⎝⎠
, upper bound of complexity of the algorithm may be written as
6
1
Cm
.
To improve algorithm performance let us sort the sets of elementary fragments of
the tables by angles before estimates calculation.
14
5 A Sample
Let the file 1.txt contains
101,255
170,195
229,193
300,186
416,106
437,179
343,231 stars coordinates from the
Fig. 1. Ursa Major Constellation [4].
and file 2.txt contains
106,553
157,551
186,570
223,590
308,589
300,628
233,626
246,415
228,405
255,373
271,387
306,367
344,370
367,375
15
two constellation stars coordinates from the
Fig. 2. The North Polar Constellations [5].
The first seven lines describes Ursa Major constellation, the other seven lines de-
scribes Ursa Minor constellation.
6 Algorithm
1. Read star coordinates from the file 1.txt into array ar1.
2. Read constellation map star coordinates from the file 2.txt into array ar2.
Let list1 is an array of Triangles with Vertices from ar1, list2 is an array of Trian-
gles with Vertices from ar2.Vertices from ar1, list2 is an array of Triangles with
Vertices from ar2. Triangle is an array of 3Vertices (Items). Vertex is a pair of in-
dex and angle, where index is a star number from ar1 or ar2. Angle is a triangle
vertex angle. Array of Vertices of a Triangle is sorted by angle. Arrays of Trian-
gles list1, list2 are sorted by Triangle.Items[0].angle, Triangle.Items[1].angle.
Г[i,j] is array of estimates.
i is index of a star from list1,
j is index of a star from list2.
EPS is a small value.
3. Create and sort list1, list2;
4. i := 0; j:=0;
5. if i
list1.Count then go to 20;
6. if j
list2.Count then go to 20;
7. if list1[i].items[0].angle + EPS
list2[j].Items[0].angle then i:= i+1;
go to 5;
8. if list1[i].items[0].angle
list2[j].Items[0].angle + EPS then i:= i+1;
go to 5;
16
9. k := 0;
10. if i+k
list1.Count then go to 14;
11. if |list1[i+k].Items[0].angle – list2[j].Items[0].angle|
EPS then go to 14;
12. if |list1[i+k].Items[1].angle – list2[j].Items[1].angle| < EPS then
Г[list1[i+k].Items[0].index, list2[j].Items[0].index]++;
Г[list1[i+k].Items[1].index, list2[j].Items[1].index]++;
Г[list1[i+k].Items[2].index, list2[j].Items[2].index]++;
13. k := k+1; go to 10;
14. k := 1;
15. if j+k
list2.Count then go to 19;
16. if |list1[i].Items[0].angle – list2[j+k].Items[0].angle|
EPS then go to 19;
17. if |list1[i].Items[1].angle – list2[j+k].Items[1].angle| < EPS then
Г[list1[i].Items[0].index, list2[j+k].Items[0].index]++;
Г[list1[i].Items[1].index, list2[j+k].Items[1].index]++;
Г[list1[i].Items[2].index, list2[j+k].Items[2].index]++;
18. k := k+1; go to 15;
19. i := i+1; j := j+1; go to 5;
20. Print array of estimates
Г.
7 Results
The table of estimates for the sample (the array Г[i,j]) is
1 2 3 4 5 6 7
1
16 10 3 0 3 1 0
2
5 12 3 1 0 0 0
3
4 6 10 5 1 4 1
4
0 1 9 11 3 3 1
5
1 0 0 3 10 10 1
6
0 1 8 8 4 11 0
7
1 0 1 2 1 3 7
8
2 2 2 3 6 5 2
9
4 3 1 4 2 3 2
10
2 1 6 4 2 0 4
11
2 5 3 4 1 2 0
12
1 3 6 3 3 1 2
13
1 3 3 5 1 1 2
14
0 7 3 4 0 2 5
A cell of the table Г[j,j] is estimate of the object Si from the set of objects of the
fig.1 with respect to the object
Тj from the set of objects of the fig.2.
17
Decision Rule. If we set maximal number in each column to 1, another numbers to 0,
we have the mapping from the objects of [4] to the objects of [5]:
1 2 3 4 5 6 7
1
1 0 0 0 0 0 0
2
0 1 0 0 0 0 0
3
0 0 1 0 0 0 0
4
0 0 0 1 0 0 0
5
0 0 0 0 1 0 0
6
0 0 0 0 0 1 0
7
0 0 0 0 0 0 1
8
0 0 0 0 0 0 0
9
0 0 0 0 0 0 0
10
0 0 0 0 0 0 0
11
0 0 0 0 0 0 0
12
0 0 0 0 0 0 0
13
0 0 0 0 0 0 0
14
0 0 0 0 0 0 0
and we can make a conclusion that the stars from the photo [4] are from Ursa Major
constellation.
References
1. Yu.I.Zhuravlev, An Algebraic Approach to Recognition and Classification Problems, Prob-
lems of Cybernetics, issue 33 (Nauka, Moscow, 1978), pp. 5–68 [in Russian].
2. I. B. Gurevich and A. V. Nefyodov, “Algorithms for Estimate Calculations Designed for
2D Support Sets. Part 1: Rectangular Support Sets,” Pattern Recognition and Image Analy-
sis 11 (4), 662–689 (2001).
3. V. I. Osipov, On the Application of Methods Based on Estimates Calculation in Some
Models of Artificial Intelligence. Pattern Recognition and Image Analysis. Vol. 8, N2,
1998, pp 144-145.
4. http://www.blingcheese.com/image/code/14/ursa+major.htm
5. http://stars.astro.illinois.edu/sow/cm1.html
18