Professional Documents
Culture Documents
Image Processing
and Computer
Vision
A Fast Parallel Algorithm for
Robert M. Haralick
Editor
Thinning Digital Patterns
ABSTRACT: A fast parallel thinning algorithm is proposed faster and more efficient parallel thinning algorithm.
in this paper. It consists of two subiterations: one aimed at The distortion should be as little as possible. Experi-
deleting the south-east boundary points and the north-west mental results indicate that this method can be used to
corner points while the other one is aimed at deleting the thin a variety of digital patterns.
north-west boundary points and the south-east corner
points. End points and pixel connectivity are preserved. 2. PARALLEL PICTURE PROCESSING
Each pattern is thinned down to a "skeleton" of unitary A binary digitized picture is defined by a matrix IT
thickness. Experimental results show that this method is where each pixel IT(i, j) is either 1 or 0. The pattern
very effective. consists of those pixels that have value 1. Each stroke
in the pattern is more than one element thick. Iterative
transformations are applied to matrix IT point by point
1. INTRODUCTION according to the values of a small set of neighboring
It is well known that the general problem of pattern points. It is assumed that the neighbors of the point (i, j)
recognition lies in the effectiveness and efficiency of are (i - 1, j), (i - 1, j + 1), (i, j + 1), (i + 1, j + 1),
extracting the distinctive features from the patterns. (i + 1, j), (i + 1, j - 1), (i, j - 1), and (i - 1, j - 1), as is
The stroke analysis method is a powerful approach to shown in Figure 1. In parallel picture processing, the
recognizing certain types of digital patterns such as al- new value given to a point at the nth iteration depends
phanumeric characters and ideographs. It should be on its own value as well as those of its eight neighbors
noted that the strokes thinned by hardware or software at the (n - 1)th iteration, so that all picture points can
are accompanied by different kinds of distortion. Differ-
ent thinning algorithms produce different degrees of
distortion [1-5, 7-12]. P, P2 P3
There is no general agreement in the literature on an (i- 1, j- 1) (i- 1, j) (i- 1, j+ 1)
exact definition of thinness. Pavlidis [6] describes a P, P1 P,
thinning algorithm that determines skeletal pixels by (i, j - 1) (i, j) (i,j+ 1)
local operations. At the same time, the pixels are la- P~ Pe Ps
beled so that the original image can be reconstructed (i+ 1 , j - 1) (i+ 1,j) (i+ 1,j+ 1)
from its skeleton. The goal of this paper is to find a
© 1984 ACM 0001-0782/84/0300-0236 75¢ FIGURE 1. Designations of the nine pixels in a 3 x 3 window.
be p r o c e s s e d s i m u l t a n e o u s l y . It is a s s u m e d t h a t a 3 x 3 In t h e s e c o n d s u b i t e r a t i o n , o n l y c o n d i t i o n s (c) a n d (d)
w i n d o w is used, a n d t h a t e a c h e l e m e n t is c o n n e c t e d are c h a n g e d (Figure 3) as follows:
w i t h its e i g h t n e i g h b o r i n g e l e m e n t s . T h e a l g o r i t h m pre-
(c') P2*P4*P8 = 0
sented in this paper requires only simple computations.
(d') P2*P6*P8 = 0
3. T H I N N I N G A L G O R I T H M a n d t h e rest r e m a i n t h e same.
O u r m e t h o d for e x t r a c t i n g t h e s k e l e t o n of a p i c t u r e By c o n d i t i o n s (c) a n d (d) of t h e first s u b i t e r a t i o n , it
consists of r e m o v i n g all t h e c o n t o u r p o i n t s of t h e pic- will be s h o w n t h a t t h e first s u b i t e r a t i o n r e m o v e s o n l y
t u r e e x c e p t t h o s e p o i n t s t h a t b e l o n g to t h e s k e l e t o n . In t h e s o u t h - e a s t b o u n d a r y p o i n t s a n d t h e n o r t h - w e s t cor-
o r d e r to p r e s e r v e t h e c o n n e c t i v i t y of t h e s k e l e t o n , w e n e r p o i n t s w h i c h do not b e l o n g to a n ideal s k e l e t o n .
d i v i d e e a c h i t e r a t i o n into t w o s u b i t e r a t i o n s . T h e p r o o f for t h e first s u b i t e r a t i o n is given, t h a t is,
In t h e first s u b i t e r a t i o n , t h e c o n t o u r p o i n t P1 is de- t h e p o i n t s to b e d e l e t e d satisfy c o n d i t i o n s :
l e t e d from t h e digital p a t t e r n if it satisfies t h e f o l l o w i n g
conditions:
(a) 2 _< B(P1) -< 6
0 0 I
i
(b) A(P~)= 1
1 : P~ 0
(C) P2*P4*P6 = 0
1 I 0 0
(d) P4*P6*P8 = 0 \2 J
w h e r e A(P1) is t h e n u m b e r of 01 p a t t e r n s i n t h e o r d e r e d
set P2, P3, P4, - • - P8, P9 t h a t are t h e eight n e i g h b o r s of FIGURE 2. Counting the 01 patterns in the ordered set P2, P~, P4,
P1 (Figure 1), a n d .... P~, P~.
B(Pi) is t h e n u m b e r of n o n z e r o n e i g h b o r s of P1,
North
t h a t is,
P2
B(P1) = P2 + P3 + P4 + • • • + P8 + P9.
West Pa Pl P4 East
If a n y c o n d i t i o n is not satisfied, e.g., t h e v a l u e s of P2,
Pa
P3, P4, • • - P9 as s h o w n in Figure 2, t h e n
South
A(Pi) = 2
T h e r e f o r e , P~ is n o t d e l e t e d from t h e p i c t u r e . FIGURE 3. Pointsunder consideration and their locations•
.@~.~• @.~@. ~ . • ° . . . .
IT = IT - M
TABLE I. Comparison of CPU Time (in seconds) Consumed by
Different Parallel Thinning Algorithms
Method Yes
Pattern
Four-Step Two-Step Our Algorithm
. . • ~ . .
.@ • °@° •
.@ • o@• • ~
.@ • •@o °
.@ • .@• •
222,1 ~.2.
.@ • .@@..
.@ ° • o@o °
.@ . . . . . . . . . @.
1,2 *,,;;'. .H,,,, ..... .@@@@@@@@@@@..
.@ . . . . . . . . . @@..
'~,2 • ottt .... .@. . .@@..
..,. .... . .............. .@. . .@...
.@. . .@..
~e . . . . . . . . . .
.@ . . . . @..
.@. . .@.. .* ........ "~;;22
.@. . .@..
.@. . .@... ..~...
.@. . .@@..
..... @.......... @@..
..@@@@@@@@@@@@@@@@..
oo• . . . . . . • . • • o ~ o o • ::~;::::
(a) (b) (c)