分析了EAN-13条形码的编码和译码方法,基于VC++平台设计并实现了条形码识别系统。主要包括两大部分:第一,对条形码图像的预处理操作。首先对条形码图像进行中值滤波和膨胀操作,可以确保条形码图像中直线的连通;然后再对图像进行腐蚀和均值滤波操作,这样可以进一步消除图像中一些非条形码背景的干扰和影响,使其易于之后进行的译码识别;第二,对预处理后的图像进行译码识别,其思想是利用相似边距离来判别条形码字符的相似度,再通过译码并最终得到条形码图像所代表的数字信息。实验结果表明:该EAN-13条形码识别方法可以有效地解决条码印刷模糊、轻微变形等问题,识别效果较好。
Encoding and decoding methods for EAN-13 bar code are analyzed in this paper. Design and implement a bar code recognition system based on VC++including two processing steps. The first step is to preprocess bar code image. Firstly,median filtering and dilation operation are adopted to make sure the line image is continuous. Then,erosion operation and mean filtering are used to clear clutter back-grounds. The second step is to decode the notation of preprocessed bar code image. Firstly,locate the bar code by computing distance of similar edges and then recognize the bar code by decoding and checking methods. The experimental results show that bar code recognition system developed resolves the problems of poor printing quality and a little distortion effectively.