Patent Document ID: 8590794
Application ID: 13802591
Patent Status: 1

Claim One:
1. A barcode recognition method, used to recognize values of a plurality of barcode data of a plurality of barcode patterns, wherein the barcode patterns are located in a barcode image and the barcode recognition method comprises: providing a plurality of barcode template images, wherein the barcode template image comprises a plurality of barcode template patterns, and the barcode template patterns having a plurality of blank area patterns, and positions of the blank area patterns are different from each other to enable the barcode template patterns correspond to a plurality of different barcode alignment modes in a one to one manner, and each of the barcode template patterns has a plurality of data boundary patterns and at least one data space template patterns; performing a foreground extraction step for extracting a foreground image from the barcode image, wherein the foreground extraction step performs a binarization process on the barcode image; performing a pre-alignment processing step comprising: performing a single barcode finding step by using a connected component labeling (CCL) algorithm and a template geometric condition of a frame template pattern to find at least one single barcode pattern in the foreground image, wherein the frame template pattern is in a frame template image, and the frame template pattern is a frame pattern of one of the barcode template patterns; selecting a target binary barcode pattern from the at least one single barcode pattern; extracting an image of the target binary barcode pattern from the foreground image; performing a rotation angle calculating step for calculating a value of a rotation angle between an alignment direction of the target binary barcode pattern and an alignment direction of the frame template pattern; performing a rotating step for rotating the frame template pattern for the value of the rotation angle with respect to a center point of the frame template pattern as a center to obtain a rotated frame template pattern and a rotated frame template image, wherein the rotated frame template pattern is in the rotated frame template image; extracting a target barcode image from the barcode image in accordance with the position of target binary barcode pattern in the foreground image, wherein the target barcode image comprises a target barcode pattern corresponding to the target binary barcode pattern; and performing a correction step for correcting the target barcode pattern of the target barcode image in accordance with a plurality of corner coordinates of the rotated frame template pattern, a center coordinate of the rotated frame template pattern, and the value of rotation angle to obtain a corrected target barcode pattern and a corrected target barcode image, wherein the corrected target barcode pattern is in the corrected target barcode image, and an alignment direction and size of the corrected target barcode pattern are the same as those of the frame template pattern; performing an alignment step, comprising: performing a binarization process on the corrected target barcode image to obtain a corrected binary target barcode image, wherein the corrected binary target barcode image comprises a corrected binary target barcode pattern; finding a plurality of data boundary patterns of the corrected binary target barcode pattern by using the data boundary patterns of the one of the barcode template patterns and the connected component labeling algorithm; performing a validity determination step for determining if a geometric condition of each of the data boundary patterns of the corrected binary target barcode pattern matches a first predetermined geometric requirement to provide a first determination result; when the first determination result is yes, a value of a center coordinate of the corrected binary target barcode pattern is calculated in accordance with coordinates of the data boundary patterns of the corrected binary target barcode pattern; calculating a shift vector in accordance with a value of the center coordinate of the rotated frame template pattern and the value of the center coordinate of the corrected binary target barcode pattern; moving the corrected binary target barcode pattern in the corrected binary target barcode image in accordance with the shift vector to obtain a shifted target barcode pattern, wherein the shifted target barcode pattern comprises a plurality of shifted data boundary patterns and a plurality of shifted data space patterns; defining a plurality of first virtual areas on the shifted target barcode pattern in accordance with values of coordinates of the blank area patterns of the barcode template patterns; selecting a maximum background area from the first virtual areas, wherein the maximum background area is one of the first virtual areas and has a biggest background area; performing an alignment mode determination step for selecting a matched pattern from the barcode template patterns in accordance with the position of the maximum background area; defining at least one second virtual area on the shifted target barcode pattern in accordance with a value of a coordinate of at least one of data space pattern of the matched pattern; performing a data area checking step for determining if the second virtual areas are the at least one data space pattern of the shifted target barcode pattern to provide a second determination result; and defining a plurality of value data areas on the shifted target barcode pattern in accordance with the at least one data space pattern and the data boundary pattern of the shifted target barcode pattern, when the second determination result is yes; and performing a barcode value recognition step for recognizing values of the target binary barcode pattern in accordance with patterns in the value data areas.