提出一种基于三重编码的图像式一维条码快速识别算法。首先采用最大类间方差法对图像进行二值化分割,将条码从背景中分离出来。对分离出的条码图像实施倾斜校正,然后通过分析二值图像的竖直方向投影特性,建立三重编码,依次为0-1码、类行程码和条空码(条空码根据条码类型进行编码)。最后由条空码进行查表和校验。识别过程能够对噪声、不齐、缺损和污染等缺陷进行有效处理。应用结果表明,该算法正确识别率达到99%以上,执行时间仅5ms左右。
A fast recognition algorithm based on tri-encoding method for one-dimension barcode was presented. First, the image was threshold by OTSU method and the barcode area was separated from the background. Then by analyzing projection characters of the binary image, tri-encoding including 0-1 encoding, similar running length encoding and strip-space encoding was established step by step. Finally, barcodes were found and verified by using table look-up technique from the code table. The procedure of the recognition can strongly handle several kinds of drawbacks like noise, irregularity, deficiency and contamination. Application results show that the correct recognition rate is higher than 99% and the average recognition time is about 5 ms.