CN101197004A - Two-dimension bar code and its coding and decoding method - Google Patents
Two-dimension bar code and its coding and decoding method Download PDFInfo
- Publication number
- CN101197004A CN101197004A CNA2007101253977A CN200710125397A CN101197004A CN 101197004 A CN101197004 A CN 101197004A CN A2007101253977 A CNA2007101253977 A CN A2007101253977A CN 200710125397 A CN200710125397 A CN 200710125397A CN 101197004 A CN101197004 A CN 101197004A
- Authority
- CN
- China
- Prior art keywords
- sign indicating
- indicating number
- macroblock
- speech
- code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
The present invention discloses a method for coding and decoding two-dimensional bar codes. The coding method comprises a data code word generating step, an error-correcting code word generating step, a main code pattern frame generating step and a code pattern image forming step through code word filling. The decoding method is that: a gray scale image of a code pattern is acquired through a digital photography mode; the gray value distribution of different pixels in the gray scale image is counted; a threshold value is determined; the gray scale image is converted into a binary image and an edge image is acquired; the four-corner coordinate of each macro block in the code pattern and the center coordinate of each unit module inside the macro blocks are calculated; the bit value stored by each unit module is determined so as to acquire a data code word matrix corresponding to the decoded code pattern; the data code word is read according to a correct center macro block and the code pattern direction; RS error-correcting algorithm is used to correct the errors in the code word according to a preset error-correcting grade; the data code word is output and recovered as a binary number.
Description
Technical field
The present invention relates to a kind of Code And Decode method of two-dimensional bar code.
Background technology
The matrix type two-dimension sign indicating number generally is made up of three parts: feature mode zone, format information zone, numeric data code speech zone.Wherein feature mode area guidance image recognition algorithm is discerned alignment code figure, and the descriptor code bitmap-format parameter relevant with correcting data error deposited in the format information zone, and deposit through the data behind the Error Correction of Coding algorithm coding in numeric data code speech zone.To a certain degree will cause yard figure not to be identified if feature mode zone is corrupted to the form information area, so these two zones also just become the fatal zone (vulnerable area) among yard figure, reduced the reliability of two-dimension code.
Be PDF417 code structure synoptic diagram as shown in Figure 1, the wide vertical line that does not carefully wait at the two ends, the left and right sides of sign indicating number figure is its feature mode zone 10, feature mode zone 10 at the two ends, the left and right sides of sign indicating number figure is its format information zone 20 with an interior part, if feature mode zone 10 is subjected to certain destruction with form information area 20, this yard figure can not be correctly validated.
Be QR sign indicating number (Quick Response Code) structural representation as shown in Figure 2, " returning " shape zone at two jiaos and bottom left comer place is its feature mode zone 30 about the top of sign indicating number figure, the part that near three angles of sign indicating number figure feature mode zone 30 goes out with interior with dashed lines frame is its format information zone 40, if feature mode zone 30 is subjected to certain destruction with form information area 40, this yard figure can not be correctly validated.
Summary of the invention
Technical matters to be solved by this invention is: it is destroyed easily and cause can not identification code figure and the not high shortcoming of reliability, efficient and precision of coding/decoding method to overcome bar code that existing two-dimensional bar code coding method obtains, and a kind of improved two-dimensional bar code and Code And Decode method thereof are provided.
The invention discloses a kind of two-dimensional bar code, has square font code figure, described sign indicating number figure be included in substrate surface continuously arranged, have a square shaped cells module of dark color and light optical signature respectively, described sign indicating number figure is divided into a plurality of macroblocks, and it all is that the white edge frame macroblock and one week of outermost of light unit module all is the black surround frame macroblock of dark unit module that described macroblock is included in one week of outermost of alternately arranging on the foursquare horizontal and vertical both direction.Described each macroblock comprises frame portion, sign indicating number speech part and level number position, and described sign indicating number speech comprises numeric data code speech and error correcting code speech.
Described frame portion is to be positioned at the macroblock outermost unit module in one week, and described level number position is the unit module that stores level number information, and the sign indicating number speech partly is that other stores the unit module of yard speech in this macroblock.
Preferably, described macroblock comprises N * N unit module, and N is 〉=3 natural number.
The macroblock on each limit of described sign indicating number figure has M at least, and M is 〉=1 odd number.
Described level number position is 4, lays respectively at 4 angles in the described frame module.
Described macroblock is according to by outwards clockwise or counterclockwise spiral arrangement of center, and from the center outwards successively layering and by the layer sub-clustering, every layer comprises a level number of being made up of 4 bits, its value is in 0111,0011 and 0,001 three, these three values are by layer cycle arrangement, the level number difference of adjacent cluster.
Preferably, the unit module number that comprises of described macroblock is that N is 6,7 or 8; Described macroblock comprises N * N unit module, and N is 6,7 or 8, and the sign indicating number speech length of its corresponding stored is respectively 6 bits, 7 bits or 8 bits, thereby each macroblock comprises integer number of data sign indicating number speech.
The invention also discloses a kind of coding method of two-dimensional bar code, may further comprise the steps:
The numeric data code speech generates step: cutting apart the binary number that is encoded is the numeric data code speech with specific binary bits length;
The error correcting code speech generates step: described numeric data code speech utilization RS error correction algorithm is generated the error correcting code speech;
Sign indicating number figure main frame generates step: the main frame of generated code figure, promptly generate the frame portion and the level number position of each macroblock, described frame portion is distributed in one week of outermost of macroblock, described level number position is distributed in four angles in the frame portion, store level number information, the other parts of described macroblock are sign indicating number speech storage area;
The sign indicating number speech is filled and to be obtained a yard figure image step: according to the sign indicating number speech storage area of outwards being filled described numeric data code speech and error correcting code speech each macroblock in the sign indicating number figure by the center with clockwise or counterclockwise spiral way, generated code figure image file, the i.e. storage order of sign indicating number speech that puts in order also of macroblock in this yard figure image.
Preferably, sign indicating number figure main frame generates level number information described in the step to be made up of four bits, is respectively in 0111,0011 and 0,001 three value.
Preferred again, described three values 0111,0011 and 0001 of being made up of four bits are by layer cycle arrangement, the value difference of adjacent layer.
The frame portion of described macroblock all is dark unit module or all is light unit module, is called black surround frame macroblock and white edge frame macroblock, and these two kinds of macroblocks are alternately arranged on the vertical and horizontal both direction of sign indicating number figure.
Preferably, the length of specific bit stream is 6 bits, 7 bits or 8 bits described in the numeric data code speech generation step; Described macroblock comprises N * N unit module, and N is 6,7 or 8, and the sign indicating number speech length of its corresponding stored is respectively 6 bits, 7 bits or 8 bits, thereby each macroblock comprises integer number of data sign indicating number speech.
Described sign indicating number figure main frame generates step can also comprise a step of determining sign indicating number figure size, promptly determines the main frame of regeneration sign indicating number figure after the size of sign indicating number figure according to the quantity of sign indicating number speech.
Described sign indicating number speech filling step can also comprise the step of the sign indicating number speech that forms new specific binary bits length, promptly earlier numeric data code speech and error correcting code speech is carried out the suitable sign indicating number speech that is combined to form new specific binary bits length, and then fills.
The invention also discloses a kind of coding/decoding method of two-dimensional bar code, decoding process is opposite with the coding flow process, before decoding, obtain the size of macroblock earlier, be the binary bits length of the sign indicating number speech of included unit module number of each macroblock and correspondence thereof, obtain the value and the unit module number of level number module in each macroblock simultaneously, the two-dimension code of the macroblock of decoding then.Decoding comprises the steps:
A. obtain the gray scale image of yard figure by the digital photographing mode;
B. add up the distribution of the gray-scale value of different pixels in the described gray scale image;
C. determining threshold value according to the distribution of gray-scale value and transform described gray scale image is bianry image;
D. the boundary pixel that detects described bianry image obtains boundary image;
E. obtain the straight-line equation group of the straight line in the described boundary image and find the solution the four angular coordinate that obtains each macroblock, or locate each macroblock and calculate its four angular coordinate by template matching algorithm;
F. obtain numeric data code speech matrix corresponding to decoded sign indicating number figure;
G. the level number information of being stored according to level number position in the macroblock is determined direction, initial code speech and each macroblock the position among sign indicating number figures of sign indicating number figure when being scanned, and obtains the predetermined error-correction level of sign indicating number figure according to the putting in order of three kinds of values of level number position;
H. the result who is obtained with step G is a foundation, according to correct center macroblock and sign indicating number figure direction reading of data sign indicating number speech and use mistake in the RS error correction algorithm correction code speech;
I. output data sign indicating number speech and restore data sign indicating number speech are binary number.
Among the described step B, adopt the statistics with histogram method to add up the distribution of the gray-scale value of different pixels in the described gray scale image.
The method of determining threshold value among the described step C is the bimodal method of histogram, the method that described conversion gray scale image is a bianry image is: cut apart described gray scale image and be not overlapping or partly overlapping a few part, add up the distribution of gray-scale value respectively, the gray-scale value of lap is averaged, and binaryzation also is combined in the various piece of binaryzation.
Among the described step D, as long as mark each up and down 4 pixels have the light pixel of a dark pixels and each up and down 4 pixels as long as the dark pixels of a light pixel is arranged is boundary pixel, adopt the Hough algorithm to obtain boundary image.
The four angular coordinate method of calculating each macroblock in the described step e is, the straight-line equation group of the straight line in the boundary image of obtaining step D is also found the solution the four angular coordinate that obtains each macroblock, perhaps locatees each macroblock and calculates its four angular coordinate by template matching algorithm according to the boundary image of step D.
Among the described step G, when the information bit of part macroblock disappearance, the statistics of the bit information of being stored by a plurality of level numbers position is determined its position in sign indicating number figure.
Preferably, among the described step G, also obtain the predetermined error-correction level of sign indicating number figure according to the putting in order of three kinds of values of level number position.
Preferred again, among the described step H, according to the mistake in the predetermined error-correction level utilization RS error correction algorithm correction code speech.
The method of obtaining among the described step G corresponding to the numeric data code speech matrix of decoded sign indicating number figure is: the centre coordinate that calculates each unit module in the macroblock according to the size of the four angular coordinate of macroblock and known unit module, bit value according to centre coordinate reading unit module stores from bianry image of each unit module of gained, perhaps by the bit value of the statistical value determining unit module stores of the pixel value around the unit module centre coordinate, thereby obtain the numeric data code speech matrix of decoded sign indicating number figure.
The invention has the beneficial effects as follows:
Because the coding method of this invention has generated the level number position of containing the level number information of being made up of four bits in four angles in the frame portion of each macroblock of sign indicating number figure image, so each macroblock is the direction of identification code figure separately, and then the convenient direction of determining sign indicating number figure, like this, even sign indicating number figure has the situation of part breakage, contaminated or distortion, also still can determine the direction of yard figure and smoothly decoding by other parts.
Because adopting length during coding is the bitstream length coding of 6 bits, 7 bits or 8 bits, described macroblock comprises N * N unit module simultaneously, N is 6,7 or 8, the sign indicating number speech length of its corresponding stored is respectively 6 bits, 7 bits or 8 bits, thereby each macroblock comprises integer number of data sign indicating number speech, make that two-dimension code is unit storage and transmission data with the sign indicating number speech, has improved the reliability of decoding.
Three of the level number position are worth employing by a layer cycle arrangement mode, according to different arrangement modes, can identify the error-correction level of yard figure, decode according to this grade of being scheduled to during convenient the decoding, thereby have improved error correction efficient and precision.Simultaneously, make that also the sign indicating number bitmap-format information that forms is simple, compare with the conventional two-dimensional sign indicating number and lacked the specific format information area that is hurt easily, therefore, improved resisting breakage, antipollution and the non-deformability of sign indicating number figure, promptly improved the reliability of sign indicating number figure.
Generate at sign indicating number figure and to pre-determine a yard figure size in the step, and then generated code figure, can make sign indicating number figure both can hold all yards speech, not too large again.
When sign indicating number speech quantity is many, can also in sign indicating number speech filling step, earlier numeric data code speech and error correcting code speech be carried out suitable combination, form the sign indicating number speech of new specific binary bits length, and then fill, can guarantee the corresponding macroblock of a sign indicating number speech, thereby with the sign indicating number speech is unit storage and transmission, improves precision and efficient.
Description of drawings
Fig. 1 is a PDF417 code structure synoptic diagram;
Fig. 2 is a QR code structure synoptic diagram;
Fig. 3 is the two-dimensional bar code sign indicating number figure of one embodiment of the invention;
Fig. 4 A, 4B are white edge frame macroblock and black surround frame macroblock synoptic diagram among the two-dimensional bar code sign indicating number figure of one embodiment of the invention;
Fig. 5 is a macroblock structural representation among the two-dimensional bar code sign indicating number figure of one embodiment of the invention;
Fig. 6 is a macroblock arrangement mode synoptic diagram among the two-dimensional bar code sign indicating number figure of one embodiment of the invention;
Fig. 7 is the two-dimensional bar code bunch distribution schematic diagram of one embodiment of the invention;
Fig. 8 is the level number synoptic diagram of the two-dimensional bar code of one embodiment of the invention;
Fig. 9 is the two-dimensional bar code coding process flow diagram of one embodiment of the invention;
Figure 10 is an embodiment bianry image synoptic diagram that utilizes coding/decoding method of the present invention to obtain;
Figure 11 utilizes coding/decoding method of the present invention that the bianry image of an embodiment is carried out the boundary image synoptic diagram that Boundary Detection obtains;
Figure 12 does the straight line design sketch that uses the Hough algorithm to obtain after the Boundary Detection to the boundary image of one embodiment of the invention;
Figure 13 is the synoptic diagram that one embodiment of the invention is tried to achieve the four angular coordinate of each macroblock;
Figure 14 A, 14B are the four jiao special graph patterns that may have of the sign indicating number figure of one embodiment of the invention at macroblock;
Figure 15 is the method synoptic diagram of the used definite threshold value of coding/decoding method of the present invention;
Embodiment
Contrast accompanying drawing and two-dimensional bar code of the present invention and decoding method thereof are described further below by specific embodiment.
As shown in Figure 3, be the two-dimensional bar code sign indicating number figure of the embodiment of the invention, it is included in white edge frame macroblock 501 and the black surround frame macroblock of alternately arranging on the horizontal and vertical both direction along square at substrate surface 502.
Shown in Fig. 4 A and Fig. 4 B, be the white edge frame macroblock of the embodiment of the invention and the synoptic diagram of black surround frame macroblock, both all are made up of 6 * 6 unit modules.
Be macroblock structural drawing among the two-dimensional bar code sign indicating number figure of one embodiment of the present of invention as shown in Figure 5, its every row has 6 unit modules, adds up to 36 unit modules; The frame portion 51 that its outermost makes a circle comprises 20 of unit modules, and the frame unit module comprises 12 of data cell modules with ISN speech storage area 52, and level number position 53 has 4.
Be macroblock arrangement mode synoptic diagram among the two-dimensional bar code sign indicating number figure of the embodiment of the invention as shown in Figure 6, dark module is a black surround frame module among the figure, the light color module is a white edge frame module, putting in order of macroblock represented that by the sequence number among the figure this also is yard order of speech storage (therefrom mind-set is outward by clockwise spiral arrangement); The mb number on each limit of sign indicating number figure is 5, and then this yard figure has 5 * 5 macroblocks.With the therefrom outer layering of mind-set of the macroblock among the sign indicating number figure, No. 1 module is a ground floor, and 2 to No. 9 macroblock is formed the second layer, and 10 to No. 25 macroblock is formed the 3rd floor.The sign indicating number figure of this embodiment has 3 layers of macroblock.
Definition ground floor macroblock is the 1st bunch, and second layer macroblock is the 2nd bunch, and the 3rd layer of macroblock is the 3rd bunch, and bunch number distribution of sign indicating number figure as shown in Figure 7.Level number is made up of 4 bits, it is available that level number one has three values, be respectively 0111,0011,0001, the macroblock level number of adjacent cluster must be inequality, shown in the level number synoptic diagram of two-dimensional bar code that Fig. 8 is the embodiment of the invention, can be used for distinguishing different bunches macroblock like this, identify the error-correction level of different bunches macroblock and sign indicating number figure by the cycle arrangement of three values, wherein white module represents 0, and the black module represents 1.
The sign regulation of error-correction level as shown in Table 1.
Table one
| Error-correction level | More than version 6 reaches | ||||||
| |
Cycle arrangement | ||||||
| Edition 4 | |||||||
| |
|||||||
| Version 2 | |||||||
| 1 | 0011 | 0001 | 0111 | 0011 | 0001 | 0111 | … |
| 2 | 0001 | 0111 | 0011 | 0001 | 0111 | 0011 | … |
| 3 | 0111 | 0001 | 0011 | 0111 | 0001 | 0011 | … |
| 4 | 0001 | 0011 | 0111 | 0001 | 0011 | 0111 | … |
| 5 | 0011 | 0111 | 0001 | 0011 | 0111 | 0001 | … |
GM sign indicating number (Grid Matrix Code) for version 1 is subjected to the restriction of level number quantity, can only represent 3 error-correction level, as shown in Table 2.
Table two
| Error- | Bunch | 1 level number | Bunch 2 level numbers |
| 2 | 0001 | 0111 | |
| 3 | 0111 | 0001 | |
| 4 | 0001 | 0011 |
As shown in Figure 9, be the two-dimensional bar code coding process flow diagram of the embodiment of the invention, be that example specifies decoding method of the present invention with the sign indicating number figure that macroblock is 5 * 5, each macroblock comprises 6 * 6 unit modules below.
At first raw data is converted to information data sign indicating number speech with 6 bits; Determine the size of yard figure again according to the quantity of numeric data code speech; Generate the error correcting code speech with the RS encryption algorithm then and be attached between the information data sign indicating number speech; The then main frame of generated code figure, i.e. the light unit module in one week of white edge frame macroblock outermost and the dark unit module in one week of black macroblock outermost, and 4 level number positions of each macroblock; Begin numeric data code speech and error correcting code speech to be filled into generated code speech part among yard figure by sign indicating number figure center again by the clockwise hand of spiral, so generated code figure image file, end-of-encode.
Decoding process is opposite with the coding flow process, before decoding, obtain the size of macroblock earlier, it is the bit number of the sign indicating number speech of included unit module number of each macroblock and correspondence thereof, obtain the value and the unit module number of level number module in each macroblock simultaneously, to present embodiment, macroblock is of a size of 6 * 6, and every kind of macroblock comprises the sign indicating number speech of 26 bits, and its concrete coding/decoding method is as follows:
1. use digital camera to obtain the gray scale image of yard figure by photographic means, the existence form of this picture signal in storer can be the picture element matrix that has comprised the gray-scale value of each pixel, and this gray scale image also can directly show on display;
2. the distribution of the gray-scale value of different pixels in the gray level image is added up, for example adopted statistics with histogram;
3. determine threshold value according to the distribution of the gray-scale value of different pixels, the gray scale image of sign indicating number figure is changed into bianry image.The method of determining threshold value can be the bimodal method of histogram, and as shown in figure 15, wherein peak value V1 represents dark module intensity profile center, and peak value V3 represents light module intensity profile center, and binary-state threshold V2 is between peak value V1 and peak value V3.Be the bianry image that utilizes the embodiment of coding/decoding method acquisition of the present invention as shown in figure 10, the value of all pixels shows as dark and light two kinds in the drawings;
4. above-mentioned bianry image is carried out Boundary Detection, to each light pixel, if as long as a dark pixels is arranged 4 pixels up and down of closing on most with it then this pixel is marked as boundary pixel.For dark pixels, if as long as a light pixel is arranged 4 pixels up and down of closing on most with it then this pixel is marked as boundary pixel.Be the boundary image synoptic diagram of the sign indicating number figure of the embodiment of the invention as shown in figure 11.
5. detect all straight lines in the above-mentioned boundary image, comprise continuously, and obtain the straight-line equation group with discontinuous.Because have white edge frame macroblock and the black surround frame macroblock of alternately arranging among the sign indicating number figure, so detected straight cuts goes out the separatrix of macroblock.Be the image utilization Hough algorithm detects straight line in boundary image shown in Figure 11 after as shown in figure 12.
6. separate the four angular coordinate that above-mentioned straight-line equation group is tried to achieve each macroblock, as shown in figure 13, calculate the centre coordinate of each unit module in the macroblock again according to the size utilization interpolation algorithm of the four angular coordinate of macroblock and known unit module, from bianry image, read the bit value (0 or 1) of this unit module storage according to the centre coordinate of unit module; The bit value of this unit module storage also can be determined by the statistical value of the pixel value around its centre coordinate.
7. obtain the location of each macroblock through above-mentioned steps, and then obtain numeric data code speech matrix corresponding to decoded sign indicating number figure.
8. judge the anglec of rotation of direction when scan code figure of decoded sign indicating number figure: in each macroblock, 4 information bits are all arranged, be distributed in 4 interior angles of macroblock, these 4 information bits have 0111,0011,0,001 three kind of filling mode, so each macroblock can identify the direction of two-dimensional code symbol separately, so can obtain the direction of symbol by 4 information bits that read macroblock; As fruit part macroblock information bit disappearance, can add up to determine the symbol direction by the directional information of a plurality of macroblocks, thereby obtain the anglec of rotation of direction when scan code figure of decoded yard figure.
9. be foundation with top result of calculation, and according to correct center macroblock (definite method of center macroblock is the 13rd page the 3rd section in 200410022052.5 an application for a patent for invention instructions with application number, it mainly determines the numeric data code speech of center macroblock by the symmetric relation of the above numeric data code speech matrix that obtains, thereby determines the center macroblock.) and the direction reading of data sign indicating number speech of sign indicating number figure, use the RS error correction algorithm to correct the mistake that may exist in the described sign indicating number speech that reads again, if error correction success output data sign indicating number speech reverts to byte data with the numeric data code speech, decoding finishes.
In above-mentioned steps 2 and 3 during with the gray scale image binaryzation, gray scale image can also be divided into not overlapping or partly overlapping several parts, determine threshold value and binaryzation at each distribution of adding up the GTG value respectively, the GTG threshold value of lap can be averaged, and then the each several part of binaryzation is combined.
The method of each macroblock of above-mentioned location also can be a template matching algorithm.Sign indicating number figure employing white edge frame macroblock and the cross arrangement of black surround frame macroblock because of two-dimensional bar code of the present invention, thereby in splicing place of different macroblock, also promptly become special graphic model at the quadrangle of macroblock, shown in Figure 14 A, 14B the special graphic model synoptic diagram of embodiment, so can measure and locate each macroblock fast and accurately by template matching algorithm.
Above content be in conjunction with concrete preferred implementation to further describing that the present invention did, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.
Claims (17)
1. the coding method of a two-dimensional bar code may further comprise the steps:
The numeric data code speech generates step: cutting apart the binary number that is encoded is the numeric data code speech with specific binary bits length;
The error correcting code speech generates step: described numeric data code speech utilization RS error correction algorithm is generated the error correcting code speech;
Sign indicating number figure main frame generates step: the main frame of generated code figure, promptly generate the frame portion and the level number position of each macroblock, described frame portion is distributed in one week of outermost of macroblock, described level number position is distributed in four angles in the frame portion, store level number information, the other parts of described macroblock are sign indicating number speech storage area;
Generated code figure image step filled in the sign indicating number speech: according to the sign indicating number speech storage area of outwards being filled described numeric data code speech and error correcting code speech each macroblock in the sign indicating number figure by the center with clockwise or counterclockwise spiral way, generated code figure image file, the i.e. storage order of sign indicating number speech that puts in order also of macroblock in this yard figure image.
2. the coding method of two-dimensional bar code as claimed in claim 1 is characterized in that: described level number information is made up of four bits, is respectively in 0111,0011 and 0,001 three value.
3. the coding method of two-dimensional bar code as claimed in claim 2 is characterized in that: described three values 0111,0011 and 0001 of being made up of four bits are by layer cycle arrangement, the value difference of adjacent layer.
4. as the coding method of arbitrary described two-dimensional bar code among the claim 1-3, it is characterized in that: the frame portion of described macroblock all is dark unit module or all is light unit module, be called black surround frame macroblock and white edge frame macroblock, these two kinds of macroblocks are alternately arranged on the vertical and horizontal both direction of sign indicating number figure.
5. the coding method of two-dimensional bar code as claimed in claim 4 is characterized in that: described sign indicating number figure main frame generates step and also comprises a step of determining sign indicating number figure size, promptly determines the main frame of regeneration sign indicating number figure after the size of sign indicating number figure according to the quantity of sign indicating number speech.
6. as the coding method of arbitrary described two-dimensional bar code among the claim 1-3, it is characterized in that: the length of described specific bit stream is 6 bits, 7 bits or 8 bits, described macroblock comprises N * N unit module, N is 6,7 or 8, the sign indicating number speech length of its corresponding stored is respectively 6 bits, 7 bits or 8 bits, thereby each macroblock comprises integer number of data sign indicating number speech.
7. the coding method of two-dimensional bar code as claimed in claim 4, it is characterized in that: the length of described specific bit stream is 6 bits, 7 bits or 8 bits, described macroblock comprises N * N unit module, N is 6,7 or 8, the sign indicating number speech length of its corresponding stored is respectively 6 bits, 7 bits or 8 bits, thereby each macroblock comprises integer number of data sign indicating number speech.
8. the coding method of two-dimensional bar code as claimed in claim 7, it is characterized in that: described sign indicating number speech filling step also comprises the step of the sign indicating number speech that forms new specific binary bits length, promptly earlier numeric data code speech and error correcting code speech are carried out the suitable sign indicating number speech that is combined to form new specific binary bits length, and then fill.
9. the coding/decoding method of a two-dimensional bar code is characterized in that:
A. obtain the gray scale image of yard figure by the digital photographing mode;
B. add up the distribution of the gray-scale value of different pixels in the described gray scale image;
C. determining threshold value according to the distribution of gray-scale value and transform described gray scale image is bianry image;
D. the boundary pixel that detects described bianry image obtains boundary image;
E. calculate the four angular coordinate of each macroblock;
F. calculate the centre coordinate of each unit module in the utilization difference algorithm computation macroblock according to the size of the four angular coordinate of each macroblock and known unit module, centre coordinate according to unit module reads the bit value of its storage or determines the bit value of its storage by the statistical value of the pixel value around its centre coordinate from bianry image then, thereby obtains the numeric data code speech matrix corresponding to decoded sign indicating number figure;
G. the level number information of being stored according to level number position in the macroblock is determined direction, initial code speech and each macroblock the position among sign indicating number figures of sign indicating number figure when being scanned, and obtains the predetermined error-correction level of sign indicating number figure according to the putting in order of three kinds of values of level number position;
H. the result who is obtained with step G is a foundation, according to correct center macroblock and sign indicating number figure direction reading of data sign indicating number speech and use mistake in the RS error correction algorithm correction code speech;
I. output data sign indicating number speech and restore data sign indicating number speech are binary number.
10. the coding/decoding method of two-dimensional bar code as claimed in claim 9 is characterized in that: among the described step G, when the information bit disappearance of part macroblock, the statistics of the bit information of being stored by a plurality of level numbers position is determined its position in sign indicating number figure.
11. the coding/decoding method of two-dimensional bar code as claimed in claim 9 is characterized in that: among the described step G, also obtain the predetermined error-correction level of sign indicating number figure according to the putting in order of three kinds of values of level number position.
12. the coding/decoding method of two-dimensional bar code as claimed in claim 10 is characterized in that: among the described step H, according to the mistake in the predetermined error-correction level utilization RS error correction algorithm correction code speech.
13. the coding/decoding method of two-dimensional bar code as claimed in claim 9 is characterized in that: among the described step B, adopt the statistics with histogram method to add up;
14. the coding/decoding method of two-dimensional bar code as claimed in claim 9, it is characterized in that: the method for determining threshold value among the described step C is the bimodal method of histogram, the method that described conversion gray scale image is a bianry image is: cut apart described gray scale image and be not overlapping or partly overlapping a few part, add up the distribution of gray-scale value respectively, the gray-scale value of lap is averaged, and binaryzation is also combined the various piece of binaryzation;
15. the coding/decoding method of two-dimensional bar code as claimed in claim 9, it is characterized in that: among the described step D, as long as mark each up and down 4 pixels have the light pixel of a dark pixels and each up and down 4 pixels as long as the dark pixels of a light pixel is arranged is boundary pixel, adopt the Hough algorithm to obtain boundary image;
16. the coding/decoding method of two-dimensional bar code as claimed in claim 9, it is characterized in that: the four angular coordinate method of calculating each macroblock in the described step e is, the straight-line equation group of the straight line in the boundary image of obtaining step D is also found the solution the four angular coordinate that obtains each macroblock, perhaps locatees each macroblock and calculates its four angular coordinate by template matching algorithm according to the boundary image of step D;
17. the coding/decoding method of two-dimensional bar code as claimed in claim 9, it is characterized in that: the method for obtaining among the described step G corresponding to the numeric data code speech matrix of decoded sign indicating number figure is: the centre coordinate that calculates each unit module in the macroblock earlier according to the size of the four angular coordinate of macroblock and known unit module, again according to the bit value of centre coordinate reading unit module stores from bianry image of each unit module, or by the bit value of the statistical value determining unit module stores of the pixel value around the unit module centre coordinate, thereby obtain the numeric data code speech matrix of decoded sign indicating number figure.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA2007101253977A CN101197004A (en) | 2007-12-25 | 2007-12-25 | Two-dimension bar code and its coding and decoding method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA2007101253977A CN101197004A (en) | 2007-12-25 | 2007-12-25 | Two-dimension bar code and its coding and decoding method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN101197004A true CN101197004A (en) | 2008-06-11 |
Family
ID=39547395
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNA2007101253977A Pending CN101197004A (en) | 2007-12-25 | 2007-12-25 | Two-dimension bar code and its coding and decoding method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101197004A (en) |
Cited By (38)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101840499A (en) * | 2010-06-01 | 2010-09-22 | 福建新大陆电脑股份有限公司 | Bar code decoding method and binarization method thereof |
| CN101882207A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Bar code decoding chip of Data Matrix codes and decoding method thereof |
| CN101882221A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Barcode Image Correction Method Based on Track Code |
| CN101882203A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Method for sampling sub-resolution of barcode image |
| CN101882211A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Chinese-sensible code barcode decoding chip and decoding method thereof |
| CN102004935A (en) * | 2010-11-08 | 2011-04-06 | 佟野 | LDPC (Low Density Parity Code)-based method for encoding and decoding two dimensional bar codes |
| CN102087699A (en) * | 2011-03-03 | 2011-06-08 | 北京天地融科技有限公司 | Information transmission method and system, bar code display device and reading device |
| CN102087698A (en) * | 2011-03-03 | 2011-06-08 | 北京天地融科技有限公司 | Method and system for transmitting information and device for displaying and reading bar code |
| CN102112995A (en) * | 2008-08-04 | 2011-06-29 | 霍夫曼-拉罗奇有限公司 | Encoding method for encoding medical items |
| CN102236810A (en) * | 2010-04-23 | 2011-11-09 | 富港电子(昆山)有限公司 | QR (Quick Response) code with hidden codes, and formation and identification methods of hidden codes |
| CN102243704A (en) * | 2011-07-21 | 2011-11-16 | 我查查信息技术(上海)有限公司 | Positioning system for two-dimension bar code and two-dimension bar code identification method and equipment |
| CN102708351A (en) * | 2012-05-24 | 2012-10-03 | 江南大学 | Method for fast identifying Data Matrix two-dimensional bar code under complicated working condition background |
| CN103198345A (en) * | 2013-04-01 | 2013-07-10 | 深圳市银之杰科技股份有限公司 | Method of preventing copy of two-dimension code and two-dimension printer |
| CN103383738A (en) * | 2012-05-03 | 2013-11-06 | 香港科技大学 | 2D barcodes with embedded visual information |
| CN103679106A (en) * | 2012-09-11 | 2014-03-26 | 上海新大陆翼码信息科技有限公司 | Two-dimensional code cutting and splicing authentication method and system |
| CN103944584A (en) * | 2014-04-24 | 2014-07-23 | 胡建国 | Method and device for decoding two-dimension codes |
| CN104143109A (en) * | 2014-01-28 | 2014-11-12 | 深圳市雁联计算系统有限公司 | Two-dimensional code coding method, two-dimensional code decoding method and two-dimensional code print |
| CN104346640A (en) * | 2013-08-08 | 2015-02-11 | 李润容 | Two-dimensional code and method for generating two-dimensional code |
| CN104781835A (en) * | 2012-11-13 | 2015-07-15 | 共同印刷株式会社 | Two-dimensional code |
| CN104866801A (en) * | 2015-06-12 | 2015-08-26 | 矽照光电(厦门)有限公司 | Recognition device of multi-gray scale invisible two-dimension code |
| CN104992207A (en) * | 2015-06-16 | 2015-10-21 | 无锡久源软件科技有限公司 | Mobile phone two-dimensional bar code coding and decoding method |
| CN105027146A (en) * | 2013-02-15 | 2015-11-04 | 声反射波尔佐尼安德里亚公司 | System and method for generating elements containing quick response codes |
| CN105260693A (en) * | 2015-12-01 | 2016-01-20 | 浙江工业大学 | Laser two-dimensional code positioning method |
| CN105654017A (en) * | 2015-12-25 | 2016-06-08 | 广州视源电子科技股份有限公司 | two-dimensional code transmission method and system |
| CN106899609A (en) * | 2017-03-22 | 2017-06-27 | 上海中商网络股份有限公司 | Code and its generation, verification method and device in a kind of code |
| CN107292369A (en) * | 2017-05-15 | 2017-10-24 | 武汉矽感科技有限公司 | The generation method and device of identification code |
| WO2017198189A1 (en) * | 2016-05-18 | 2017-11-23 | 北京鼎九信息工程研究院有限公司 | Generation and reading method and device for colour identified colour two-dimensional figure code |
| CN107392583A (en) * | 2012-04-25 | 2017-11-24 | 阿里巴巴集团控股有限公司 | A kind of two-dimension code pattern data creation method and device |
| CN107909544A (en) * | 2017-10-31 | 2018-04-13 | 珠海丹德图像技术有限公司 | A kind of method for correcting image and system |
| CN108710932A (en) * | 2018-05-21 | 2018-10-26 | 周冰 | A kind of two-dimensional code generation method, device and electronic equipment |
| CN109117919A (en) * | 2018-11-14 | 2019-01-01 | 苏州巨能图像检测技术有限公司 | Image encoding method applied to the position number identification of harbour shellfish |
| WO2019095172A1 (en) * | 2017-11-15 | 2019-05-23 | 深圳大学 | Qr code generating and decoding method and apparatus in qr code copying process |
| CN109859290A (en) * | 2019-01-25 | 2019-06-07 | 武汉矽感科技有限公司 | It is a kind of number mark and its generation method, system, storage medium and device |
| CN110197243A (en) * | 2018-02-26 | 2019-09-03 | Opto电子有限公司 | Two dimensional code, two dimensional code output system and method, two dimensional code read system and method |
| CN110650464A (en) * | 2018-06-27 | 2020-01-03 | 成都华迈通信技术有限公司 | Method for identifying and configuring WIFI network by camera |
| CN113673268A (en) * | 2021-08-11 | 2021-11-19 | 广州爱格尔智能科技有限公司 | Identification method, system and equipment for different brightness |
| CN117291208A (en) * | 2023-11-24 | 2023-12-26 | 四川数盾科技有限公司 | Two-dimensional code extraction method and system |
| CN117494740A (en) * | 2023-11-06 | 2024-02-02 | 广州讯宝电子科技有限公司 | A dual-camera scanner scanning method |
-
2007
- 2007-12-25 CN CNA2007101253977A patent/CN101197004A/en active Pending
Cited By (57)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102112995A (en) * | 2008-08-04 | 2011-06-29 | 霍夫曼-拉罗奇有限公司 | Encoding method for encoding medical items |
| CN102236810A (en) * | 2010-04-23 | 2011-11-09 | 富港电子(昆山)有限公司 | QR (Quick Response) code with hidden codes, and formation and identification methods of hidden codes |
| CN101882203A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Method for sampling sub-resolution of barcode image |
| CN101882221B (en) * | 2010-06-01 | 2016-08-17 | 福建新大陆电脑股份有限公司 | Bar code image correction method based on railway line |
| CN101882211A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Chinese-sensible code barcode decoding chip and decoding method thereof |
| CN101882221A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Barcode Image Correction Method Based on Track Code |
| CN101882207A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Bar code decoding chip of Data Matrix codes and decoding method thereof |
| CN101840499A (en) * | 2010-06-01 | 2010-09-22 | 福建新大陆电脑股份有限公司 | Bar code decoding method and binarization method thereof |
| CN101882211B (en) * | 2010-06-01 | 2012-05-23 | 福建新大陆电脑股份有限公司 | Chinese-sensible code barcode decoding chip and decoding method thereof |
| CN101882207B (en) * | 2010-06-01 | 2012-06-20 | 福建新大陆电脑股份有限公司 | Bar code decoding chip of Data Matrix codes and decoding method thereof |
| CN102004935A (en) * | 2010-11-08 | 2011-04-06 | 佟野 | LDPC (Low Density Parity Code)-based method for encoding and decoding two dimensional bar codes |
| CN102087699A (en) * | 2011-03-03 | 2011-06-08 | 北京天地融科技有限公司 | Information transmission method and system, bar code display device and reading device |
| CN102087698A (en) * | 2011-03-03 | 2011-06-08 | 北京天地融科技有限公司 | Method and system for transmitting information and device for displaying and reading bar code |
| CN102087699B (en) * | 2011-03-03 | 2014-10-15 | 天地融科技股份有限公司 | Information transmission method and system, bar code display device and reading device |
| CN102243704A (en) * | 2011-07-21 | 2011-11-16 | 我查查信息技术(上海)有限公司 | Positioning system for two-dimension bar code and two-dimension bar code identification method and equipment |
| CN102243704B (en) * | 2011-07-21 | 2014-04-02 | 我查查信息技术(上海)有限公司 | Positioning system for two-dimension bar code and two-dimension bar code identification method and equipment |
| CN107392583A (en) * | 2012-04-25 | 2017-11-24 | 阿里巴巴集团控股有限公司 | A kind of two-dimension code pattern data creation method and device |
| CN107392583B (en) * | 2012-04-25 | 2020-10-30 | 创新先进技术有限公司 | Two-dimensional code graphic data generation method and device |
| CN103383738A (en) * | 2012-05-03 | 2013-11-06 | 香港科技大学 | 2D barcodes with embedded visual information |
| CN103383738B (en) * | 2012-05-03 | 2017-04-12 | 香港科技大学 | Two-dimensional bar code with embedded visual information |
| CN102708351B (en) * | 2012-05-24 | 2014-07-23 | 江南大学 | Method for fast identifying Data Matrix two-dimensional bar code under complicated working condition background |
| CN102708351A (en) * | 2012-05-24 | 2012-10-03 | 江南大学 | Method for fast identifying Data Matrix two-dimensional bar code under complicated working condition background |
| CN103679106A (en) * | 2012-09-11 | 2014-03-26 | 上海新大陆翼码信息科技有限公司 | Two-dimensional code cutting and splicing authentication method and system |
| CN103679106B (en) * | 2012-09-11 | 2016-09-21 | 上海新大陆翼码信息科技股份有限公司 | Quick Response Code cutting and splicing method for authenticating and system |
| CN104781835A (en) * | 2012-11-13 | 2015-07-15 | 共同印刷株式会社 | Two-dimensional code |
| CN105027146A (en) * | 2013-02-15 | 2015-11-04 | 声反射波尔佐尼安德里亚公司 | System and method for generating elements containing quick response codes |
| CN105027146B (en) * | 2013-02-15 | 2018-07-03 | 声反射波尔佐尼安德里亚公司 | The system and method for element of the generation comprising quick response codes |
| CN103198345A (en) * | 2013-04-01 | 2013-07-10 | 深圳市银之杰科技股份有限公司 | Method of preventing copy of two-dimension code and two-dimension printer |
| CN104346640A (en) * | 2013-08-08 | 2015-02-11 | 李润容 | Two-dimensional code and method for generating two-dimensional code |
| CN104143109A (en) * | 2014-01-28 | 2014-11-12 | 深圳市雁联计算系统有限公司 | Two-dimensional code coding method, two-dimensional code decoding method and two-dimensional code print |
| CN104143109B (en) * | 2014-01-28 | 2017-04-05 | 深圳市雁联计算系统有限公司 | A kind of coding and decoding methods and its printed article of Quick Response Code |
| CN103944584A (en) * | 2014-04-24 | 2014-07-23 | 胡建国 | Method and device for decoding two-dimension codes |
| CN104866801A (en) * | 2015-06-12 | 2015-08-26 | 矽照光电(厦门)有限公司 | Recognition device of multi-gray scale invisible two-dimension code |
| CN104866801B (en) * | 2015-06-12 | 2017-11-10 | 矽图(厦门)科技有限公司 | The identification device of more GTG invisible two-dimensional codes |
| CN104992207B (en) * | 2015-06-16 | 2018-08-14 | 无锡宇宁智能科技有限公司 | A kind of mobile phone two-dimensional bar code decoding method |
| CN104992207A (en) * | 2015-06-16 | 2015-10-21 | 无锡久源软件科技有限公司 | Mobile phone two-dimensional bar code coding and decoding method |
| CN105260693B (en) * | 2015-12-01 | 2017-12-08 | 浙江工业大学 | A laser two-dimensional code positioning method |
| CN105260693A (en) * | 2015-12-01 | 2016-01-20 | 浙江工业大学 | Laser two-dimensional code positioning method |
| CN105654017B (en) * | 2015-12-25 | 2018-06-26 | 广州视源电子科技股份有限公司 | two-dimensional code transmission method and system |
| CN105654017A (en) * | 2015-12-25 | 2016-06-08 | 广州视源电子科技股份有限公司 | two-dimensional code transmission method and system |
| WO2017198189A1 (en) * | 2016-05-18 | 2017-11-23 | 北京鼎九信息工程研究院有限公司 | Generation and reading method and device for colour identified colour two-dimensional figure code |
| CN106899609A (en) * | 2017-03-22 | 2017-06-27 | 上海中商网络股份有限公司 | Code and its generation, verification method and device in a kind of code |
| CN107292369A (en) * | 2017-05-15 | 2017-10-24 | 武汉矽感科技有限公司 | The generation method and device of identification code |
| CN107909544A (en) * | 2017-10-31 | 2018-04-13 | 珠海丹德图像技术有限公司 | A kind of method for correcting image and system |
| CN107909544B (en) * | 2017-10-31 | 2021-08-10 | 珠海丹德图像技术有限公司 | Image correction method and system |
| WO2019095172A1 (en) * | 2017-11-15 | 2019-05-23 | 深圳大学 | Qr code generating and decoding method and apparatus in qr code copying process |
| CN110197243A (en) * | 2018-02-26 | 2019-09-03 | Opto电子有限公司 | Two dimensional code, two dimensional code output system and method, two dimensional code read system and method |
| CN108710932A (en) * | 2018-05-21 | 2018-10-26 | 周冰 | A kind of two-dimensional code generation method, device and electronic equipment |
| CN108710932B (en) * | 2018-05-21 | 2019-05-21 | 周冰 | A kind of two-dimensional code generation method, device, electronic equipment and storage medium |
| CN110650464A (en) * | 2018-06-27 | 2020-01-03 | 成都华迈通信技术有限公司 | Method for identifying and configuring WIFI network by camera |
| CN109117919A (en) * | 2018-11-14 | 2019-01-01 | 苏州巨能图像检测技术有限公司 | Image encoding method applied to the position number identification of harbour shellfish |
| CN109859290A (en) * | 2019-01-25 | 2019-06-07 | 武汉矽感科技有限公司 | It is a kind of number mark and its generation method, system, storage medium and device |
| CN113673268A (en) * | 2021-08-11 | 2021-11-19 | 广州爱格尔智能科技有限公司 | Identification method, system and equipment for different brightness |
| CN113673268B (en) * | 2021-08-11 | 2023-11-14 | 广州爱格尔智能科技有限公司 | Identification method, system and equipment for different brightness |
| CN117494740A (en) * | 2023-11-06 | 2024-02-02 | 广州讯宝电子科技有限公司 | A dual-camera scanner scanning method |
| CN117291208A (en) * | 2023-11-24 | 2023-12-26 | 四川数盾科技有限公司 | Two-dimensional code extraction method and system |
| CN117291208B (en) * | 2023-11-24 | 2024-01-23 | 四川数盾科技有限公司 | Two-dimensional code extraction method and system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101197004A (en) | Two-dimension bar code and its coding and decoding method | |
| CN100481117C (en) | A two dimensional bar code coding-decoding method | |
| KR100960786B1 (en) | Encoding Decoding Method and System of 2D Code | |
| JP2005267598A5 (en) | ||
| CN102999772B (en) | A kind of decoding method of novel matrix formula Quick Response Code | |
| AU622173B2 (en) | Dynamically variable machine readable binary code and method for reading and producing thereof | |
| EP2849115B1 (en) | Method for decoding matrix-type two-dimensional code | |
| CN105989317B (en) | A two-dimensional code identification method and device | |
| WO2017133533A1 (en) | Method of encoding and identifying 2d bitmap barcode | |
| CN111046996B (en) | Color QR code generation and identification method | |
| CN103632182A (en) | Three-dimensional (3D) image code generating and analyzing methods and device thereof | |
| CN104346640A (en) | Two-dimensional code and method for generating two-dimensional code | |
| US8360333B2 (en) | HD barcode | |
| CN108734048A (en) | Various dimensions Quick Response Code based on proprietary code generates and interpretation method | |
| CN112001469A (en) | Two-dimensional code encoding method, decoding method and two-dimensional code | |
| CN107247985A (en) | Coding, positioning and the recognition methods of New Two Dimensional code | |
| AU2006252239B2 (en) | Barcode pattern | |
| CN1953362A (en) | A method and installation to embed pattern in two-dimensional bar code | |
| CN106228103B (en) | A kind of identification method of double-layer code | |
| KR20030085511A (en) | 2d barcode card and its decoding method | |
| CN102521559B (en) | A 417 barcode recognition method based on sub-pixel edge detection | |
| CN110991589A (en) | Two-dimensional code and encryption method thereof | |
| KR101052403B1 (en) | 2D barcodes and their coding / decoding methods | |
| CN103927575B (en) | By coding pattern to form the method and device of dot pattern | |
| CN206946820U (en) | A kind of two-dimension code label |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 1115004 Country of ref document: HK |
|
| C12 | Rejection of a patent application after its publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20080611 |
|
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: WD Ref document number: 1115004 Country of ref document: HK |