graphemes from strokes using a hierarchical cluster-
ing. After the quantization of each stroke, a rela-
tional graph is then generated for modelling spatial
relations between strokes. To minimize the descrip-
tion length of the relational graph, an algorithm (Cook
and Holder, 1994) is applied to discover the repetitive
substructures which are probably the lexical units.
3.1 Quantization of Strokes
The data that we are interested in are online hand-
writing, available as sequences of strokes, which
are themselves sequences of 2D points. Because of
the variability of shapes produced by handwriting,
we need to quantify the strokes into a finite set of
graphemes (codebook). We measure the dissimilar-
ity between two shapes of strokes using a Dynamic
Time Warping (DTW) algorithm (Vuori, 2002). Clus-
tering techniques are used for producing the code-
book. Instead of using a traditional k-means algo-
rithm which is prone to initialisation problems, we
prefer an agglomerative hierarchical clustering since
the tree topology is favourable to tune easily the num-
ber of prototypes. Once the number of n
p
graphemes
(the final prototypes of hierarchical clustering) is se-
lected, all the strokes are tagged with the virtual label
of the closest grapheme. This procedure is the quan-
tization of strokes. Afterwards, we build relational
graphs between strokes.
3.2 Construction of Relational Graphs
This section presents the construction of the rela-
tional graph inspired by SRT (Rhee and Kim, 2009).
We define the nodes as the strokes labelled with its
grapheme prototype (one of the codebook element)
and the edges as a spatial relation. We define a spa-
tial relation as a relationship from a reference stroke
to an argument stroke. In other words, the relational
graph is directed. This allows for instance to distin-
guish between the two following horizontal layout of
two graphemes: “−|” or “|−”, which are two differ-
ent symbols. Concerning the complexity, suppose we
have n
r
different spatial relations and n
str
different
strokes, to create a complete directed graph for all the
vertices (strokes), the number of directed edges is
2·n
r
C
2
n
str
= n
r
n
str
(n
str
− 1) (1)
where C
m
n
=
n(n−1)...(n− m+1)
m(m−1)...2·1
(Chartrand, 1985). In
that case, the search space would be far more too com-
plex to search patterns in the complete directed graph.
Therefore, the number of out-directed edges from a
referencestroke should be limited to n
c
closest strokes
where n
c
<= n
str
− 1 since we, human, have a limited
perceived visual angle (Baird, 1970); we prefer some
symbols composed of the closest strokes. Therefore,
the reduced number of directed edges is:
n
r
· n
str
· n
c
. (2)
However, if n
c
is too small, we could lose some sym-
bols. In our work, we select three spatial relations
n
r
= 3, namely, right (R), below (B) and intersection
(I). We consider relation I having a higher priority
than directional relations, R and B. In other words, I
is exclusive with R and B. This constraint means that
if two strokes are intersected, we do not consider the
directional relationships but only the topological rela-
tionships between two spatial objects (Schneider and
Behr, 2006). It turns out that the maximum number of
directed edges is:
2·n
str
· n
c
(3)
since the maximum outdegree of reference stroke is
two. To reduce even more the number of edges of this
relational graph, we constrain the graph construction
to obtain a Directed Acyclic Graph (DAG). We start
with the top-left stroke to initiate the DAG. Then from
a reference stroke, we explore the three possible spa-
tial relations (R, B and I) to find the next possible
strokes but without considering the strokes already
used from the starting stroke to the reference stroke.
At the end, since I is a symmetric spatial relation, we
add one more edge from the argument stroke to the
reference stroke for I. Considering Eq.(2), the maxi-
mum n
r
is still 2 since I is symmetric and is exclusive
with R and B. Therefore, we reduced the search space
significantly.
As an example, Figure 2 illustrates a simple math-
ematical expression “1± 2 = 4”. When we consider
the stroke (6) coded by the grapheme ‘−’ as the refer-
ence stroke, the search for the n
c
= 2 closest strokes to
create the relational graph is shown in Figure 2. Right
and below projection areas of ‘−
(6)
’ (see the shadow
areas in Figure 2) are applied for detecting the next
strokes.
Reference stroke
(8)
(7)
(9)
(5)
(6)
Right
Below
(.) : Indices of stroke
Bounding box for all strokes
(1)
(2)
(3)
(4)
Figure 2: Two directional relations (right and below) in
terms of the reference stroke −
(6)
.
The corresponding sub-graph with reference node
‘−
(6)
’ is shown in Figure 3 using n
c
= 2 closest next
KDIR 2011 - International Conference on Knowledge Discovery and Information Retrieval
174