馬欣欣 李小平
關鍵詞: 集裝箱箱號; 字符識別; 加權模板匹配法; 字符結構; 權值分配模板; 字符定位
中圖分類號: TN919.3+2?34; TP391.41 ? ? ? ? ? ? 文獻標識碼: A ? ? ? ? ? ? ? ?文章編號: 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 ?引 ?言
目前,在字符識別領域,國內外大量學者在此領域進行了大量的研究:賈婧等提出基于輪廓結構和統計特征的字符識別研究方法[1];沈清波等提出基于字符特征疊加提取與BP神經網絡的字符識別研究方法[2];羅輝武等提出基于結構特征和灰度特征的字符識別方法[3];吳曉軍等提出基于邊緣幾何特征的高性能模板匹配算法[4]。基于以上文獻,在傳統模板匹配的基礎上,本文提出基于數學形態的加權模板匹配法和字符結構特征相結合的字符識別方法。
1 ?基于數學形態的加權模板匹配和字符結構特征相結合的識別方法
數學形態的加權模板匹配是在對圖片進行數學形態處理的基礎上,對標準模板和歸一化后的樣本模板同時進行特征模板加權改造,予以模板中的字符筆畫不同的權值,最后通過模板庫字符與目標字符進行對比實現識別。在此基礎上,可以最大程度地降低字符周圍以及內部噪聲點的影響。字符結構特征法是通過提取字符筆畫實現識別的[5],可以進一步提高識別的準確率。具體的流程如圖1所示。
1.1 ?數學形態法
數學形態法是一種非線性濾波方法[6]。數學形態法的開運算能夠清除小于結構元素的噪聲點,去除孤立的小點、毛刺,連接兩連通區域的小橋和保持總的位置及形狀不變;閉運算能夠填補小于結構元素細節部分,可以填平小孔、彌補小裂縫。所以可以利用閉運算來使字符邊緣粘連,利用開運算來消除字符邊緣噪聲[7]。
1.1.1 ?數學形態的加權模板匹配
因為集裝箱字符邊緣分布相對比較集中,一般在對其進行閉運算處理后,很容易形成塊狀區域,所以選擇小的結構元素來去除這些孤立噪聲點。對于橫向噪聲點的去除,主要是通過橫向線性結構元素使每個字符邊緣橫向連接,最后用開運算去除噪聲[8]。同理,豎向噪聲的去除和橫向噪聲的去除類似。
1.1.2 ?結構相似字符分類
模板匹配法主要通過公式(1)計算兩者的相似度[8]。這種方法實際上只考慮到了標準模板和樣本模板之間標準差的不同,最后用最小的方差來判斷兩者的相似度,對噪聲點少的字符較為適用。