System for decoding two dimensional code and method thereof
First Claim
1. A method for decoding a two dimensional code,the method comprising:
- performing a binarization process on a two dimensional code image to obtain a binary image, the binarization process comprising;
dividing the two dimensional code image into a plurality of block regions;
obtaining grayscale values of all pixels in each block region, and obtaining a grayscale value for each block region according to the grayscale values of all the pixels;
determining, a grayscale threshold for each block region according to an average grayscale value of a predetermined area where the block region locates;
binarizing pixels in the block region to obtain a binary image, according to a grayscale threshold corresponding to each block region;
decoding the binary image to obtain information content contained in the two dimensional code;
wherein the binarization process further comprises;
constructing a contrast factor according to the relationship between grayscale values of pixels in the two dimensional code image, wherein the contrast factor is proportional to the difference between a maximum grayscale value and a minimum grayscale value of the two dimensional code image;
the step of obtaining grayscale values of all pixels in each block region, and obtaining a grayscale value for each block region according to the grayscale values of all the pixels comprises;
determining a grayscale value for a block region, according to the relationship between the contrast factor and the difference between a maximum grayscale value and a minimum grayscale value in the block region, in conjunction with grayscale values of other block regions adjacent to the block region;
wherein determining a grayscale value for a block region according to the relationship between the contrast factor and the difference between a maximum grayscale value and a minimum grayscale value in the block region, in conjunction with grayscale values of other block regions adjacent to the block region, a grayscale value yij is obtained for a block region (i,j) according to the following equation;
1 Assignment
0 Petitions
Accused Products
Abstract
Method and system for decoding a two dimensional code is disclosed. In the binarization process of a two dimensional code image, through performing a dividing operation on the two dimensional code image, each block region has a different grayscale threshold. For each block region, whether a pixel in the block region is determined as black or white is not solely based on the grayscale value of the pixel itself, but also an average grayscale value of a predetermined area set for the block region where the pixel locates. When the predetermined area in which the block region locates has a larger grayscale value as a whole, the grayscale threshold corresponding to the block region may become larger, and vice versa.
11 Citations
31 Claims
-
1. A method for decoding a two dimensional code,
the method comprising: -
performing a binarization process on a two dimensional code image to obtain a binary image, the binarization process comprising; dividing the two dimensional code image into a plurality of block regions; obtaining grayscale values of all pixels in each block region, and obtaining a grayscale value for each block region according to the grayscale values of all the pixels; determining, a grayscale threshold for each block region according to an average grayscale value of a predetermined area where the block region locates; binarizing pixels in the block region to obtain a binary image, according to a grayscale threshold corresponding to each block region; decoding the binary image to obtain information content contained in the two dimensional code; wherein the binarization process further comprises; constructing a contrast factor according to the relationship between grayscale values of pixels in the two dimensional code image, wherein the contrast factor is proportional to the difference between a maximum grayscale value and a minimum grayscale value of the two dimensional code image; the step of obtaining grayscale values of all pixels in each block region, and obtaining a grayscale value for each block region according to the grayscale values of all the pixels comprises; determining a grayscale value for a block region, according to the relationship between the contrast factor and the difference between a maximum grayscale value and a minimum grayscale value in the block region, in conjunction with grayscale values of other block regions adjacent to the block region; wherein determining a grayscale value for a block region according to the relationship between the contrast factor and the difference between a maximum grayscale value and a minimum grayscale value in the block region, in conjunction with grayscale values of other block regions adjacent to the block region, a grayscale value yij is obtained for a block region (i,j) according to the following equation; - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A system for decoding a two dimensional code, the system comprising:
-
a binarization module for performing a binarization process on a two dimensional code image to obtain a binary image, further comprising; a dividing unit for dividing the two dimensional code image into a plurality of block regions; a grayscale value obtaining unit for obtaining grayscale values of all pixels in each block region, and obtaining a grayscale value for each block region according to the grayscale values of all the pixels; a grayscale threshold obtaining unit for determining, a grayscale threshold for each block region according to an average grayscale value of a predetermined area where the block region locates; a binary image obtaining unit for binarizing pixels in the block region to obtain a binary image, according to a grayscale threshold corresponding to each block region; a decoding module for decoding the binary image to obtain information content contained in the two dimensional code; wherein the binarization module further comprises; a contrast factor construction module for constructing a contrast factor according to the relationship between grayscale values of pixels in the two dimensional code image, wherein the contrast factor is proportional to the difference between a maximum grayscale value and a minimum grayscale value of the two dimensional code image; wherein the grayscale value obtaining unit is further configured to determine a grayscale value for a block region, according to the relationship between the contrast factor and the difference between a maximum grayscale value and a minimum grayscale value in the block region, in conjunction with grayscale values of other block regions adjacent to the block region; wherein the contrast factor construction module obtains a grayscale value yij for a block region (i,j) in according to the following equation; - View Dependent Claims (17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
-
-
31. A system for decoding two dimensional code, the system comprising;
-
a processor, the processor is configured to performing a binarization process on a two dimensional code image to obtain a binary image, the binarization process comprising; dividing the two dimensional code image into a plurality of block regions; obtaining grayscale values of all pixels in each block region, and obtaining a grayscale value for each block region according to the grayscale values of all the pixels; determining, a grayscale threshold for each block region according to an average grayscale value of a predetermined area where the block region locates; binarizing pixels in the block region to obtain a binary image, according to a grayscale threshold corresponding to each block region; decoding the binary image to obtain information content contained in the two dimensional code; wherein the binarization module further comprises; a contrast factor construction module for constructing a contrast factor according to the relationship between grayscale values of pixels in the two dimensional code image, wherein the contrast factor is proportional to the difference between a maximum grayscale value and a minimum grayscale value of the two dimensional code image; wherein the grayscale value obtaining is further configured to determine a grayscale value for a block region, according to the relationship between the contrast factor and the difference between a maximum grayscale value and a minimum grayscale value in the block region, in conjunction with grayscale values of other block regions adjacent to the block region; wherein the contrast factor construction module obtains a grayscale value yij for a block region (i,j) in according to the following equation;
-
Specification