










摘" 要: 為了解決復(fù)雜背景下條形碼不易定位識(shí)別的難題,提出一種基于Hough變換和深度學(xué)習(xí)相結(jié)合的方法對(duì)條形碼進(jìn)行校正定位。首先對(duì)待檢測(cè)圖像進(jìn)行灰度化、高斯模糊以及邊緣檢測(cè)等預(yù)處理;然后利用Hough變換檢測(cè)條形碼圖像中的線段,進(jìn)行旋轉(zhuǎn)校正,校正后的圖像經(jīng)Yolov5對(duì)條形碼進(jìn)行識(shí)別和提取,完成條形碼的識(shí)別分割。文中方法對(duì)不同樣式條形碼均有較好的識(shí)別效果,旋轉(zhuǎn)校正的精確度達(dá)到99.31%,識(shí)別平均精確度達(dá)到99.40%,召回率達(dá)到99.79%,推理時(shí)間為10.5 ms。提出的方法可對(duì)任意角度傾斜進(jìn)行校正,識(shí)別條碼具有較高的準(zhǔn)確率,對(duì)條形碼定位識(shí)別具有一定的應(yīng)用價(jià)值。
關(guān)鍵詞: Hough變換; Yolov5; 傾斜校正; 條碼識(shí)別; 圖像處理; 機(jī)器視覺
中圖分類號(hào): TN911.73?34; TP391.41" " " " " " " " "文獻(xiàn)標(biāo)識(shí)碼: A" " " " " " " " "文章編號(hào): 1004?373X(2025)01?0157?06
Barcode recognition based on Hough transform and deep learning
QU Yuanhao, ZHANG Fengshou, CHANG Jibao, FENG Ruibo
(School of Mechanical Engineering, Henan University of Science and Technology, Luoyang 471003, China)
Abstract: In order to cope with the difficulties in the recognition of barcodes in complex background, a recognition method is proposed to carry out the barcode correction and positioning based on the combination of Hough transform and deep learning. The images to be detected are subjected to preprocessing, including gray processing, Gaussian blurring and edge detecting. And then, Hough transform is used to detect the line segments in the barcode image for rotation correction. The barcode image is recognized and extracted by Yolov5 to fulfill the barcode recognition and segmentation. The proposed method has a good recognition effect on different types of barcodes. The accuracy rate of rotation correction of the method is 99.31%, its average accuracy of recognition is 99.40%, its recall rate is 99.79%, and its reasoning time is 10.5 ms. The proposed method can correct any angle inclination, and has high accuracy rate for barcode recognition, so it has a certain application value for barcode location recognition.
Keywords: Hough transform; Yolov5; inclination correction; barcode recognition; image processing; machine vision
0" 引" 言
隨著現(xiàn)代商業(yè)的發(fā)展,條形碼技術(shù)[1]已成為商品追蹤和管理的重要工具。然而傳統(tǒng)的條形碼識(shí)別方法在面對(duì)復(fù)雜背景、旋轉(zhuǎn)變形等挑戰(zhàn)時(shí)表現(xiàn)不佳,因此研究復(fù)雜場(chǎng)景中條形碼的識(shí)別具有很強(qiáng)的現(xiàn)實(shí)意義。本文旨在結(jié)合Hough變換和深度學(xué)習(xí)技術(shù),提出一種條形碼識(shí)別方法,以提高識(shí)別準(zhǔn)確率和效率。
目前常見的條形碼識(shí)別方法是用圖像處理的方法進(jìn)行條形碼的定位,然后再對(duì)其進(jìn)行解碼。文獻(xiàn)[2]提出了一種基于顏色和形狀特征的條形碼快速檢測(cè)方法,以適應(yīng)復(fù)雜場(chǎng)景下的多目標(biāo)、多角度條形碼快速識(shí)別,但當(dāng)包含條形碼的快遞面單與背景顏色相近時(shí),無法取得良好的識(shí)別效果。……