Barcode character defect detection method based on Tesseract-OCR

With the continuous development of information technology, the applications of barcode have become more and more widely, and its quality requirements are also increasing. Due to the poverty typography and printing equipment, and the imperfect printing technology, there are a lot of problems such as flying ink, missing printed, wrong print, black spots and improper registration existing in the process of barcode printing. The traditional way of manually sorting defective barcode is not only inefficient but also easily influenced by many factors, which leads to the low precision of the detection. In order to solve these problems, this paper proposes a method of barcode defect detection based on Tesseract-OCR, firstly, the method uses the horizontal projection method to segment the barcode, and then it uses the Tesseract-OCR method to recognize the characters in the barcode, lastly, it combines Levenshtein Distance algorithm to detect the character defects. In this paper, 1000 barcode images were used to the experiment, and the experimental results show that the accuracy of detection results can reach 94.3%, which proves the feasibility of the method.