馬欣欣 李小平
關(guān)鍵詞: 集裝箱箱號(hào); 字符識(shí)別; 加權(quán)模板匹配法; 字符結(jié)構(gòu); 權(quán)值分配模板; 字符定位
中圖分類號(hào): TN919.3+2?34; TP391.41 ? ? ? ? ? ? 文獻(xiàn)標(biāo)識(shí)碼: A ? ? ? ? ? ? ? ?文章編號(hào): 1004?373X(2019)14?0131?04
Research on key technologies for character recognition of container numbers
MA Xinxin, LI Xiaoping
(School of Mechanical Engineering, Lanzhou Jiaotong University, Lanzhou 730000, China)
Abstract: Taking the recognition of container numbers as the research object, the accurate recognition of container numbers is realized on the basis of preprocessing and positioning of the existing container pictures. Various key factors affecting character recognition are mainly discussed. A new recognition method by combining the weighted template matching method with character structure is proposed on the basis of traditional template matching. In the method, it is not to use a unified template to conduct matching recognition of 36 characters. Instead, the characters are classified according to character structures, and each class is assigned a different weight assignment template. Character structure recognition is a kind of secondary recognition. The combination of the two methods can realize the recognition of broken, glued, and slanted characters. The effectiveness of the method is proved by means of theoretical analysis and experiment. The problems that need further study are given.
Keywords: container number; character recognition; weighted template matching method; character structure; weight assignment template; character positioning
0 ?引 ?言
目前,在字符識(shí)別領(lǐng)域,國內(nèi)外大量學(xué)者在此領(lǐng)域進(jìn)行了大量的研究:賈婧等提出基于輪廓結(jié)構(gòu)和統(tǒng)計(jì)特征的字符識(shí)別研究方法[1];沈清波等提出基于字符特征疊加提取與BP神經(jīng)網(wǎng)絡(luò)的字符識(shí)別研究方法[2];羅輝武等提出基于結(jié)構(gòu)特征和灰度特征的字符識(shí)別方法[3];吳曉軍等提出基于邊緣幾何特征的高性能模板匹配算法[4]。基于以上文獻(xiàn),在傳統(tǒng)模板匹配的基礎(chǔ)上,本文提出基于數(shù)學(xué)形態(tài)的加權(quán)模板匹配法和字符結(jié)構(gòu)特征相結(jié)合的字符識(shí)別方法。
1 ?基于數(shù)學(xué)形態(tài)的加權(quán)模板匹配和字符結(jié)構(gòu)特征相結(jié)合的識(shí)別方法
數(shù)學(xué)形態(tài)的加權(quán)模板匹配是在對(duì)圖片進(jìn)行數(shù)學(xué)形態(tài)處理的基礎(chǔ)上,對(duì)標(biāo)準(zhǔn)模板和歸一化后的樣本模板同時(shí)進(jìn)行特征模板加權(quán)改造,予以模板中的字符筆畫不同的權(quán)值,最后通過模板庫字符與目標(biāo)字符進(jìn)行對(duì)比實(shí)現(xiàn)識(shí)別。在此基礎(chǔ)上,可以最大程度地降低字符周圍以及內(nèi)部噪聲點(diǎn)的影響。字符結(jié)構(gòu)特征法是通過提取字符筆畫實(shí)現(xiàn)識(shí)別的[5],可以進(jìn)一步提高識(shí)別的準(zhǔn)確率。具體的流程如圖1所示。
1.1 ?數(shù)學(xué)形態(tài)法
數(shù)學(xué)形態(tài)法是一種非線性濾波方法[6]。數(shù)學(xué)形態(tài)法的開運(yùn)算能夠清除小于結(jié)構(gòu)元素的噪聲點(diǎn),去除孤立的小點(diǎn)、毛刺,連接兩連通區(qū)域的小橋和保持總的位置及形狀不變;閉運(yùn)算能夠填補(bǔ)小于結(jié)構(gòu)元素細(xì)節(jié)部分,可以填平小孔、彌補(bǔ)小裂縫。所以可以利用閉運(yùn)算來使字符邊緣粘連,利用開運(yùn)算來消除字符邊緣噪聲[7]。
1.1.1 ?數(shù)學(xué)形態(tài)的加權(quán)模板匹配
因?yàn)榧b箱字符邊緣分布相對(duì)比較集中,一般在對(duì)其進(jìn)行閉運(yùn)算處理后,很容易形成塊狀區(qū)域,所以選擇小的結(jié)構(gòu)元素來去除這些孤立噪聲點(diǎn)。對(duì)于橫向噪聲點(diǎn)的去除,主要是通過橫向線性結(jié)構(gòu)元素使每個(gè)字符邊緣橫向連接,最后用開運(yùn)算去除噪聲[8]。同理,豎向噪聲的去除和橫向噪聲的去除類似。
1.1.2 ?結(jié)構(gòu)相似字符分類
模板匹配法主要通過公式(1)計(jì)算兩者的相似度[8]。這種方法實(shí)際上只考慮到了標(biāo)準(zhǔn)模板和樣本模板之間標(biāo)準(zhǔn)差的不同,最后用最小的方差來判斷兩者的相似度,對(duì)噪聲點(diǎn)少的字符較為適用。