You are on page 1of 7

Computer Vision and Image Understanding 115 (2011) 1552–1558

Contents lists available at SciVerse ScienceDirect

Computer Vision and Image Understanding


journal homepage: www.elsevier.com/locate/cviu

Graph theory based segmentation of traced boundary into open and closed
sub-sections
Nitin Narappanawar a, B. Madhusudan Rao b,⇑, Maduri Joshi c
a
Interdisciplinary School of Scientific Computing, UoP, Pune 411 007, India
b
International Institute of Information Technology, SoST, Pune 411 057, India
c
College of Engineering, Wellesely Rd., Shivajinagar, Pune 411 005, India

a r t i c l e i n f o a b s t r a c t

Article history: Many shape descriptors based on the boundary have been developed for feature extraction and pattern
Received 19 January 2011 matching/recognition of objects. This paper presents a novel algorithm to segment a traced boundary in
Accepted 19 July 2011 open and closed sub-sections. The obtained sub-sections can be utilized for generating more features
Available online 27 July 2011
while being one of the features. A traced boundary has been considered as an undirected graph with pix-
els representing the vertices. It is proved that ‘‘For a boundary traced using 8-connectivity maximum
Keywords: degree of a vertex cannot exceed four’’. This aspect and the instances of degree and number of occur-
Border following
rences are used to categorize all the vertices in eight exhaustive types. Six of these are identified as
Boundary following
Boundary traversing
critical vertices. The segmentation is done based on the principle that in an Eulerian circuit, each edge
Boundary segmentation is traversed only once. Further segregation in open and closed sub-graphs is done by choosing critical ver-
Component segmentation tices at a minimum directed distance. The testing of the algorithm has been done on artificially generated
Component identification images and from different databases of hand written text. The performance analysis shows that the
Identifying strokes execution time is a linear function of the number of occurrences of each type of the vertices. The perfor-
OCR mance analysis is further supported using multiple regression.
Multiple regression analysis Ó 2011 Elsevier Inc. All rights reserved.

1. Introduction spline curves. Such a representation is mostly used for capturing


smoother shapes. Various capturing techniques have been intro-
The shape of an object is one of the most important information duced, using different spline models like Bezier splines [11–13],
captured by human vision. The information is further used to iden- B-splines [14], Hermite interpolation [15] and rational cubic inter-
tify and classify objects. The best example is reading a script. The polation [16]. Segmentation of boundary based on detection of cor-
letters are recognized by the corresponding shapes. Various ner, inflection and transition points is another approach described
boundary descriptors for capturing the shape of an object are used, at [17].
such as Fourier descriptors [1,2], Hough transform based descrip- A boundary in general can be considered as comprising open
tors [3,4] and Chain Code descriptors [5,6]. All these techniques and closed sub-sections. An open boundary is an 8-connected
require traced boundary as an input. The goal of a boundary seg- (open) path of region pixels which are 4-connected with the back-
mentation algorithm is to partition a traced boundary of a region ground. A closed boundary is an 8-connected closed path of region
into smaller sub-sections having some predefined properties. The pixels which are 4-connected with the background. The region pix-
techniques described above can then be used on segmented els can be considered as vertices of a planar graph. The edges of the
components of the boundary to give a finer description of the graph are imaginary lines joining the centers of the region pixels.
shape of the object. Then from the theory of planar graphs a boundary is a path. If
There are many types of straight-segment boundary representa- end vertices of the path are same then the path is called a circuit.
tions [7–9]; the primary problem is in determining the location of Eulerian circuit in a graph is defined as a circuit that traverses each
corners in a boundary. There are several algorithms for locating edge in the graph once and only once. Degree of a vertex is the
corners in an image. The corner detection is based either on bound- number of edges incident on it. An undirected graph possesses
ary or on intensity. A literature survey of 114 algorithms for corner an Eulerian circuit (or an Eulerian graph) if and only if it is con-
detection can be found at [10]. Boundary segmentation into nected and its vertices are all of even degree [18,19]. A traced
segments of constant curvature is another possibility for boundary closed boundary can be thought of as an Eulerian circuit. Hence
representation. Boundaries can then be represented with various the vertices of a traced closed boundary should be of even degree.
Also, for each boundary pixel on a closed boundary there are at
⇑ Corresponding author. least two boundary pixels in its 3  3 neighborhood. Therefore,
E-mail address: bellarymrao@gmail.com (B. Madhusudan Rao). from each boundary pixel of a closed boundary, even number of

1077-3142/$ - see front matter Ó 2011 Elsevier Inc. All rights reserved.
doi:10.1016/j.cviu.2011.07.002
N. Narappanawar et al. / Computer Vision and Image Understanding 115 (2011) 1552–1558 1553

connections will be established in the tracing process. If in a traced 7. In [20], while tracing a boundary, repetition of a directed
boundary a vertex (pixel) is found with odd degree, then at least edge is used as a terminating condition. Hence, in a traced
one of the connections is for an open boundary. Hence, a boundary boundary a directed edge is not repeated. Therefore, a vertex
in general can be considered as comprising open and closed sub- with occurrences greater than degree is not possible. Thus,
sections. a. Occurrences cannot exceed 4 and the possible types of
In this paper we present a novel algorithm for segmenting a vertices are limited to 16.
traced boundary into open and closed sub-sections. Section 2 gives b. Six types of vertices {o2d1, o3d1, o3d2, o4d3, o4d2,
the algorithm to separate the open and closed sub-sections in a o4d1} cannot exist in a traced boundary.
traced boundary. Section 3 mathematically supports the presented 8. Two types of vertices {o1d3, o1d4} cannot exist in a traced
algorithm using theory of graphs. Specifically, it proves that the boundary as a vertex with one occurrence can be connected
maximum degree of a vertex in a traced boundary is four. Section to utmost two vertices, the previous one and the next one.
4 gives the results and conclusions. 9. Statements 7 and 8 show that vertices types identified in
statements 5 and 6 are exhaustive for a traced boundary.
2. Locating open and closed sub-sections in a traced boundary The presented algorithm addresses all these eight types of
vertices.
A boundary can be traced in clockwise or anticlockwise direc- 10. To locate the connections to an open or a closed sub-section
tion. For the implementations in this paper, boundary is traced at the critical vertices with multiple occurrences, the incom-
using anticlockwise direction. For tracing the external and/or the ing and outgoing connections need re-adjustment.
internal boundary, several different algorithms can be used 11. In the process of isolating the open and closed sub-graphs,
[20,21]. A traced boundary is a connected graph. It is to be split in the next critical vertex Vb is chosen at a minimum directed
sub-graphs [18], such that each sub-graph is connected and has distance in the direction of tracing, from the current vertex
only one open or closed boundary. Further processing, for example Va. Let the indices be from 1 to N and ‘b’ and ‘a’ be the indices
characterization, can then be taken up on the sub-graphs. The algo- of Vb and Va respectively. The directed distance in tracing
rithm to achieve the task is based on the following considerations: units, in the direction of tracing, d (Vb, Va) = b  a if b P a
and d (Vb, Va) = b  a + N if b < a.
1. The vertices of even degree can be a part of an open or a
closed sub-section. However, a vertex of odd degree will 2.1. The algorithm
have at least one open sub-section connected to it.
2. Using Handshaking Lemma it can be proved that in a con- For defining the algorithm following are the data structure def-
nected graph the number of vertices of odd degree is always initions and support functions:
even [22].
3. In Section 3 it is proved that, if a boundary is traced using 8- 1. The input is traced boundary ‘B’, where each pixel/vertex is
connectivity and is considered as an undirected, connected specified by coordinates (xt, yt), at an index ‘t’. The number
graph, with pixels as vertices, then the degree of a vertex of entries in B are N. The indices are from 1 to N. The special
cannot exceed four. case N = 1 should be treated separately.
4. Eulerian circuit does not have a repeated edge but it may 2. ‘NumOcc’ holds number of occurrences of a vertex in the
have repeated vertex. traced boundary.
5. In succeeding sections, a vertex of type ‘‘oxdy’’, would mean 3. ‘Indices’ holds the indices of the vertices corresponding to
a vertex with ‘‘x’’ occurrences and ‘‘y’’ degree. Sometimes we the number of occurrences in NumOcc.
will also use ‘‘oxdy’’ to represent number of vertices of the 4. ‘CritVertxLst’ holds {index, previous index, next index, Label,
type ‘‘oxdy’’. Six types of vertices in a traced boundary are open/close status}. NoEnt = 5; PosI = 1; PosPI = 2; PosNI = 3;
identified as critical. They are: PosLbl = 4; PosStat = 5;
5. ‘CritVertxLstOpen’ holds {index, previous index, next index,
a. Number of occurrences = 1, degree = 1 (o1d1): The edges
Label, ‘o’}
from this vertex will be incident on the same vertex.
6. ‘CritVertxLstClosed’ holds {index, previous index, next index,
b. Number of occurrences = 2, degree = 3 (o2d3): In both
Label, ‘c’}
the occurrences an edge from this vertex will be incident
7. indx = Incr (t) will do: indx t + 1; If indx > N, indx 1;
on the same vertex say V. A connection to V is the one
Similarly, indx = Decr (t) will do: indx t  1; If indx < 1,
that belongs to an open sub-section. The other two verti-
indx N;
ces are connections to a closed sub-section.
8. Status = comp (s, t) will do: Status ‘c’; If (xs == xt) &&
c. Number of occurrences = 2, degree = 4 (o2d4): Two
(ys == yt), Status ‘o’;
closed sub-sections are joined at this vertex.
9. d = Dist (a, b) will do: d b  a; If d < 0, d d + N;
d. Number of occurrences = 3, degree = 3 (o3d3): Three
10. If input is a single circuit it will have no critical vertices, e.g.
open sub-sections are joined at this vertex.
‘‘O’’. In this case CritVertxLst will be empty. However, to
e. Number of occurrences = 3, degree = 4 (o3d4): One
bring uniformity in subsequent processing, we will set Crit-
closed sub-section and two open sub-sections are joined
VertxLstClosed with one entry.
at this vertex.
f. Number of occurrences = 4, degree = 4 (o4d4): Four open
sub-sections are joined at this vertex. 2.1.1. Algorithm for generating CritVertxLstOpen and
6. Two types of vertices in a traced boundary that are not crit- CritVertxLstClosed lists from a traced boundary
ical are:
a. Number of occurrences = 1, degree = 2 (o1d2): Main ver- 1. Get traced boundary B and N the number of vertices (N > 1).
tices of a closed boundary. 2. Obtain the binding rectangle (xmin, ymin) and (xmax, ymax) for
b. Number of occurrences = 2, degree = 2 (o2d2): Main ver- coordinates in B.
tices of an open boundary. 3. R (ymax  ymin + 1); C (xmax  xmin + 1);
1554 N. Narappanawar et al. / Computer Vision and Image Understanding 115 (2011) 1552–1558

4. Initialize: NumOcc (R, C) 0; Indices (R, C, 4) 0; Crit- 2.1.2. Algorithm for isolating all open segments in OpenSubGraphs
VertxLst (N, NoEnt) 0 (Maximum number of occurrences using CritVertxLstOpen
for a vertex is 4)
5. For i = 1 to N (Gather occurrences and incidences) 1. Get traced boundary B and N the number of vertices.
a. Xi xi  xmin + 1; Yi yi  ymin + 1; (Translation to bind- 2. Get the list of critical vertices for open segments CritVertxLst-
ing rectangle coordinates) Open and their count P.
b. NumOcc (Yi, Xi) NumOcc (Yi, Xi) + 1; 3. Initialize: OpenSubGraphs (N, (P/2)) 0; (the total number of
c. Indices (Yi, Xi, NumOcc (Yi, Xi)) i; sub-graphs will be half of P).
6. lbl 1, k 1; 4. OpenSegment 1;
7. For i = 1 to N (Critical vertex identification and status 5. For Vn = 1 to P
assignment) a. min N + 1; Vc Vn;
a. tx Xi; ty Yi; count NumOcc (ty, tx); b. VnIndex CritVertxLstOpen (Vn, PosI);
b. NumOcc (ty, tx) 0; c. If (VnIndex), ( index is not 0, implies not a deleted vertex)
c. switch (count) i. VnNxt CritVertxLstOpen (Vn, PosNI);
i. case 0: nothing to be done. ii. For j = Vn + 1 to P
ii. case 1: 1. VjIndex CritVertxLstOpen (j, PosI);
1. temp1 Indices (ty, tx, 1); 2. If (VjIndex),
2. iPrev Decr (temp1); iNxt Incr (temp1); a. d Dist (VnNxt, VjIndex) ;
3. Stat1 comp (iPrev, iNxt); b. If d < min,
4. if Stat1 == ‘o’, i. min d; Vc j;
a. CritVertxLst (k) [temp1, iPrev, iNxt, lbl, iii. EndVrtx CritVertxLstOpen (Vc, PosI);
Stat1]; iv. OpenSubGraphs (1,OpenSegment) VnIndex;
b. k k + count; lbl lbl + 1; v. CurrentVrtx VnNxt;
iii. case 2: vi. k 2;
1. temp1 Indices (ty, tx, 1); vii. While CurrentVrtx is not equal to EndVrtx.
2. iPrev Decr (temp1); iNxt Incr (temp1); 1. OpenSubGraphs (k, OpenSegment) CurrentVrtx;
3. temp2 Indices (ty, tx, 2); 2. CurrentVrtx Incr (CurrentVrtx);
4. iPrev2 Decr (temp2); iNxt2 Incr (temp2); 3. k k + 1;
5. Stat1 comp (iPrev, iNxt2);
viii. OpenSubGraphs (k, OpenSegment) EndVrtx;
6. Stat2 comp (iPrev2, iNxt);
ix. OpenSegment OpenSegment + 1;
7. if (stat1 == ‘c’) jj (stat2 == ‘c’) ,
x. CritVertxLstOpen (Vc, PosI) 0; CritVertxLstOpen (Vn,
a. CritVertxLst (k) [temp1, iPrev, iNxt2, lbl,
PosI) 0;
Stat1];
6. OpenSegment OpenSegment – 1 (Gives the total number of
b. CritVertxLst (k + 1) [temp2, iPrev2, iNxt, lbl,
open segments).
Stat2];
c. k k + count; lbl lbl + 1;
2.1.3. Algorithm for isolating all closed segments in ClosedSubGraphs
iv. case 3 or 4:
using CritVertxLstClosed
1. For j = 1 to count,
a. temp1 Indices (ty, tx, j);
1. Get traced boundary B and N the number of vertices.
b. iPrev Decr (temp1); iNxt Incr (temp1);
2. Get the list of critical vertices for closed segments CritVertxLst-
c. CritVertxLst (k + j  1) [temp1, iPrev, iNxt,
Closed and their count C.
lbl, 0]; ( Decision regarding o/c still not done,
3. Initialize: ClosedSubGraphs (N, C) 0; (there can be a maxi-
so status = 0)
mum of C closed sub-graphs).
2. temp1 k + count  1;
4. count C; NxtSrch 1; ClosedSegment 1;
3. tempiNxt CritVertxLst (temp1,PosNI); ( for
5. While (count)
performing the cyclic shift)
a. For Vn = NxtSrch to C
4. For j = (temp1  1) to k in decrements of 1,
i. VnIndex CritVertxLstClosed (Vn, PosI);
a. CritVertxLst (j + 1, PosNI) CritVertxLst
ii. if (VnIndex), ( index is not 0, implies not a deleted vertex)
(j, PosNI);
1. CurrentVrtx CritVertxLstClosed (Vn, PosNI);
5. CritVertxLst (k, PosNI) tempiNxt; 2. EndLbl CritVertxLstClosed (Vn, PosLbl);
6. For j = k to temp1, 3. Break the loop;
a. iPrev CritVertxLst (j, PosPI); iNxt b. k 1; CurLbl 0;
CritVertxLst (j, PosNI); c. While CurLbl is not equal to EndLbl.
b. CritVertxLst (j, PosStat) comp (iPrev, iNxt); i. min N + 1;
7. k k + count; lbl lbl + 1; ii. For j = NxtSrch to C
1. VjIndex CritVertxLstClosed (j, PosI);
8. If k == 1,
2. If (VjIndex)
a. CritVertxLstClosed = [1, N, 2, 1, ‘c’];
a. d Dist (CurrentVrtx, VjIndex);
b. CritVertxLstOpen = empty;
b. If d < min,
9. Else,
i. min d; Vc j;
a. From CritVertxLst segregate the entries which corre-
spond to open (indicated by ‘o’) and closed (indicated iii. EndVrtx CritVertxLstClosed (Vc, PosI);
by ‘c’) into CritVertxLstOpen and CritVertxLstClosed iv. While CurrentVrtx is not equal to EndVrtx
respectively. 1. ClosedSubGraphs (k, ClosedSegment) CurrentVrtx;
N. Narappanawar et al. / Computer Vision and Image Understanding 115 (2011) 1552–1558 1555

2. CurrentVrtx Incr (CurrentVrtx);


3. k k + 1;
v. ClosedSubGraphs (k, ClosedSegment) EndVrtx;
vi. k k + 1;
vii. CurrentVrtx CritVertxLstClosed (Vc, PosNI);
viii. CurLbl CritVertxLstClosed (Vc, PosLbl);
ix. CritVertxLstClosed (Vc, PosI) 0;
x. count count – 1;
d. NxtSrch Vn + 1;
e. ClosedSegment ClosedSegment + 1;
6. ClosedSegment ClosedSegment – 1; (gives the total number
of closed segments).

2.2. An example and analysis Fig. 1. Indices of critical vertices for example test image.

The experiments were carried out on 26 synthetic images. Some


of the test images, along with the number of each type of the ver-
tices, are given in Table 1. Fig. 1 gives further details of the test im- (P2). The execution time associated with data transfer is O (No).
age at serial 3 of the table. For the test image in Fig. 1, the outputs Hence the execution time is O (P2, No).
CritVertxLstOpen and CritVertxLstClosed are given in Table 2. The Let Nc be a vector representing number of vertices of the type
outputs, OpenSubGraphs and ClosedSubGraphs are given in Table {o1d2, o2d3, o2d4, o3d4} characterizing the closed boundaries in
3. The segmented closed and open sub-graphs are given in Fig. 2. an image. The execution time of separating closed sub-graphs (Sec-
We observe a closed sub-graph at the intersection of ‘‘+’’. This is tion 2.1.3), will depend on C and on Nc. The loops in step 5.a and in
expected as all the four vertices form a circuit considering their step 5.c.ii show that the execution time associated with finding
3  3 neighborhood. The execution time, for sub-parts of the algo- minimum directed distance to locate a sub-graph is O (C2). The
rithm coded in MATLAB(R), on system with Intel(R) Core i3 CPU execution time associated with data transfer is O (Nc). Hence the
M350 @ 2.27 GHz with 3 GB RAM, is given in Table 4. execution time is O (C2, Nc).
Let No be a vector representing number of vertices of the type For the algorithm sub part that locates critical vertices (Section
{o1d1, o2d2, o2d3, o3d3, o3d4, o4d4} characterizing the open 2.1.1), the initialization (step 4) is O (N2). However, the associated
boundaries in an image. The execution time of separating open time cost is very low. The main time cost is in step 7, for critical
sub-graphs (Section 2.1.2), will depend on P and on No. The loops vertex identification and status assignment. Typically, the vertices
in step 5 and in step 5.c.ii show that the execution time associated with occurrences = 1 or 2 will be predominantly more as can be
with finding minimum directed distance to locate end points is O seen from Table 1. Rejection of o1d2 and o2d2 vertices in cases 1

Table 1
Some of the images used in experiments along with the number of each type of the vertices.

Sr. No. Image o1d1 o1d2 o2d2 o2d3 o2d4 o3d3 o3d4 o4d4 C P
1. 2 80 19 4 0 0 0 0 4 6

2. 12 0 148 0 0 10 0 0 0 42

3. 3 63 32 5 0 0 0 0 5 8

4. 38 0 28 0 0 36 0 0 0 146

5. 2 178 26 2 2 0 0 0 6 4

6. 8 0 124 0 0 4 0 1 0 24

7. 2 113 114 0 0 0 1 0 1 4

8. 0 285 0 0 5 0 0 0 10 0

9. 48 52 4 48 0 0 0 0 48 96

10. 72 0 37 0 0 0 0 35 0 212

11. 40 95 40 0 0 0 20 0 20 80
1556 N. Narappanawar et al. / Computer Vision and Image Understanding 115 (2011) 1552–1558

Table 2
Output CritVertxLstOpen and CritVertxLstClosed for example image.

CritVertxLstClosed CritVertxLstOpen
Index Previous Next Label Status Index Previous Next Label Status
47 46 124 1 c 123 122 48 1 o
114 113 57 2 c 56 55 115 2 o
57 56 66 3 c 65 64 58 3 o
66 65 105 5 c 61 60 62 4 o
105 104 114 7 c 104 103 67 5 o
85 84 86 6 o
113 112 106 7 o
109 108 110 8 o

Table 3 the analysis, linear regression on Nt and the observed Tt for all
Open and closed sub graphs for example image. the images used in the experiment, was conducted to obtain the
OpenSubGraphs ClosedSubGraphs coefficients {t0, t1, . . . , t8} [23]. The averages of the coefficients for
10 trials are given in Table 5. The coefficient of determination
No Indices No Indices
was found to be 0.999919. A time estimate (Te) was generated
1 123 and 48–56 1 124–140 and 1–47
using Eq. (1). The scatter plot of total time (Tt) verses estimated
2 65 and 58–61 2 57, 66, 105 and 114
3 104 and 67–85 time (Te) along with the trend line is given in Fig. 3. All these
4 113 and 106–109 aspects clearly indicate that Tt is a linear function of Nt.
T e ¼ t 1  o1d1 þ t 2  o1d2 þ t3  o2d2 þ t4  o2d3 þ t 5
 o2d4 þ t6  o3d3 þ t 7  o3d4 þ t 8  o4d4 þ t0 ð1Þ
and 2 will be executed more often. Therefore, case 2 is elaborately
coded. A case with number of vertices with occurrences = 3, com-
parable to that with occurrences = 1 or 2, is shown at serial 4 of 3. Maximum degree of a vertex in a traced boundary
Table 1. For this case, the case 3 will be executed o3d3 times. How-
ever, the ‘count’ for the loops in case 3 or 4 does not exceed 4.
It can be observed from execution time (percentages) given in Proposition. If a boundary is traced using 8-connectivity and is
Table 4 that maximum time is spent in locating the critical vertices. considered as an undirected, connected graph, with pixels as vertices,
In the experiments the minimum is 91% for the image at serial 10 then the degree of a vertex cannot exceed four.
in Table 1. Let Nt be a vector representing number of vertices of all
the eight types {o1d1, o1d2, o2d2, o2d3, o2d4, o3d3, o3d4, o4d4} Proof. Let the traced output be that of an external boundary. The
characterizing the whole boundary in an image. The total execu- proof that follows is also valid for the case that the traced bound-
tion time of the whole algorithm (Tt) is O (Nt). To further support ary is an internal boundary. Let the pixel S, for which the degree is

Fig. 2. Segmented open and closed segments.

Table 4
Execution time in seconds for 5000 repetitions for the images at same serial number as in Table 1.

Sr. No. Critical Vertex Identification Closed sub-graphs Open sub-graphs CVI (%) CSG (%) OSG (%)
(CVI) (CSG) (OSG)
1. 4.61 0.06 0.02 98.31 1.29 0.41
2. 10.21 0.00 0.14 98.68 0.00 1.32
3. 5.08 0.06 0.02 98.31 1.24 0.45
4. 11.15 0.00 0.82 93.15 0.00 6.85
5. 7.83 0.08 0.02 98.75 1.02 0.22
6. 7.98 0.00 0.07 99.13 0.00 0.87
7. 9.37 0.06 0.03 99.13 0.59 0.28
8. 9.61 0.11 0.00 98.85 1.15 0.00
9. 19.15 0.36 0.35 96.41 1.82 1.77
10. 17.00 0.00 1.64 91.22 0.00 8.78
11. 12.95 0.14 0.28 96.86 1.03 2.11
N. Narappanawar et al. / Computer Vision and Image Understanding 115 (2011) 1552–1558 1557

Table 5
Coefficients for generating time estimate (Te) for 5000 repetitions.

Coefficient t8 t7 t6 t5 t4 t3 t2 t1 t0
Value 0.2310 0.1884 0.1614 0.2511 0.2507 0.0494 0.0288 0.1162 0.2686

H G F H G F H G F
A S E A S E A S E
B C D B C D B C D
(a) (b) (c)
Fig. 5. Possible combinations of neighbors (a) (2 direct, 2 indirect), (b) (1 direct, 3
indirect) and (c) (0 direct, 4 indirect). The vertices shaded ‘‘gray’’ are the vertices of
an external boundary.

Fig. 3. Total execution time (Tt) for 5000 repetitions in seconds, verses estimated
time (Te).

being considered, be the vertex of a connected planar graph.


Consider 3  3 neighborhood of a vertex S given in Fig. 4. The
vertices {A, C, E, G} are the direct neighbors and the vertices
{B, D, F, H} are the indirect neighbors. Let the degree of S be four.
Hence, we consider four vertices in the neighborhood of S. The
possible combinations of number of (direct, indirect) vertices can
be {(4, 0), (3, 1), (2, 2), (1, 3), (0, 4)}. The corresponding possibilities
for the combinations are {1, 16, 36, 16, 1}. Fig. 6. Sample results on handwritten number ‘8’, columns are indicated in
brackets: Input images (1, 5), corresponding thinned and traced images (2, 6),
1. Valid edge condition: An edge between a vertex X and S would corresponding segmented boundaries (3, 4, 7, 8). The results show only those open
contribute to the degree of S if the tracing either reaches S from or closed segments, which are of size greater than 5% of traced boundary.

X or reaches X from S.
2. In case of the combination (4, 0): S is not a boundary pixel.
For the proposition, an elaborate proof considering the inci-
3. In case of the combination (3, 1): At least one of the vertices in
dences from direct/indirect neighbors, S being a part of open
the neighborhood of S will not satisfy valid edge condition.
and/or closed boundary, can also be given.
Hence degree of S will be less than four.
4. An example figures for the combinations {(2, 2), (1, 3), (0, 4)} are
given in Fig. 5. The degree of vertex S can be four or less depend- 4. Results and conclusions
ing on how the neighboring vertices are further connected.
5. To make degree of vertex S as 5, 6, 7 or 8, we will have to add a The algorithm presented in this paper requires a traced bound-
vertex or vertices in the neighborhood of S. ary as an input. It gives open and closed sub-sections as output.
6. After addition of a vertex, at least one of the vertices in the The number of open and closed sub-sections in an object can them-
neighborhood of S will not satisfy valid edge condition. Thus selves be a feature for object recognition. The segmented bound-
degree of S will remain at four or will reduce. aries (or strokes) can be further used to characterize an object in
Optical Character Recognition (OCR) [24–26]. The outputs as
Therefore considering an undirected graph degree of S does not presented in Table 3 were validated manually for 26 images used
exceed 4. in the experiments and were found to be correct in all the cases.
This completes the proof. h The algorithm was also tested using visual inspection on hand
written text. The testing was done on randomly selected images
from different databases. Over 100 images selected from [27] and
20 images for each number (from 0 to 9) from [28] were used.
Some of the thinned, traced and then segmented images of hand

H G F
A S E
B C D
Fig. 4. 3  3 neighborhood of S.
1558 N. Narappanawar et al. / Computer Vision and Image Understanding 115 (2011) 1552–1558

written number eight are shown in Fig. 6. The analysis of the [21] Fu Chang, Chun-Jen Chen, Chi-Jen Lu, A linear-time component-labeling
algorithm using contour tracing technique, Comput. Vis. Image Und. 93 (2)
proposed algorithm (Section 2.2) clearly shows that maximum
(2004) 206–220.
time is being spent in generating a list of critical vertices. The exe- [22] Martin Aigner, Günter M. Ziegler, Proofs from the Book, Springer-Verlag,
cution time of the whole algorithm is O (Nt). Berlin, New York, 1998. p. 146.
[23] Sarah Boslaugh, Dr. Paul Andrew Walters, Statistics in a Nutshell: a Desktop
Quick Reference, O’Reilly Media, 2008. pp. 264–284.
[24] Sam T.S. Wonga, Howard Leung, Horace H.S. Ipa, Model-based analysis of
Acknowledgements Chinese calligraphy images, Comput. Vis. Image Und. 109 (1) (2008) 69–85.
[25] I.S.I. Abuhaiba, M.J.J. Holt, S. Datta, Recognition of off-line cursive handwriting,
The authors would like to thank Dr. Amol V Patil, Solutions Comput. Vis. Image Und. 71 (1) (1998) 19–38.
[26] Dong-Gyu Sim, Young Kug Ham, Rae-Hong Park, In Kwon Kim, Analysis of
Architect at iGATE Patni Computers Ltd, India for his help in the mixed Korean documents using the branch and bound algorithm based on DP
development of paper. We also thank the anonymous reviewers matching, Comput. Vis. Image Und. 71 (3) (1998).
for their valuable comments. [27] Greek Character Database. <http://www.icsd.aegean.gr/lecturers/
kavallieratou/GCDB%20page/GCDB.htm> (26.05.11).
[28] The MNIST Database of Handwritten Digits. <http://yann.lecun.com/exdb/
mnist/> (26.05.11).
References

[1] R.L. Cosgriff, Identification of Shape, Rep. 820-11, ASTIA AD 254792, Ohio State
Nitin L Narappanawar completed B.E. (Hons.) in Elec-
Univ. Research Foundation, Columbus, Ohio USA, 1960.
trical & Electronics from Birla Institute of Technology
[2] C.T. Zahn, R.Z. Roskies, Fourier descriptors for plane closed curves, IEEE Trans.
Comput. 21 (1972) 269–281. and Science, Pilani, India, in the year 1981. Soon after
[3] D.H. Ballard, Generalizing the Hough transform to detect arbitrary shapes, that he joined the industry. His industrial experience
Pattern Recognition 13 (2) (1981) 111–122. spans more than 20 years, covering innovative product
[4] P.V.C. Hough, Method and Means for Recognizing Complex Patterns, US Patent developments in various Technology Areas. From the
3969654, 1962. year 2002 he is in the Academics. His current research
[5] H. Freeman, On the encoding of arbitrary geometric configurations, IRE Trans. interest is computer vision and pattern recognition.
Electr. Comput. ED-10 (2) (1961) 260–268.
[6] H. Freeman, Boundary encoding and processing, in: B.S. Lipkin, A. Rosenfeld
(Eds.), Picture Processing and Psychopictorics, Academic Press, New York,
1970, pp. 241–266.
[7] J. Matas, J. Kittler, Junction detection using probabilistic relaxation, Image Vis.
Comput. 11 (1993) 197–202.
[8] T. Pavlidis, Structural Pattern Recognition, Springer Verlag, Berlin, 1977.
[9] Q. Ji, R.M. Haralick, Corner detection with covariance propagation, in: Vision
and Pattern Recognition, IEEE Computer Society, Los Alamitos, CA, 1997, pp. B Madhusudan Rao completed his masters in Advanced
362–367. Embedded Systems Design in 2008 from International
[10] Ambar Dutta, Avijit Kar, B.N. Chatterji, Corner detection algorithms for digital Institute of Information Technology (I2IT) Pune, India
images in last three decades, IETE Tech. Rev. 25 (3) (2008) 123–133. and B.E. in Electronics and Communication from PDA,
[11] A. Masood, S.A. Haq, Object coding for real time image processing applications, College of Engineering, Gulbarga, India, in 2005. He
in: S. Singh, M. Singh, C. Apte, P. Perner (Eds.), Lecture notes in computer worked at I2IT, Pune for more than two years as a Sr.
science, Pattern Recognition and Image Analysis, vol. 3687, Springer, 2005, pp. Research Assistant. He is currently working as a Soft-
550–559. ware Engineer at iGATE Patni Computer Systems Ltd,
[12] F.A. Razzak, A Web based Automatic Outline Capturing of Images, M.Sc. Thesis, India belonging to a team responsible for design and
King Fahd University of Petroleum and Minerals Dhahran, Saudi Arabia, 2001. development of algorithms for medical imaging. His
[13] M. Sarfraz, M.N. Haque, M.A. Khan, Capturing outlines of 2D Images, in:
area of interest includes computer vision, pattern rec-
Proceedings of International Conference on Imaging Science, Systems, and
ognition, medical imaging and embedded systems.
Technology (CISST’2000), CSREA Press, Las Vegas, NV, USA, 2000, pp. 87–93.
[14] G.E. Hol̈zle, Knot placement for piecewise polynomial approximation of
curves, Comput. Aided Des. 15 (5) (1983) 295–296.
[15] M. Sarfraz, M.F.A. Razzak, An algorithm for automatic capturing of font
outlines, J. Comput. Graph. 26 (5) (2002) 795–804. M. A. Joshi received Ph.D. in electronics engineering
[16] M. Sarfraz, M. Khan, Towards automation of capturing outlines of Arabic fonts, from Pune University, in 2000 and MS.c(Tech) by
in: Proceedings of the Third KFUPM Workshop on Information and Computer research Manchester UK in 1990. She is currently
Science: Software Development for the New Millennium, Saudi Arabia, 2000, working as Prof. (Electronic) & Dean R&D at the
pp. 83–98. Department of E& TC, College of Engineering Pune. Her
[17] Kazuhide Sugimoto, Fumiaki Tomita, Boundary segmentation by detection of area of interest includes Image compression, Pattern
corner, inflection and transition points, in: Proceedings, IEEE Workshop on recognition techniques, and Quality measures for com-
Visualization and Machine Vision, 1994, pp. 13–17. pressed images.
[18] C.L. Liu, Elements of Discrete Mathematics, second ed., Tata McGraw-Hill
edition, 2000. ISBN 0-07-043476-X.
[19] Narsingh Deo, Graph Theory with Applications to Engineering and Computer
Science, Prentice Hall Series in Automatic Computation, Prentice-Hall, pp. 23–
24, ISBN: 0133634736.
[20] Nitin L. Narappanawar, B. Madhusudan Rao, T. Srikanth, M.A. Joshi, Vector
algebra based tracing of external and internal boundary of an object in binary
images, J. Adv. Eng. Sci. Sect. C (4) (2010) 57–70.

You might also like