ѧ
JOURNAL OF SOFTWARE
1999 6 10 Vol.10 No.6 1999



ͼֽͼͼԶָSegChar*
硡ʡ
ժҪ·˹ͼֽͼͼķָļص㡢ؼͻ,ؽͼԶָSegCharõļ:(1) Զַߴֵ˼,ʹͼķָԶܻ;(2) ⷽⳤַ⼼,ͨȷHOUGHռɳڹߡַHOUGHµȲ,ַָĴٶȣ˴Ŀռ临Ӷȣܹʹӵַȡ..
ؼʡͼֽͼ,ͼķָ,HOUGH任,Զֵ.
ͼšTP391

SegChara Tool for Automatic Text/Graphics Segmentation of 
Engineering Drawing Images
JIANG ZaoLIU Ji-renLIU Jin-jun
(Software Center Northeastern University Shenyang 110006)
Abstract In this paper, the technical characteristics of text/graphics segmentation of engineering drawings, its critical steps and basic processing framework are analyzed. The SegChar, a practical tool for automatic text/graphics segmentation developed by the authors, is presented. The emphasis is put on two technical respects: (1) the automatic text size threshold method, which makes the processing procedure automatic and intelligent; (2) the probing strategy for extraction of text strings of arbitrary direction and length, which can extract Chinese/Western character strings integrally, and enhances its performance in processing speed, space complexity by introducing the concepts of accurate HOUGH space requirements, collinear relaxation and the string based HOUGH field refreshing method. The performance evaluation of SegChar is given finally.
Key wordsDrawing image processing, text/graphics segmentation, HOUGH transform, automatic threshold.
ͼֽеͼκ߼Ͼвͬ͹,ͨͼβֲʸд,ֲַOCR(optical character recognition)ʶ.ͼķָṩĴʶԪ,ǽһַʶͼʸͼֽͼֽĻ.
ͼķַָʶص.ͨ:ȻַĳЩַͬȡ,ȻOCRʶ,ʶĽУ.еַȡԳΪһִַָ.ַĳЩ,ʹOCR,ַָȻԻýϺõķ,ĵͼķָҲԴΪݵ.Ŀ:,ҵͼֽע͵ַַĵַ;,ҵĺּڵĶ.ַʶ,OCRִ.
ͼֽĴڹդĵһ.ͨդĵķ,ѾڴĵĽṹָַȡ,͵ķRLSAȣ1.෽ص,֪ĵ,Զ½з.ֿ顢ͼο,һõַСֱַַ.
ͼֽеַͨ¼ص24:(1) д巶,ͬһͼֽ,Сͳһ;(2) λ÷ɢһ;(3) ַͼڳߴ缰ģʽ;(4) ͼճ;(5) .ˣַȡʶѶȱͨդĵ,ܲôͳĴͲ.뿼Ǵַߴ仯ӦԡַԼַͼε.ݹͼֽص,ͨһͨդĵ෴ԵϵĴҵַ,ַĳЩ,Ȼַַͨ,һֶεȣ3.
ڹͼַֽĴ,ĿǰҪлķ5ݡͨķ2ݡķ6ݺͻھķ7,ף2ķʾͼַֽһֵ͹.÷¼ؼ:ͨıʶַơַĳԼ.
Ĳף2Ĵ.Ϊʵϵͳϸߵ,SegCharر¼:(1) ͨʶ;(2) ͨĿ洢;(3) ַߴԶֵ;(4) Զ˼;(5) ַⷽ⼼.صǣܹȫԶַָ,ַȡЧʹٶ.
ͨʶڷַͼ֮ǰõĻ㷨ǹؼ.ʵùУɾҲʮֱҪ.ǲ˻Ĵ洢ṹ㡢١׼ȷʵֹ,(1)(2),ϸݿɲμף8.
ĽҪͼķָĳߴֵƺַⷽ⼼,صַ˵ԶֵԼHOUGH任ַ⼼.
1 ַָԶߴֵ
ַҪͬߴ絥ľЧӦ,ֳߴеȷ,ֶķ.ṩֶ빦ܵͬʱ,ṩһԶֵ.øü,ڲʼ,ȫԶַķ.
ͨ,״ͼַĳߴֲǹɵ,,Զָʡȥѡȡ޲鷳,Ե.ֶ޵ѡȡ,ͨǾֵѡȡ,һֵӦԲ,Զвõֵ,Ӧ.
üͨͳַߴʵֵ.һ͵Ļеͼͼ1ʾ.粻ǿ,ͨ尴СֵƵʷֲͼ2ʾ(15ڽƽ,ͼ3ͬ),Ϊһֲ̬.ڣ9
P{X-̣3}=0.9937,
XΪĳһСͨ,Ϊֵ,Ϊ׼,,Ϊַһ(-3,+3)Χ,,ԲõԶֵ.
(1) ȼ,;
(2) ȥ(-3,+3)֮ͨ;
(3) ¼,;
(4) ظ(2)(3)ֱûµͨȥ
յ(-3,+3)ΪԶɸѡֵַ.


ͼ1 ͻе̹դͼ


ͼ2ͨƵʷֲ
ֲͨߵʵҪһЩ.ʵ۲,һձ:ֵ,һǵ״,һַۼ,ͼ3ʾ..ͨС,λͶ˷Χ;ַۼԽϸ.ֵ,Ȼϴƫ,ʹָܵӰ.Ϊ,Բü򵥵Ĺ̶ֵȹ˿,Ȼֵַ.ͨΪ,˸ռöļ.

ͼ3ڿͨƵʷֲ
ĿԶͬʱͳֵַ.ͼ3Ϊֲ̬,ԲвԶֵ:
1 ͨƽֵall;
2 Ԧall/10Ϊͨ,ȷ4ֵֿX0,X1,X2,X3;
3 ǰķֱڣX0,X1ͣX2,X3ڹֵΧ(noise-3noise,noise+3noise),(char-3char,char+3char).
2 ⷽⳤַ
ַԴʽڵ.ַַַܹĽ޸ġɾ;ܹΪַʶṩϢϢ.ַͨõķ,һڼ3,һHOUGH任й߼2.ڼһ־ֲ,HOUGH任һ巽.ĲõǺһַ,Ҫ漰HOUGH任ַHOUGHµȷ,ܹⷽⳤַҪ.صǣͨѡȡʵHOUGHֱ,С,˿Իúܿļٶ,ͬʱҲΪͼϰ.ʵֹ,ķ¼ؼ:
1) HOUGH任Ŀռ临ӶȽϴ,ѡʵķֱʵ,ҪȷHOUGHռΧ.һ㹫ʽ,һ,ʹڴ󽵵ͽ1.
2 ַϸĹ,,õHOUGH任޷ȷĽ.һֳΪɳڹߵĲ,ЧַĴ.
3 ַĶ෽򡢷ϸ߸HOUGH任,,HOUGHռ뷴ˢ,Ҹ¹еĴҲǳҪ.Ϊ,һַֻļ,ʹַȡȷ,ڼ⽻ַʹַʮЧ.
2.1 HOUGH任
HOUGH任ѿֱ߱任HOUGHĵ.ѿֱ߿ԱʾΪ
=xcos+ysin,1

ӦHOUGHĵΪ,ȣ,,ȷֱʾͽǶ.,ѿÿ㣨x,yHOUGHһӦ.ͼֽͼĳַеַͨλһֱ,ԹַķֱHOUGH任,HOUGHӦ߱Ȼһ㣨,ȣ.ھʵʩ,轫HOUGHɢ,ÿһΪۼӵԪ,ÿۼӵԪཻ߸Ϊۼ.
2.2 ַ
(1 HOUGHֱ.ڹ߼,HOUGHķֱѡȡֱӰĽ.ĲõķֱΪ1.ѱַߴ,ļʹߵĲֲ,Сļʹͬһֳַɶ.ѡΪֲַߴĺ,ڹ߼ǰóߴδ֪,,Ĳȫַߴۺƽֵ,ߴѡΪָhַδ֪,ָΪַߴ磩.ĵ,ѡΪ0.20.4*hЧϺ.
(2 ԸHOUGH任.Ϊַдϰ,ȡǶȱ仯ΧΪ0㡫180.
(3 ͳɳӣƽַߴ.ͳƵĴȴСԭ,ȡۼۼӵԪ,ҪΪ˱⽻湲ַĶʧ2.ƽַߴΪ˽һָͬһϵַ.
(4 ַ鲢ַ.òֻǼ򵥵ؼ㹲ߵԪַ.
(5 HOUGH.ѾַHOUGHɾ,һѭظͳ.
2.3 HOUGHռȷ
HOUGHռĴ洢Ҫɦ,ά.ѡΪ180,,ҪʵѡȡѵķΧ,Ҳǻæѵֵ,ӶҪڴ.
ʽ1ΪHOUGH任Ļʽ,Уx,yΪĳֱ.ǵԱΪ:֪ʽ1еx,yȡֵΧͦȵļֵ,ѵֵ.
ͨ,Ϊcosȡ1,sinȡ1,
maxl=(xmax+ymax)R,2

һȽϴԵĹ.ͼֽϴʱ,ռȻܴ.ǲöԪʽֵķ,õһΪȷֵ,ʽ3,
3

Rʾѵķֱ.
Ƚ,ʽ3ļʽ2ĽС1.,xmax=ymaxʱ,. ԽԼռǺЧ.
2.4 ɳڹ
ַеߴλõĸ,ͳƵۼӵԪľۼ©ַеĳЩַ.úʵķֱR,ʹ߾һĶ̬Χ,Ƕ±Ĵǲ.ʵ,ͬһַַʹǾۼͬһۼӵԪ,ڵԪһڦҲڵ.Ϊ,ۼӵԪͳƿԲýڵۼӵԪϲķ,ͳƵɳ.ĵǣҵһɳӦ,֦Ѳ,ȵĶ̬Χ{1-/2*,1+/2*}.,ֱԽ,̬ΧԽС,˦Ӧ,߶̬Χ;ַƽ߶Ƚϴ,ҲӦӦ.ĿɷֱRַƽ߶hĺ:
=hR,4

Цϵ,=11.5.õ.
ɳڹߴ,ԽϺõش±ꡢŵַ鲢.
2.5 ַHOUGH
ף2ַȡ,ȳ̵ԭ,ĿǷֹȡ.ͬһͼֽ,ַгж,˳ǳҪ.ӱһ.
ͼ4Կ,ַֽͬʱ,Ǵ,thres+mܽȡ.ཻ֮ĺַеmҲȡ,determinedֽʶdeterined,ȻúԽһЩ,ȴַķ,ͿԱ.,,ԲôӴСɸѡĲ.:趨ֵ,Ȼ1,ȴ,̴.


ͼ4 HOUGH˳Ӱ
ʵʩһ㷨Ĺ,ע⵽һµ,ͼ4ʾִthre4ַ,һַγֶʽʱ,ڶηַۼʱַַ.,ȳ̵ԭ,ȡһַe.,ȳ̵ԭ򻹲,нһ޶.
,ΪַСΪ޶Ƿǳʵ.Ҳ˵,ǵõһ㹻Ĺ,ֽΪַ,ֻбַֽȷ޶ʱ,ַſԱȡ.
ʵʩڳֵָĹ,ٴRthreshold,ַĳȴRthresholdʱ,ȡ.ַжϲýڼⷽ,ݾֲָж.һַ,оַͨ,ýڼ⽫ᵽһַeָֻһַeĴ,Ȳȡ,֤˽ȷ.
ȳ̵ļⷽڵһǶַĴ.ַһصǣɶ,ַͨͳʱ,ʱһַͨ൱һӢַͨ,˱Ȼ.磬ĵַe,滻ΪַС,һӢĴlongͨ4൱,ȫȱȡ.ĵķ:ͳַַͨԹ鲢,ͨͨλȷַ,Ӷַͳƽ,γȷַ,ʹȡ˳ȷ.
3 
SegCharܹЧؽͼеͼβַ,ֺͼηֱд洢.ַ,ȡСַⷽ,Ҳĸ.ܹȡַʶӦַ,ַλϢϢغͳߴϢԼַϢ;ʶ洢ṹ,Էʵֽɾ,ûԷָҪ.УַĹ׼ȷ̶ȸ,½Ǳꡢ,ɶɵַ⴦õ,ܽϺõش͵iԼеĵ㻮.
SegCharCԱ,UNIXվʵ,ܽϺ,Խǿ.ṩԶֵµķȷʼٶָ.ȷʲͼճַ.ַճĴ,ѾṩһԶ,ڴͼ,ЧдĽ,,ùδ.Զͼʶԣַָƽȷʿɴ94%.ͼ5ʾԭϵͳָһ,ϽбַR2.5Ҳȷָ,ҵõӦķ.ͼΪʾ,԰ַռο򻭳.


ͼ5 ַָ
SegCharļٶһ̨SGI IndyϽв.ҪָΪCPU:MIPS R4600, 132MHz; RAM:32MB.ͼľֲͼ1ʾ.ͼСΪ44203836 pixles(300dpi,374.65328.87mm2);ַ156;ַ55;ʱΪ12s.öͼĲԱ,ַٲӰٶȵҪ,ͼĳߴ綼ž.˿,һA0ߴͼԼҪ96s,ʵڴֵ.һѡΪ10001000pixelsĴڴСͼ費1s.,SegCharЧһҪ.
4 
ͼֲֽ㴦һ.ʹַͼεķָ.ΪӦͼַָֽص,ĲԵϵһ״,ЧַԶֵָ.ڲHOUGH任ַʵ,˾ȷHOUGHռɳڹߡַHOUGHµȼ,ʹַָĴٶߣڴЧͣԸ,ӶγʵùSegChar.
*оõҡ塱ƼĿйʿ.
߼顡,1965,ʿ,,ҪоΪͼͼδ,CAD/CAMؼ.
,1955,ʿ,ʿʦ,ҪоΪֲʽýϢ,ͼͼδ,Э鹤.
,1970,ʦ,ҪоΪͼֽԶ봦.
ϵ:, 110006,ѧ308
ߵλѧ  110006
ο
1Wang P S P, Bunke H. Handbook on Optical Character Recognition and Document Image Analysis. Singapore: World Scientific Publishing Company, 1996
2Fletcher L A, Kasturi R. A robust algorithm for text string separation from mixed text/graphics images. IEEE Transactions on PAMI, 1988,10(6):910918
3Oliver L. Automatic indexing of line drawings for content based information retrieval Ph.D. Thesis. ETH No. 11870, Dipl. Informatik-Ing. ETH. 1996
4Filipski A J, Flandrena R. Automated conversion of engineering drawings to CAD form. Proceedings of IEEE, 1992,80(7):11951209
5Žǿ,,ĵ.ͼֽϵַȡʶϵͳ.,1995,21(1):6265
Du Jian-qiang, Chen Yue-lin, Liu Shao-mei et al. A system for character extraction of engineering drawings. Computer Engineering, 1995,21(1):6265
6½,޲,κС.ɨͼһͼķ뷽.:̷.ͼѧ̽ʵ.:㽭ѧ,1994.340343
(Chen Jian-guo, Luo Bo-peng, Wei Xiao-peng et al. A new method for text/graphics segmentation of scanning images. In: Tan Jiang-rong ed. Exploring and Practice of Computer Engineering Drawings. Hangzhou: Zhejiang University Press, 1994. 340343)
7Fan K, Lu J M, Wang L S et al. Extraction of characters from form documents by feature point clustering. Pattern Recognition Letters, 1995,16(9):963970
8,,.һֿɽɾĵĶֵͼͨʶоʵ.ѧѧȻѧ棩,1998,193:251254
(Jiang Zao, Liu Ji-ren, Wang Dong et al. Study and implementation of a fast interactive modifiable method for connected component labeling of binary image. Journal of Northeastern University (Natural Science edition), 1998,19(3):251254)
9.ͳ.:ѧԺ,1988
(Wang Shu-qin. Theory of Probability and Statistics. Shenyang: Northeastern University Press, 1988)
1997-10-20յԭ,1998-09-02յ޸ĸ
