Automatic identification for a Chinese seal image

Automatic identification for a Chinese seal image

Pattern Recognition, Vol. 29, No. 11, pp. 1807-1820, 1996 Copyright © 1996 Pattern Recognition Society. Published by Elsevier Science Ltd Printed in G...

1011KB Sizes 3 Downloads 161 Views

Pattern Recognition, Vol. 29, No. 11, pp. 1807-1820, 1996 Copyright © 1996 Pattern Recognition Society. Published by Elsevier Science Ltd Printed in Great Britain. 0031-3203/96 $15.00+.01)

Pergamon

PII: S0031-3203(96)00032-5

AUTOMATIC IDENTIFICATION FOR A C H I N E S E SEAL I M A G E Y U N G - S H E N G CHEN Department of Electrical Engineering, Yuan-Ze Institute of Technology, 135 Yuan-Tung Road, Nei-Li, Taoyuan, Taiwan 320, Republic of China

(Received 22 June 1995; in revisedform 6 February 1996; receivedfor publication 28 February 1996) Abstract--Seals instead of signatures for person identification are widely used in many commercial applications in China. The seal identification is usually performed by hardmatching of human visual inspection. To perform the hardmatching automatically, an approach is presented to identify a Chinese seal image. Four types of the seals of the author's own are used for illustrations and experiments.The paper begins with describing the principle of hardmatching, followed by the introduction of seal identification. Then the proposed approach is described and its experimental results are presented. Experiments provide the identification ability for the proposed approach. Copyright © 1996Pattern Recognition Society. Published by Elsevier Science Ltd. Seal identification

Block matching

Domain (x y and rO) transformation

1. INTRODUCTION In the Oriental countries, e.g. China, Japan and Korea, seal identification plays an important role for identifying an entity which may be a person, a department of an institute, a social group etc. Usually in Chinese society, for the purpose of person identification, seals are used instead of signatures,(~ which are adopted for identity proving in the Western countries on many types of articles, e.g. paintings, proposals, money withdrawing lists, checks, receipts, etc. Figure 1 shows the binary image of a Chinese money withdrawing list, including a seal imprint indicated by an arrow, for example. In accordance with the actual complex of the Oriental social structure, the use of seal for identification has become more frequent. Therefore, it is necessary and expected to develop an effective approach for seal identification. Seal identification may be regarded as a pattern recognition or template matching which has two characteristics. (2) One is that the standard seal imprint uses only one registered imprint as a dictionary or reference and the other is that there is no geometrical variation for seal imprint except that the resulting seal imprint inked with red or blue paint may be quite different from time to time due to the force, the paint, the location and the rotation of setting a seal by a person. For more concrete statements, we say that two seal imprints are exactly matched (i.e. they are imprinted from a single seal at the different time), not only the characters in the two imprints must be exactly the same in form (e.g. circular or rectangular form), but also the scales, distributions and relative spatial positions of all the strokes in one imprint must be identical to those in the other imprint. Thus, we give the name

"hardmatching" for identifying the seal imprint. The hardmatching is usually performed by human visual inspection and its principle can be stated as follows. Let R and I be two seal imprints as reference one and input one, respectively. R is preregistered as a reference in a personal dictionary of a bank. If I appearing in a money withdrawing list as shown in Fig. 1 is given, the employee of the bank will take the original R and compare them by focusing their centroids, rotating I and looking for the corresponding details between them. If the details between them are satisfactory to the agreement of the employee's subjective judgement, then the input I is accepted. According to the human visual inspection, the hardmatching can be divided into as the following principal steps, that is, segmenting or positioning the seal imprint, finding its centroid, rotating the seal as well as matching in detail and picking out the maximum match for the final decision. In the past, many pattern recognition techniques have been developed and several related applications have also been proposed, such as optical character recognition,13) two-dimensional object recognition,(4) point pattern matching,(5) structural pattern recognition,(6) shape pattern analysis,(7) digit recognition,(s) fingerprint identification,(91 signature verification,(1) seal positioning and identification,(z'1°'11) stamped character recognition,(12) logo recognition,/13) printed music recognition,(1~) symbol recognition,(15/ etc. However, all these known methods are feature-based; they are unsuitable for the implementation of hardmatching according to the foregoing statements. Note that someone may use the morphological operations (i.e. thinning and dilation) for preprocessing the input seal image and use the strokes for matching; however, the geometrical features will be lost in this

1807

1808

Y.-S. CHEN

gl

N

-

Ileal 0 I

,

-I

'

ooo 4 -

'

"

'

'

. . . . . . . . . . . . . . . .

L!

I I

i ,.''

~

I

, .,i. I?i"

.

l

/

.I

I

I Seal imprint 111.l

-;.

..................................

X I S . el H ~ C . . ~ , I b , .

s ~lba}

o

;.- ....... "

I I

Fig. 1. A binary image of a Chinese money withdrawing list, including a seal imprint indicated by an arrow, which is obtained via a scanner.

manner. Hence, according to the characteristics of seal identification, any preprocessing for the seal image which will affect the original geometrical property is not recommended. Furthermore, most of known seal identification methods have a constraint that the seal can only be rotated a little to facilitate the features matching. For example, Yang et aI.(21 applied the feature vectors of segments obtained from the input seal image and the registered one to relaxation matching. The little rotation for the input seal does actually affect the recognition rate due to the neighbors of each features strongly used in the relaxation method. In addition, the effective identification is also strongly related to the quality of seal imprint which may result from paper, setting pressure, slant setting and paint. Without the loss of convenience, it is a reasonable requirement that the seal is set on paper with enough care so that the geometrical property of the resulting seal imprint is preserved enough for identification. Before presenting our approach for seal identification, some useful requirements and corresponding operations are summarized as follows. • The seal imprint is located in a specified region of a paper, say a money withdrawing list. This will facilitate the segmentation of the seal image via the precise control of an optical scanner. Due to the high quality of the scanner with the present technique, the blurred or the distorted cases will not occur as usual. • The seals processed cannot only be rectangular, but also circular in shape. They are the most commonly used ones in real cases. Since both of them are convex, the problem of finding the center information

(including not only the centroid, but also the radius) can be reduced to that of finding the tangent points. • The seals can be set in any position and can be rotated any degree from its normal orientation in the specified region. To overcome this problem, the seal image will be transformed from the often-used xydomain into the r0-domain based on the center information. In the r0-domain the rotation problem can be readily solved by the conventional convolution-like technique. Of course, this is dependent on the accuracy of the center information. Therefore, if the neighbors of the original found center information are also considered as the candidates for processing, then it will be further approximated to the hardmatching as performed by human visual inspection. • The seal should be set on paper with enough care so that the geometrical property of the resulting seal imprint is preserved enough for identification. In this requirement, only the quality problem of seal imprint resulting from paper and paint is remained. In our approach it is overcome by using the one-to-many matching to identify an inked pixel and using the block matching to identify the whole seal.

2 o T H E P R O P O S E D APPROACH

According to the foregoing statements, an effective approach to automatic identification for a seal image will be presented. It is principally composed of the following parts: segmentation of a seal image, computation of the center information of the seal image, domain (xy and tO) transformation, as well as matching.

Automatic identification for a Chinese seal image

(e)

(m}

(f)

In)

1809

(g)

(h)

1o}

(P)

Fig. 2. Four types of seal images of the author's own. Where seal images in (a) (d) belong to the first type, those in (e)-(h) belong to the second type, those in (i) (1)belong to the third type and those in (m)-(p) belong to the last type, respectively.

2.1. Segmentation of a seal image To process the seal image of the imprint, it should be segmented first. Figure 1 shows the binary image of a Chinese money withdrawing list, including a seal imprint indicated by an arrow, which is obtained via a scanner. Since the seal imprint is located onto a specified place, it is readily segmented via the precise con-

trol of the scanner when the presented approach is performed automatically. The seal image segmented is represented as an array of binary function [f] whose (x, y)th element is pixel f(x, y), where x and y denote spatial coordinates and the value of f(x,y) is either 0 ("white pixel") or 1 ("black pixel"). Figure 2 shows the four types of seal images of the author's own. Where seal images in Fig. 2(a) (d) belong to the first type,

1810

Y.-S. CHEN

Type 1

Type 2

Type 1

[

I

(~,

[

(x~,y9

[

(X4 ,Y4)

(a)

@ (x~,v~)

,)

(x,,y,)

(b)

(c)

Fig. 3. Illustrations of two possible types of finding the four tangent points for a seal image.

those in Fig. 2(e)-(h) belong to the second type, those in Fig. 2(i)-(1) belong to the third type and those in Fig. 2(m) (p) belong to the last type, respectively. To illustrate the effectiveness of the presented approach, the given seal images in the same type are imprinted with different rotations. 2.2. Computation of the center information of seal image The center information of a seal image includes the center point (x~,y~) and the radius Go,w which can effectively generate a circular region to cover the entire seal imprint and may be further used to transform the seal image (see Section 2.3). Since the often-used seal imprints are either rectangular or circular (i.e. both are convex), the problem of finding the center information is reduced to that of finding the tangent points. In current cases, only four tangent points are needed. They are denoted as (xi, Yl), (x2, Y2) , (X3, Y3) and (x4, Y4)- Since the seal imprints rotated are accepted in our approach, two possible types (named as Type 1 and Type 2) of finding the four tangent points should be considered. They are illustrated in Fig. 3(a) and (b), respectively. F o u r tangent lines are shown in each case. To find the tangent point, say point (xl, Yl), the scanned direction for a tangent line on the given seal image is from outward to inward. If a black pixel is met, then the tangent point is obtained and the scanning procedure along this direction is stopped. Likewise, other tangent points are found with the same procedure. As the type of the seal image is unknown, Type 1 is first performed and the following inequality is tested. If:

Ix~ - x i l

min([x 2 -- xi[ , Ix3 -- x21) ~-. - - , 4

(1)

is the truth, then Type 2 is next performed and the tangent points found are adopted. Otherwise, the tangent points found in Type 1 are adopted. According to the above procedure, for example, Fig. 3(a), (b) and (c) belong to the Type 1, Type 2 and Type 1; and the found

four tangent points are listed in Tables l(a), (b) and (c), respectively. After obtaining the four tangent points of the given sealimage, the center information may be computed as follows. As the found tangent points located on the same circle are not guaranteed, we cannot directly average them to obtain the center information. However, in geometry three points can be exactly located on the same circle, which is unique. Therefore, we can use any three consecutive tangent points to compute the center information. Let any such three points be (X(1), y(1)), (X(2), y(2)) and (x (3), y(3)); we can then find the center information (xc, Yc) and r~,y~such that: rx~,yc = N/(Xe -- X(1)) 2 ~- (Yc -- y(1))2

= ,j(x~ - x ~ ) ~ + (yc - 9 )

~

= N/(Xe -- X(3)) 2 -}- (Yc -- y(3))2.

(2)

Then we have two equalities: (X(2) -- X(1))Xe _}_ (y(2) __ y(i))y~ = l([(y(2) 2 _ y(a)2)

+ (x(~)~_ xm~)], (X(3) __ X(1))Xc _1_ (y(3) __ y(i))y~ = ½([(y(3) 2 _ y(1) 2)

+ (x ~3~ _ x~,~)]. (3) The results may then be written as: Xc-- fi27i-qb fl172

and

Yc =

~1~2

~ ~X271'

--

where ~1 ~ X(2) -- X(1), ~2 ~ X(3) -- X(1)~ fil = y(2) _ y(i), f12 = y(3) _ y~l),

72 = ½[(Y13):- Y(1)~)+ (x~3)2- x(l):)],

and

(4)

Automatic identification for a Chinese seal image

1811

Table 1. (a)-(c) list the computation results of finding the center information for seal images shown in Fig. 3(a)-(c), respectively Case 1

Case 2

Case 3*

Case 4

43.305 43.305 43.305 41.152 (54, 64) 2.153

44.173 42.279 42.279 42.279 (55, 63) --1.894

43.177 41.278 43.177 43.177 (54, 62) 1.899

42.197 42.197 44.252 42.197 (53, 63) --2.055

Case I t

Case 2

Case 3

Case 4

43.231 43.231 43.231 43.091 (57, 52) 0.140

43.306 43.159 43.159 43.159 (57, 52) --0.147

43.234 43.088 43.234 43.234 (57, 52) 0.146

43.163 43.163 43.301 43.163 (57, 52) --0.138

Case 1

Case 2

Case 3~

Case 4

40.355 40.355 40.355 39.657 (58, 66) 0.698

40.609 40.011 40.011 40.011 (58, 66) --0.598

40.278 39.735 40.278 40.278 (58, 66) 0.543

40.004 40.004 40.618 40.004 (58, 66) --0.614

(a) (Xl, y1) (X2, Y2) (X3, Y3)

(11, 57) (56, 21) (97, 64)

(x4, y4) Type

(48, 105) 1

r1 /'2 r3 r4 (x~,y~)

fir

(b) (xl, Yl) (x2, Yz) (x3,y3) (x¢, y4) Type

(28, 20) (89, 23) (85, 85) (27, 83)

2

r1

rz r3 /'4 (x~,yc)

6r

(c)

(Xl, y1) (X2, Y2) (X3, y3) (x4, y4) Type

(18, 61) (57, 26) (98, 61) (58, 106) 1

r1 r2 r3 r4 (xc,y,) ~r

* The selected center information is/'54,62 = 43. t The selected center information is r 57,52 = 43. The selected center information is/'58,66 = 40.

Since we have four tangent points, all four combinations (named as Case 1, Case 2, Case 3 and Case 4) should be computed and be further analysed. Here

Case 1. (x(l),y(1))=(xl,yO,(x(2),y~2))=(x2,Y2)

and

(x~3), y~3)) = (x3, Y3)-

Case 2. (x(1),y (~)) = (x2,Y2),(x(2),y (2)) = (x3,Y3)

and

(x~3~,y~3)) = (x4, Y4). Case 3. (x I1), y(1)) = (x3, Y3), (x(2), y(2)) = (x4, y,)

and

(X(3), y(3)) = (X1, 71)" Case4. (x(1),y~1))=(x4,y4),(x(2),y(2))=(xl, yl)

and

(X(3), y(3)) = (X2, Y2)" Then apply them to equation (4) and we can obtain their respective center information. In order to select the most effective center information from the four cases, we have the followng discussion. Consider any case, let (x (4), y(4)) be the one of four tangent points which is not used in the above procedure of finding the center information. Let r' be the distance between (xc, yc) and (x(4),y(4)), and define 6r = rx~,yc - r ' . If Go.yc < r'(fr < 0), the generating circular region with the center information cannot effectively cover the entire seal imprint. Hence, the case of (fir < 0) can be discarded. Ifrxo,y ° >_/(fir > 0), the larger the value 6r is, the more redundant the generating circular region

compared with the seal imprint becomes. Accordingly, the best selection of center information from the four cases depends on which has the most smallest fir(>_ 0). By the above computation procedure, Tables l(a)-(c) list the results of the seal images shown in Fig. 3(a)-(c), respectively, for example. The selected center information a r e r 5 4 , 6 2 = 43, r57,52 = 4 3 and rss,66 = 40, respectively, which have been performed by counting five and higher fractions as units and disregarding the rest. Furthermore, for the seal images shown in Fig. 2, the radii computed are 43 for seal images in Fig. 2(a)-(h); 40 for those in Fig. 2(i)-(1) and 64 for those in Fig. 2(m) (p), respectively. 2.3. Domain (xy and rO) transformation To facilitate the seal identification, the seal image [fJ may also be represented as an array of binary function [p], r and 0 being the new spatial coordinates, and the value of p(r, O) be either 0 ("white pixel") or 1 ("black pixel"). Also we say I f ] in xy-domain and [p] in r0-domain, respectively. Thus, there exists a transformation from xy-domain into r0-domain for an image If] and an inverse transformation from r0-domain into xy-domain for an image [p]. In the following, we term

1812

Y.-S. CHEN

[p] the transformed seal image from the original If]. If the transformed seal image [p] needs to be displayed, it will be inversely transformed from r0-domain into xy-domain and denoted as If]'. Note that the inversely transformed image If ]' and the original If] are somewhat different since only the circular region of If] yielded from the center information is contained in If]'. Given a seal image I f ] with its center information (xc, Yc) and rxc.yc in xy-domain, the seal image can be easily transformed with the following sampling procedure. F o r each 0, rAr varies from 0 to rxc,yc (where r increments by 1 and Ar is a positive variation) and 0A0 varies from 0 to 360 ° (where 0 increments by 1 and A0 is a positive variation); we compute:

X

0

p(r, O) =

{~

if f(xc + rArcos(OAO),y c + rArsin(OAO))= 1, otherwise. (5)

They are also defined and illustrated in Fig. 4(a). The r0-domain of the transformed seal image [p] may be illustrated in Fig. 4(b). After the transforming procedure, we will have the width r width and length 0 length for the [p] image. Note that in this paper the values of both Ar and A0 are selected to be 1. Therefore, r width = rxc,y c a n d 0 length = 360. Since sometimes the human visual inspection on the seal imprint for further check is also important, inversely transforming (from r0-domain to xy-domain) and displaying the transformed seal image [p] are also necessary. The inverse transforming procedure may be given as follows. For each 0, r varies from 0 to r width incrementing by 1 and 0 varies from 0 to 0l*ngth incrementing by 1; we compute:

y (a) Origin

p ( r width - 1,0)

• •.

p(r-l,0-1) p(~0-1)

p(r+1,0-I)

p(r-l, o)

p(r+l, O)

p(n o)

r

- - -

p(r-l,0+l) p(~ 0*1) p(r+1, 0*1)

f'(Xlocation + r A r eos(Ostar t -]- OAO), Yioc~tion

+ rAr sin( Ostart + 0 A 0 ) ) : {10 if p(r,O)= 1, otherwise.

~(0, 0 t~'~'h - 1)

(6)

Here (Xloc~tio,,Yloeation)and 0~t~, control the location and the rotation for displaying the transformed seal image [p]. In our approach, the seal images in the database should be transformed in r0-domain. If an input seal image provided from one person is given for identification, it need also be first transformed and then matched with the original transformed seal image of this person in the database. As a result, the seal images in Fig. 2 can be transformed by equation (5), and their transformed versions can also be inversely transformed by equation (6) as shown in Fig. 5, respectively. 2.4. Matching Let [P]R and [p]s be the reference and input transformed seal images, respectively. Here R and I are denoted as the symbol of "reference" and "input" throughout the following descriptions. Since the seal identification should be performed by the hardmatching, the one-to-one matching between [P]R and [P]r is

p ( r '~id~h_ 1, 0 ~e'gth - 1)

o (b)

Fig. 4. (a) A seal image in xy-domain used for illustrating the domain transformation. (b) Illustration of r0-domain.

usually considered. The images of the seal imprinted at different times are always different, i.e. one point of the seal may be imprinted on the paper at this time and not imprinted at next time. To make the proposed approach feasible, one-to-many matching is adopted here rather than one-to-one matching and performed mutually between [P]R and [p]l. Let WS(Pe(r , 0)) and WS(px(r, 0)) be the pixels' sum in the 3 x 3 window of pixel pR(r, O) and pixel ps(r, 0), respectively. The 3 x 3 window is illustrated in

Automatic identification for a Chinese seal image

1813

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

N N N N (i)

(j)

(m)

(n)

(k)

Io)

(I)

(P)

Fig. 5. The transformed versions of seal images shown in Fig. 2 are inversely transformed and reshown, respectively.

Fig. 4(b). Then the one-to-many matching from p~(r, O) to pl(r, (0 + 0') m o d 0 length) and from pi(r, (0 + 0') m o d 0 length) to pR(r, O) are, respectively, defined as:

mRi(r,O,O')={

Furthermore, the different seals of one's own may be very similar [compare the seal images in Fig. 2(a)-(d) to those in Fig. 2(e)-(h), for example]; the identification

if pR(r, 0) = 1 and WS(pi(r , (0 -}- O')mod 0 length) ~ 0, if pg(r, 0) = 1 and WS(p1(r, (0 + 0') mod 0 length)= 0,

(7)

1 if Pi(r, (0 + 0') m o d 0 length) = 1 and WS(pe(r, 0)) =/:O, - 1 if p1(r, (0 + 0') m o d 0 length)= 1 and WS(PR(r, 0)) = O.

(8)

11

and

miR(r, O, 0') =

Note here that in matching, the [p]~, may be rotated O' degrees to match [PIe, which is fixed. 0 + 0' should be treated as modulo 0 length due to the cycle of the rotation.

cannot only compute the score of matching the whole seal image. It should be performed by block matching and by examining the score in each block matching. That is, each transformed seal image is divided into

1814

Y.-S. CHEN

K blocks for matching along the 0 axis, and for block k, the following two matching scores are computed:

(

k0ie~h/K

(k) t MRI(O )=

for all 1 and 0'. Similarly the maximum value, FMS(Rm~)(O'p), in which the transformed seal image [P] x~, belongs to Type lp and its rotation degree is 0~, is

" wi mm(r R........ ,r I )

~ \ 0 = (k -- 1)ole~gh/K

r=0

kOle~h/K

mtn(r~idth,r}Vidth)

\ 0 = (k -- 1)01erlgth/K

r=0

Z and

i

kOlength/K

(k) t

MtR(O ) =

p,(r,O)),

(9)

" R width,r Iwidth) mln(~

Z

I

l/nlR(r,O, OI)--C[rwRidth--r~idth[)

Z

0 = (k -- 1)Olength/K

r=0

kolength/1(

min(r~idth" r~idth)

Z 0 = (k -- 1 )olength/K

FMSRI(O' ) = min ( min M~}(0'), rain M}~(O')).

/

)

p~(r,(O + 0') mod 0l*"gth) ,

(10)

r=O

where the first summation term is used to compute the number of matches between the two seals; the second absolute minus term is used to compute the size-difference between the two seals; the last summation term is used for normalization, respectively. The constant C is set to be olength/Kin this paper. If the size of two seals is the same, the first term is dominant. Otherwise, the second term is dominant. Hence, as long as the size of two seals matched is different, the unmatched result is easily indicated with very low matching score. Based on the foregoing fundamentals, to identify a seal image we should examine whether or not each block matching score in the case of [P]I rotated 0' degrees is above a specified threshold. If so, then the input seal image is the same as the reference seal image and the input image is rotated 0' degrees corresponding to the reference. Otherwise, they are different. As a result, consider K blocks in the matching scheme, we have 2K block matching scores. Consider [P]I is rotated O' degrees, then the final matching score (FMS) may be expressed as: Vk

)/

mRx(r,O, 0t ) -- Clr width R -- r'~idth I

(11)

Vk

Hence, if the rotation of the input seal image is not preknown, equation (11) should be performed for all cases in - 180 _< 0' _< + 180 ° and the maximum value FMS~)(O'p), whose rotation degree is 0~, is picked out. According to the computation of the seal center information in Section 2.2 and the digital effect, the more accurate center point (x~,Yc) may also be positioned in its neighborhoods. They are named as Type 0 to Type 9, as shown in Fig. 6(a); the corresponding transformed versions of the seal image of Fig. 2(b) are inversely transformed and shown in Fig. 5(b), for example. That is, the more precise matching may be obtained by using one of the nine types (say the /th type) of the given input seal image. Therefore, equation (ll) may be rewritten as: Fig. FMSg~(O') = rain ( miknM(~}~(O'),mv~nM}k)R(O')), (12)

(x~_,,yo_,)

(x~,yo_,)

(xc+l, Yc-1)

Type 1

Type 2

Type 3

(x~-i ,Yc) Type 4

(xc,Yc) Type 0

(xo+~,Yc)

(xc_~ ,yc+~)

(xc,Yc+l)

(xc+l, Yc+l)

Type 6

Type 7

Type 8

Type 5

(a)

NNN NNN NN..N Type 1

Type 2

Type 3

Type 4

Type 0

Type 5

Type 6

Type 7

Type 8

(b) 6. (a) The neighborhoods of the center point (xc,yc). (b) The corresponding transformed versions of the seal image in Fig. 2(b) for the nine points represented in (a).

Automatic identification for a Chinese seal image

1815

block I

block 2

block 3

block 4

block 5

block 6

(a)

(b)

(c)

(d)

Fig. 7. (a) Let the number of blocks for matching be 6. The above is used to illustrate the reshown image for the transformed version and the below is the original r0-domain of the transformed version. (b)-(d) show the reference, the input and the input with rotating 153 °.

picked out. The three information may be represented by a 1 x 3 row vector as the format (type, rotation degree, matching score). Le. " (Ip, Or, ' FMSRh, (re.x)(Or)). , F o r example, consider the seal images of Fig. 2(a) and (b) as the reference one and the input one, respectively. Let the number of blocks for matching be 6, as Fig. 7(a) shows. N o t e here that the above is used to illustrate the inversely transforming image for the transformed version and the below one is the original r0-domain of the transformed version, respectively. The reference image is shown in Fig. 7(b). After the computation of equation (12), we obtain the result (5,

153, 0.94), that is, the 5th type of the input seal image rotating 153 ° matches the reference one with the score 0.94. The 5th type is shown in Fig. 7(c). The details of matching are drawn in Fig. 8(a) and the corresponding block matching scores are listed in Table 2(a). In Fig. 8 the x and y axes represent the rotation degree and the type of the input seal image for matching, respectively, and the z axis represents the corresponding matching score. Only the three-element point with the maximal score will be finally output as the one indicated by an arrow in Fig. 8(a), for example. Finally as an option, consider the 5th type of the input seal

1816

Y.-S. C H E N

e

t

(5, 153,0.94)~

0.5

0

-0.5 100

0

8

0

(a)

(7,-42, 0.53) 0.5

-0.5

~ "4

8

/th-type seal image

(b) Fig. 8. The detailed matching scores for (a) R = seal image in Fig. 2(a), I = seal image in Fig. 2(b); (b) R = seal image in Fig. 2(a), I = seal image in Fig. 2(h); (c) R = seal image in Fig. 2(e), I ~ seal image in Fig. 2(b); and (d) R = seal image in Fig. 2(e), I = seal image in Fig. 2(h), respectively.

Automaticidentificationfor a Chinesesealimage

1817

(3,160, 0 . 5 5 ) ~ 0.5

-0.5

~

image

0

(c)

(6,-37, 0.92) g

..v 0.5

8 Rotation degree

1~~/------"----~ 0

(d) Fig. 8. (Continued)

/th-typeseal image

1818

Y.-S. CHEN

Table 2. Block matching scores listed for the picked out vectors (5, 153, 0.94), (7, -42, 0.53), (3, 160, 0.55) and (6, - 37, 0.92) in Fig. 8(a)-(d), respectively k=l

2

3

4

5

6

0.98 0.95

0.98 0.94

1.00 0.98

1.00 0.94

1.00 1.00 0 . 9 5 0.99

M~7(-- 42°)t (k) MITR(-42 o )

0.82 0.53

0.70 0.75

0.65 0.55

0.93 0.62

0.85 0.78

0.84 0.88

(c) M~3(160°)~ M(k)~(160°)

0.59 0.72

0.80 0.55

0.60 0.57

0 . 6 7 0.79 0.70 0.72

0.82 0.84

0.92 0.92

0.98 0.98

0.94 0.92

0 . 9 5 0.97 0.94 0.95 0 . 9 3 0.98

(a) M~)~,(153°)* M[k,~(153°) (b)

(d) M~}~(- 37°)§ M(~k)R( -- 37°) * R and I respectively. t R and I respectively. $ R and I respectively. §R and I respectively.

represent the seal image in Fig. 2(a) and (b), represent the seal image in Fig. 2(a) and (h), represent the seal image in Fig. 2(e) and (b), represent the seal image in Fig. 2(e) and (h),

image is rotated with 153 ° and shown in Fig. 7(d), we may further perform the h u m a n visual inspection on the seal imprint. Of course, in this case, they are the same as in our visual inspection for the images in Fig. 7(b) and (d) except that the jagged p h e n o m e n o n appears in Fig. 7(d) due to the digital effect. 3. E X P E R I M E N T A L RESULTS

So far we have given a series of examples to illustrate the proposed approach. In this section we show more experiments to further confirm the feasibility of this approach. The set of original seal images of the author's own are shown in Fig. 2. Each seal imprint was taken by an optical scanner with 150 dpi and was converted into a binary image. After the transforming procedure in equation (5), they are transformed respectively from the xy-domain into the r0-domain as illustrated in Fig. 4. The transformed images may be inversely transformed by equation (6) and shown in Fig. 5, respectively. According to the principle of hardmatching, two images imprinted fi'om the same seal should have the high matching score. Otherwise, the greater the difference between the two images imprinted from the different seals, the lower the matching score. This property is demonstrated as follows. Since the two types of seal images in Fig. 2(a)-(d) and 2(e) (h) are very similar, but are really different (if they are viewed in detail), we take them for detailed illustrations. First, let the seal image in Fig. 2(a) be the

reference one R and that in Fig. 2(b) be the input one I, respectively, for identification. By equation (12), we obtain the detailed matching scores shown in Fig. 8(a), in which we find that the m a x i m u m is (5, 153, 0.94), indicated by an arrow. The row vector tells us that the 5th type of the input seal image rotating 153 ° matches the reference one with the score 0.94. Note here that the n u m b e r of blocks used for matching is set to be 6. The greater the n u m b e r of blocks adopted, the more the detailed matching is performed. Secondly, let the seal image in Fig. 2(h) I and R be not changed, then we have the detailed results shown in Fig. 8(b), in which we find that the m a x i m u m is (7, --42, 0.53), indicated by an arrow. The row vector tells us that the 7th type of the input seal image rotating - 4 2 ° matches the reference one with the score 0.53. Thirdly, we let the seal image in Fig. 2(e) be R and that in Fig. 2(b) be I, then we have the result shown in Fig. 8(c) with the m a x i m u m (3, 160, 0.55). If R is not changed and I is changed, as the seal image in Fig. 2(h), then the result is shown in Fig. 8(d) with the m a x i m u m (6, - 37, 0.92). The detailed corresponding block matchings of these maxima are shown in Table 2. The mutual-matching results for all cases of these two types are listed in Table 3. For the two types of seal images in Fig. 20)-(1 ) and 2(m)-(p), we show their self-matching results in Table 4. Since all the mutual-matching scores for the remaining cases are very low (below 0 for all cases in our experiments), we do not show their results in this paper. This high rejection is due to the detailed designations of matching in Section 2.4 and can be exactly and effectively applied to matching different seals. As a result, from the above experiments, we can easily set a reasonable threshold, say 0.75, for the seal identification. Of course, if the input seal does not belong to the person who has set one of his own as a reference in the database, then the result of seal identification should be failed. 4. CONCLUSIONS An automatic approach to transforming and identification for a seal image has been presented. F o u r types of Chinese seals of the author's own are used for illustrations and experiments. In the proposed approach, it is principally composed of four parts: segmentation of a seal image, computation of the center information of the seal image, domain (xy and rO) transformation, as well as matching. The seal image is easily segmented via the precise control of the scanner, since the seal imprint is usually located onto a specified place of the Chinese money withdrawing list. The center information of the seal image is obtained by the detailed computation from the found four tangent points. By means of the center information and the transforming procedure, the seal image is transformed from the xy-domain into the r0-domain. In the rOdomain, not only the seal image is easily handled by hardmatching but also the rotation degree of the input seal is easily obtained so that if necessary the input seal

Automatic identification for a Chinese seal image

1819

Table 3. The mutual-matching results for all cases of the two seal types shown in Fig. 2(a)-(d) and 2(e)-(h), respectively Fig. 2(a)

Fig. 2(b)

Fig. 2(c)

Fig. 2(d)

(0, 0, 1) (5, - 152, 0.89) (6, 172, 0.95) (2, 92, 0.90)

(5, 153, 0.94) (0, 0, 1) (3, - 3 5 , 0.95) (8, - 113, 0.90)

(6, - 171, 0.93) (4, 36, 0.94) (0, 0, 1) (6, - 77, 0.92)

(5, - 9 2 , 0.92) (5, 114, 0.94) (8, 77, 0.93) (0, 0, 1)

Fig. 2(e)

Fig. 2(f)

Fig. 2(g)

Fig. 2(h)

(3, - 5 , 0.54) (5, - 161, 0.55) (0, 165, 0.61) (3, 85, 0.58)

(2, 20, 0.63) (5, - 130, 0.54) (4, - 164, 0.59) (3, 117, 0.52)

(5, 80, 0.60) (8, - 71, 0.54) (5, - 104, 0.56) (8, 176, 0.47)

(7, -42, 0.53) (8, 163, 0.58) (6, 128, 0.56) (0, 50, 0.57)

Fig. 2(a)

Fig. 2(b)

Fig. 2(c)

Fig. 2(d)

(4, 5, 0.55) (7, - 2 1 , 0.62) (6, --81, 0.54) (0, 43, 0.61)

(3, 160, 0.55) (2, 131, 0.51) (3, 70, 0.58) (8, - 164, 0.58)

(5, - 162, 0.62) (4, 166, 0.57) (0, 107, 0.62) (4, - 127, 0.60)

(8, - 8 4 , 0.53) (5, - 115, 0.46) (8, - 175, 0.45) (0, - 50, 0.58)

Fig. 2(e)

Fig. 2(f)

Fig. 2(g)

Fig. 2(h)

(0, 0, 1) (8, - 2 7 , 0.91) (8, - 86, 0.95) (3, 37, 0.94)

(1, 28, 0.94) (0, 0, 1) (4, -- 58, 0.92) (3, 65, 0.86)

(3, 88, 0.96) (7, 59, 0.93) (0, 0, 1) (8, 126, 0.87)

(6, -37, 0.92) (8, - 6 4 , 0.92) (7, - 125, 0.89) (0, 0, 1)

(a) Fig. 2(a) Fig. 2(b) Fig. 2(c) Fig. 2(d)

(b) Fig. 2(a) Fig. 2(b) Fig. 2(c) Fig. 2(d)

(c) Fig. 2(e) Fig. 2(f) Fig. 2(g) Fig. 2(h)

(d) Fig. 2(e) Fig. 2(f) Fig. 2(g) Fig. 2(h)

Table 4. The self-matching results for all cases of the two seal types shown in Fig. 2(i)-(1) and 2(m) (p), respectively Fig. 2(i)

Fig. 2(j)

Fig. 2(k)

F i g . 2(1)

(0, 0, 1) (0, - 3 9 , 0.92) (8, 167, 0.85) (5, 27, 0.81)

(0, 41, 0.91) (0, 0, 1) (7, -- 153, 0.84) (8, 67, 0.91)

(7, --165, 0.86) (8, 154, 0.87) (0, 0, 1) (7, -- 139, 0.85)

(4, -26, 0.86) (6, -66, 0.93) (8, 141, 0.81) (0, 0, 1)

Fig. 2(m)

Fig. 2(n)

Fig. 2(0)

Fig. 2(p)

(0, 0, 1) (5, 0, 0.88) (0, 1, 0.93) (0, 0, 0.87)

(4, 0, 0.88) (0, 0, 1) (4, 2, 0.88) (2, 0, 0.88)

(0, 0, 0.93) (5, --1, 0.90) (0, 0, 1) (2, 0, 0.91)

(0, 0, 0.87) (8, 0, 0.91) (7, 1, 0.91) (0, 0, 1)

(a) Fig. 2(i) Fig. 2(j) Fig. 2(k) Fig. 2(1)

(b) Fig. 2(m) Fig. 2(n) Fig. 2(o) Fig. 2(p)

image m a y be rotate d to the found degree and redisplayed for the further h u m a n visual inspection. To m a k e the a p p r o a c h m o r e effective, the block m a t c h i n g a n d the neighboring m o v e m e n t of the found center i n f o r m a t i o n are adopted. The first shows that every

block in a seal im print is very i m p o r t a n t for identification in the h a r d m a t c h i n g application. The latter provides the detailed considerations for seal identification as h u m a n beings perform since the center information of a seal image found by h u m a n beings is always of

1820

Y.-S. CHEN

fuzziness. E x p e r i m e n t s show t h a t the gap between the score of m a t c h i n g the same seals a n d t h a t of m a t c h i n g the different seals (even they are very similar) is large e n o u g h for identification. In our current system for Chinese seal identification, the t h r e s h o l d is selected to be 0.75. They h a v e confirmed t h a t the p r o p o s e d app r o a c h is feasible. Acknowledgements This work was partially supported by WTT(Wan Ta Technologies Inc.), Taiwan, Republic of China. The author wishes also to thank President Sunny Wang of WTT for his encouragement to this research.

REFERENCES

1. J. J. Brault and R. Plamondon, Segmentation handwritten signatures at their perceptually important points, IEEE Trans. Pattern Anal. Mach. Intell. 15(9), 953 957 (1993). 2. Y. Yang, T. Horiuchi and K. Toraichi, Automatic seal identification using fluency function approximation and relaxation matching method, Proc. 2nd Intl Co@ Document Anal. Recognition 786-789. Tsukuba Science City, Japan (1993). 3. V. K. Govindan and A. P. Shivaprasad, Character recognition a review, Pattern Recognition 23(7), 671 683 (1990). 4. S. R. Dubois and F. H. Glanz, An autoregressive model approach to two-dimensional shape classification, IEEE Trans. Pattern Anal. Mach. Intell. 8(1), 55 66 (1986). 5. A. Goshtasby and G. C. Stockman, Point pattern matching using convex hull edges, IEEE Trans. Syst., Man Cybernet. 15(5), 631-637 (1985).

6. A. K. C. Wong and M. You, Entropy and distance of random graphs with application to structural pattern recognition, I EEE Trans. Pattern Anal. Mach. lntell. 7(5), 599 609 (1985). 7. W. H. Shao and Y. S. Chen, Pattern analysis on shift, rotation, and scaling, Electron. Lett. 28(25), 2271-2272 (1992). 8. J. M. Bertille, An elastic matching approach applied to digit recognition, Proc. 2nd lntl Co@ Document Anal. Recognition 82-85. Tsukuba Science City, Japan (1993). 9. D. K. Isenor and S. G. Zaky, Fingerprint identification using graph matching, Pattern Recognition 19(2), 113 122 (1986). 10. K. Ueda and Y, Nakamura, Method of pattern positioning for automatic verification of seal imprint, Trans. IECE Jpn J68-D (11), 1910-1917 (1985, in Japanese). 11. T. Kaneko, Positioning of seal impression using marginal densities aboutablout the centroid, Trans. IECE Jpn J67-D(1), 133-140 (1984, in Japanese). 12. T. Horiuchi, K. Toraichi, H. Yamada and K. Yamamoto, Stamped character recognition method using range image, Proc. 2nd Intl Conf. Document Anal. Recognition 782-785. Tsukuba Science City, Japan (1993). 13. D. S. Doermann, E. Rivlin and I. Weiss, Logo recognition using geometricinvariants, Proc. 2nd Intl Co@ Document Anal. Recognition 894-897. Tsukuba Science City, Japan (1993). 14. R. Randriamahefa, J. P. Cocquerez, C. Fluhr, F. P6pin and S. Philipp, Printed music recognition, Proc. 2nd Intl Conf. Document Anal. Recognition 898-901. Tsukuba Science City, Japan (1993). 15. T. Cheng, J. Khan, H. Liu and D. Y. Y. Yun, A symbol recognition system, Proc. 2nd Intl Conf. Document Anal. Recognition 918-921. Tsukuba Science City, Japan (1993).

About the Author YUNG-SHENG CHEN was born in Taiwan on 30 June 1961. He received B.E. degree from Chung Yuan Christian University in 1983, and the M.E. and Ph.D. degrees from National Tsing Hua University, Taiwan, in 1985 and 1989, respectively, all in Electrical Engineering. He received a Best Paper Award from the Chinese Institute of Engineers in 1989. He is a member of the IEEE, ACM, EURASIP and IPPR of Republic of China. Since 1991 he has been an associate professor at the Department of Electrical Engineering of Yuan-Ze Institute of Technology, Taoyuan, Taiwan. His current interests include human visual perception, neural model, fuzzy computing, computer vision and circuit design.