计算机应用 ›› 2010, Vol. 30 ›› Issue (05): 1246-1250.

• 模式识别 • 上一篇    下一篇

利用提取边缘线的方法定位条形码

吴忻生1,邓军2   

  1. 1.
    2. 华南理工大学
  • 收稿日期:2009-11-06 修回日期:2010-01-03 发布日期:2010-05-04 出版日期:2010-05-01
  • 通讯作者: 邓军
  • 基金资助:
    国家自然科学基金资助项目

Bar code localization by extracting edge lines

  • Received:2009-11-06 Revised:2010-01-03 Online:2010-05-04 Published:2010-05-01

摘要: 为解决基于图像处理方式识别条形码的问题,提出了利用图像边缘线来有效且快速定位条形码的方法。该方法首先用大津法对原始灰度图像获得一个阈值,并对图像中灰度小于此阈值的像素进行隔行隔列处理,提取边缘线。然后将图像分割成大小相等的水平条,依据质心的位置和水平条中边缘点的数量分布确定起始条。通过已知的离散直线中小阶梯最下端的边缘点来拟合直线,并得到直线倾斜角度。仿真实验比较了Sobel算子边缘检测方法和该方法提取边缘线,以及用检测直线的Hough变换方法和该方法进行直线拟合的处理效果和运行时间,结果表明了所提出算法的有效性、快速性和可靠性。

关键词: 边缘线, 条形码, 条形码定位, 阈值, 大津法, 直线检测

Abstract: Concerning the problems of recognizing bar code using image processing method, an effective and rapid algorithm was proposed to localize bar code through extracting edge lines. In this algorithm, a threshold value was obtained firstly by Otsu binary method from the original gray-level image. Pixels with gray values smaller than the threshold value were considered. The edge lines were extracted by sequential interlaced scanning in both row and column directions. Then the whole image was divided into strips of the same size. A starting strip was determined according to the position of the center point and the number of edge points distributed in strips. In starting strip, lines were detected by using edge points in the bottom of small ladder of a digital line, and angles of these lines were computed. Simulation compared the effect and running time of Sobel edge detector, Hough transformation, and the proposed algorithm. And the results prove the validity, rapidity and reliability of the proposed algorithm.

Key words: edge line, bar code, bar code localization, threshold, Otsu method, line detection