ѧ
JOURNAL OF SOFTWARE
1999 19 3  Vol.19 No.3 1999



ַճཻķָʶ𷽷
ٽ𡡲ʿܡŸסշᡡ¼
ժҪ˹ͼֽʸжճַཻķָ㷨ʶ𷽷.ִͬĶ㷽,ͨճֿʸ͵ʵֿķָ.òͶӰճַཻµּи,ʹͼַʶ𾫶,㷨Ծֲ˻״̬µַʶõĿ.
ؼʡͼѧ,ͼֽʶ,ͼָ,ʶ.
ͼšTP391
Segmentation and Recognition Methods of Adhesion and
Intersection Character String with the Line
ZOU Rong-jin CAI Shi-jie ZHANG Fu-yan SU Feng CHEN Ji-bing
(Department of Computer Science and Technology Nanjing University Nanjing 210093)
(State Key Laboratory for Novel Software Technology Nanjing University Nanjing 210093)
Abstract The segmentation and recognition methods of the omnirange character string which is adhered or intersected with the lines in the engineering drawing vectorization are described in this paper. The directional calculation methods of the string are also supplied on different drawing distribution cases, the segmentation of the adhered string between characters is also realized by calculating the feature vectors of the adhered local string block image and using the iteration approachment algorithm. The authors use the projection method to solve the segmenting problem of the characters in the case of character adhered or intersected with the lines, which made the recognition accuracy of the omnirange string increased. The algorithm has the antijamming property for the local degradation character recognition in the engineering drawings.
Key wordsComputer graphics, engineering drawings vectorization, image segmentation, recognition.
ͼֽԶʶĿǰѧоһȵ.Ŵ湤ɨǵĳ,оӦ򶼶Դʮ,ͬʱ,ý弼ķչԽԽҪܹԶ֡ͼϢ,Լڼǰ빤.ڽDPUGUIĸٷչ,ıOCRӦúռ,дĿǰδﵽʵý׶,дĸԶʶ൱һ·Ҫ,ʹдԷǼԱһ,һԱ.ͼͼļԶʶⷽокܴǱڵӦüֵ,ʽΪ͹ۺ׼ȷ,άӾѶҪС;Եɫͼʾ,ԽС,ʶľȱȽϸ;ֱҵ,ڹơͼGISӦõֱӵľüֵ.
Ŀǰ,ͼԶ봦о14Ҫʹϸ㷨.Ȼϸһ̶Ͽɻȡ,ᵼ´ϢĶʧ,ͼֽϸֲ̬ͬΪ.ЩжԹͼִʶδо,ף1ʹִͨλ,ʹͨ߶ķ״仯ϴʱϴķ,Ҳܴʶִճճཻ.ݴˣ˶ֵָճ,ͨȺʸ,αƽִķ,ͶӰʵʩַķָ,ճཻķָ㷨ϸ.
1 ͼֽɨͼַķ붨
ַȡͨΪ,Ȳðͨ㷨ֿȡ,ͨĴСзָͷ,һȷΪͼΡַ3.ڴַСͼηϵĽ,෽Ҫݾֲͼľصѧ.
1.1 شСַͼεѧ
һֵͼf(x,y);x,y=0,1,2,...,N-1,ɶһΪֲͼ񼸺״ж:
1
(,)=(M10/M00,M01/M00),Mpq=f(x,y)xpyq.(1)
2ľ
mpq=f(x,y)(x-)p(y-)q,(p=0,1,2;q=0,1,2).(2)
3 ܶ
D=m00/2SSΪͨеܵ.(3)
4 
 .(4)
,eΪͨĳ֮.׾mpqӳֿڲ,ַ̬ͬͼͨλ(,)ܶDeͬ.һ,ͨʱؼӼΪ.,ַͨλͨ,ͼȻ;ܶȸߵһΪַͨ,ܶȵ͵Ϊͼͨ;ַıͨ0.51.5֮,ͼԱ仯ϴ.
1.2 ִĶ뷽㷨
ͼֵַıʶֲֶͬķ,ҪʶЩַ,Ҫͼнַȡ.ͼзַҪΪ״̬:ͨճ.ڶַ,ǾиԶͨ,ðͨݹ㷨ȡÿһַͨĵ,ͨڹϵ,ʹһͨ,ÿһڵһַ,ÿһڵָǰһַڵָָһַڵָ,ȷǰַʱҪǹͼй涨ʶĿܴλ.ڷַͨʱ,Ȼγ˴.
ͼеĶճִʶ,䶨Ӱִʶ𾫶ȵĹؼ.Ϊ,Ƚַϸ:ַķΪͼִдĻ߷.ֻߵĶ巽ʽAutoCADеDTEXTTEXTͼʽָ߷ػ߷дһµ,ڲַͬΧл᲻ͬ,رǴСдַ.,ǵĻȴһµ.ź,ͼͨͨȺһַֻܻͨͼӹϵ,޷ֱӻȡַĻ߷.ַͼиַ״仯ϴ,ʹòͬͨĵȣж򶼻һĶ.
ʹַͼİΧģ(xmin+xmax)/2,(ymin+ymax)/2ΪַĶλ,βַĵΪַĽƻʼ.
ڳִ(n10),ڵһַ1ַԶ,βַȷַķȡַĻ߷С,ַĵߵķΪLc,ַĻ߷ΪLb,,.еȳַ(3n10),С˷ȷַķһнϸߵľ.
ڶַ(n3)ʹַϴ.ͼ1ʾ,֪ÿַ봮Χ,ͺȷķͼ1(a)ʾ.ʱΧ߷LcǸôߵķLb,Lc=Lb.ʵʼ,һֻܻôÿַͨʾӹϵ,ʹͨΧеȷĴֵ̬кܴϵ.֮,ҲַʾķֻȷһĳLc,Ҫִߵľȷb,תc,ĲεֱƶȷִĻ߷Lb.ִиͨİΧΪ


(a) 봮Χ߷b(b) Χ߷c(c) =c-b
ͼ1 ִβְΧ߱ʾķ
ߪk=(xmin,ymin,xmax,ymax)k, k=1,2,...,m.(5)
ɴ˿ԽһֿΧеĸ߶ȺͿ:
hk=(ymax-ymin)k, wk=(xmax-xmin)k.(6)
ȡǰִֿİΧи߶ȺͿȵֵΪʼֱLsLcľ
D=max(hk,wk),k=1,2,...,m.(7)
ͼ2ʾ,õss=c,ֱͨ򿿽ÿƽĲΪ12أ,ֱõ1νӴĵP1,P2,P1P2ʹs=,ͨ򿿽µĽӴP1,P2,ֱsͬʱͨ1ཻӴ,ʱȡ
c=,Ϊ߷,Lc=Lb.


as=cbsccs=P1P2
ͼ2 ִķƽ㷨
2 ȫճִͨķλ
ַճɷΪ:һַֻһճ;ַжദճ.ȴͼðͨ㷨ַȡ,ճ,ȱԴַ,һ򵥵Ĵһֱͨ,תֱ,αƽཻȷ,ȷַķ,Ȼдֱָ.ַȱǶ򾫶Ȳ,Ҽϴ.
2.1 ճַʸ
ַһΪϳ϶̵ص,ճַΪϳ϶̵ص,ֻҪҳ᷽ͨ,Ҳͨʸ,˷ΪճַָĲο.
ַͼΪf(x,y)(0xm,0yn),Э󼴶ľΪ
(8)




CĽϴֵ1ӦĹһΪ(x1,x2)T,
x1=BB2+(1-A)2 , x2=(1-A)B2+(1-A)2 .(9)
ȷ᷽,Ϊοַ᷽ӦΪ(x1,x2)T,Ϳݴ˷Ϊִĳʼ.ڲֻȫճַٽһʹõ1.2ĵ㷨,øʸȷĳʼе,ȷƽִķ.
2.2 ַͶӰָ
ͨͼΪf(x,y),sΪͶӰ,tΪ䴹ֱķ,txнΪ,f(x,y)sͶӰΪ
.(10)
ȹ̶ʱ,p(t,)Ϊtĺ,༴һһά.ȴ02б仯ʱ,ɵõڲͬf(x,y)ͶӰ.һǽͨͼʸתˮƽ,,ȷͶӰͱxϵͶӰ.xϵͶӰΪ
.(11)
ճַˮƽķָͶӰΪ,ʵʱбճִתˮƽ,شֱͶӰ,ͶӰۼظΪͶӰεķֵ,Ϊָ㣨ͼ3ʾ.


ͼ3 ַͶӰָ ͼ4 ճ߲и
3 ճʱֿͼи
ڹͼֽʾ,ΪʾִĳصĹϵ,ִţصϷ,,ڹͼֽɨʱ,Բԭ,ͳִճ.ͼִʶǰִַѹɶͨ,,߷ִ׼ȷʶȾ.
Ϊֱʸ,һֱһֻоֲִճ,,ٴڲжο졢ȡ.ͼ4ʾ,εĶ㷨5,׼ȷֱ,жηõֱ߿,ֱߵİΧc1c2c3c4,,λֱиߺͼ.
(12)
p1p2Ϊֱֱp1p2ĵλʸp1p2,widthΪ߿.иߺͷֱֱֱ߱Եؽи,Bresenham㷨6ݽиϵظΪɫ,ʵַߵķ.
4 ճַз㷨
ڹͼֽɨͼ,ַеַϽ,ĳЩַһʱ˴ճ,ճλúͳ̶ַ̬йأͼ5ʾ.


ͼ5 ַճͶӰ
ַճԭ3: дʱʱ,ֵļ̫С; ͼֽı̫С,Ҳ̫С; ɨֱʲ.3ھӦʱ޷,ǰڿ͹ִͼֽǵĻͼʽɵ,һȻͨʵ߷ֱʿɻû,ļ,ʹʱӺܶ,Ҳǲʵʵ,һA0Ĺͼֽɨֱ300dpi500dpi֮.ˣַճɨͼеĳֲɱ.
ַ,һǴвַճ,ԶִҲܻȫճ,ǰԿһ㷽ִ,ںҪʹͨ͵ƽķȷִ.
ִȷĻ,ʵճַķָһӶѵĹ.ǵһ,֮һֻиճ,ڴֱִͶӰϾнٵĺ,ʹõ2.2ᵽͶӰ뷽,ͶӰͼеĲ,ͶӰĲҳ,򲨹ȵλþиߵλ.ҪָǣεĲͬ,ֶܳ,Ӧϸֵķ,.ͼ6ʾ,LΪͶӰλ,F(L)ΪͶӰۼֵ,18ʾϸֵλñ.

ͼ6 ͶӰ벨ȵȷ
λʱ,Ӧȵ㣨i,jܴ֮ڵľDij,
DminDijDmax.(13)
DminΪС־,DmaxΪ־.DijDmin,ùȵ㲻;֮,DijDmax,ַ,һָȵ.,ڡ1,l,iխ,ָС,ӦȵһһܴĹȷ,
F(L1)F(L2), d1d2ʱdiΪĳַȣ.(14)
,жȵ֮Ƿ񻹴һηָĹȵʱ,ҪбмȵһǷǿȷ,ȷһ,жļֵҪһ,ҪʹӦķֵ.
5 ཻʱķʶ㷨
ִеĸַⲿֱཻʱ,ѷָʶַཻ,nֱַߴʱ,пʹִΪӴ.
ڵִΪs1s2ͼ7(a)ʾ,s1={c1,c2,c3},s2={e1,e2},ôִִǷͬһִ,Լж:
1 s1,s2Ӧþִͬ.ǵӳӦغ.
2 s1,s2ִβӦСַȣٶִмֱַߴ.
3 s1,s2ִƽַСߡ.
,s1,s2,ͬһִ,ܴδʶַ.ȡs1,s2ִƽΪķ,ַƽ߶Ⱥs1s2ĳȽľΰΧ,ʹͶӰķѰַָĹȵ,ַָ.


(a) ִԼ⡡(b) ཻཻͶӰεıȽ
ͼ7 ཻʱи㷨
ֱ߿ȵһ,ͶӰʱ,ͨʹͶӰۼֵͬʱͼ7(b)ʾ,ֻӰͶӰεķֵӰ첨ιȵλ,ȻͨȿɽϺõؽַָ.,ʹñ׼ģλõƥʶ𽫲ֱཻܵߵӰ.ִķַĴС,ʹô̽⼼,ִм估෽ϵַľδλ,ͬñ׼ģƥ䡢ʶ,ֱܴڵַΪֹ.
6 ʵʶ
ڻȡÿִķ򼰵ַĺָλ֮,ͿԽÿַи,ڹͼϵıעַΪ,ֻҪַиλ׼ȷ,ʹñ׼ģƥķ4,ƶ׼ȡýϸߵʶ𾫶.ַָʶķճཻë̵Ⱦֲ˻нϺõĿ.ԽṹͼԶʶ˶о,ĿʵָֽͼֽԶ㣨Ŀ.ͼ8A0ͼֽϾֲһɨͼ,ͼ9Ӧʶ.


ͼ8 ̣ṹͼɨͼ񡡡 ͼ9 ͼʶ 
оõʽ.ٽ,1962,ְʿ,,ҪоΪͼѧ,ͼʶ.ʿ,1945,ڣʿʦ,ҪоΪͼѧ,CAD.Ÿ,1939,,ʿʦ,ҪоΪý弼,ͼѧ.շ,1974,˶ʿ,ҪоΪͼֽʶCADӦ.¼,1974,˶ʿ,ҪоΪͼֽʶCADӦ.
ͨѶϵ:ٽ212001,ʡо·13301
ߵλϾѧѧ뼼ϵ Ͼ 210093
Ͼѧ¼صʵ Ͼ 210093
E-mail: zjzrj@public.zj.js.cn
ο
1Chan Pyng Lai et al. Recognition of dimension sets in engineering drawings. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1994,16(8):848855
2Jairo Rocha et al. Character recognition without segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1995,17(9):903909
3Nagasamy Vijay. Engineering drawing processing and vectorization system. Computer Vision, Graphics & Image Processing, 1990,49(4):379397
4Wei Dong-min et al. Using WEB grammar to recognize dimension in engineering drawings. Pattern Recognition, 1993,26(9):14071416
5ٽ,ʿ,Ÿ.гֱ̱Ϸ.ѧ,1997,8():404410
(Zou Rong-jin, Cai Shi-jie, Zhang Fu-yan. Line interpolation method and error estimation based on run length coding. Journal of Software, 1997,8(supplement):404410)
6ҵȺ.ͼѧ̳.ѧ,1994
(Tang Rong-xi, Wang Jia-ye, Peng Qun-sheng. Computer Graphics. Beijing: Science Press, 1994)
1998-03-19ո壩
