CN1294519C - Two-D bar code encoding and decoding method - Google Patents

Two-D bar code encoding and decoding method Download PDF

Info

Publication number
CN1294519C
CN1294519C CNB03117955XA CN03117955A CN1294519C CN 1294519 C CN1294519 C CN 1294519C CN B03117955X A CNB03117955X A CN B03117955XA CN 03117955 A CN03117955 A CN 03117955A CN 1294519 C CN1294519 C CN 1294519C
Authority
CN
China
Prior art keywords
bar code
data
section
bit stream
control information
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.)
Expired - Lifetime
Application number
CNB03117955XA
Other languages
Chinese (zh)
Other versions
CN1452117A (en
Inventor
常治国
吕迎丰
丁晓云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Syscan Technology Co ltd
Original Assignee
Wuhan Xigan Sci & Tech Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Xigan Sci & Tech Co Ltd filed Critical Wuhan Xigan Sci & Tech Co Ltd
Priority to CNB03117955XA priority Critical patent/CN1294519C/en
Priority to US10/634,540 priority patent/US6802450B2/en
Priority to US10/634,283 priority patent/US7028911B2/en
Publication of CN1452117A publication Critical patent/CN1452117A/en
Application granted granted Critical
Publication of CN1294519C publication Critical patent/CN1294519C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Printers Characterized By Their Purpose (AREA)

Abstract

The present invention relates to a two-D bar code encoding method and a corresponding decoding method. The inputted binary data information is encoded by the encoding method and two-D bar codes which can be attached on a carrier are output by the encoding method; the encoding method comprises the following steps: A error correcting codes of binary data information are calculated according to an error correction algorithm and error correction grades, a new bit stream is formed by that the error correcting codes are added in the data information, and the bit stream can also be arranged in a staggered way by blocks; B the number of stages of the bar codes is determined according to the size of the bit stream, the bit stream is divided into data segments of the same size, and a mask is used for calculation; C segment control information is respectively added in each data segment, the resolution, the length and the width of the bar codes for printing are determined according to the shape and the size of the carrier, a start mode and an end mode are added in the bar codes, a left positioning mode and a right positioning mode are added, and the bar codes are outputted. The two-D bar codes obtained by the present invention, which are convenient for decoding of linearity contact type optical scanners or non-contact type optical scanners, have the advantages of large information quantity, high redundancy degree, multiple grades for preventing damage, long length of the bar codes and variable solution for printing.

Description

The Code And Decode method of two-dimensional bar code
Technical field the present invention relates to a kind of coding method of two-dimensional bar code and uses the method for linearity, contact-type or non-contact type imageing sensor scan decoder.
The background technology bar code is the mark that one group of regularly arranged bar, sky and corresponding character thereof are formed, in order to express certain information.Bar code is proposed the twenties in last century by Kermod the earliest as a kind of cheapness, simple, quick, the Exact Number mode of intelligence transmission.Two-dimensional bar code then is in exploitation in 1970 by Iterface Mechanisms company.Bar, the null representation information of bar code by arranging in the horizontal direction is in vertical direction expressing information not.By contrast, two-dimensional bar code also can expressing information in vertical direction, and its canned data amount has increased greatly with respect to bar code.Early stage bar code data volume is less, can only store letter and number, and size is bigger, just can not read after the damage.Two-dimensional bar code is except having kept the printing that bar code had easy, and low cost of manufacture has beyond the advantages such as outstanding diamagnetic field, capability of resistance to radiation, after having adopted the Reed-Solomon error correction algorithm, resistance to wear and abrasive ability improve greatly.
Common two-dimensional bar code mainly contains PDF 417, QR, DataStrip and Data matrix etc.They can be divided into two classes: Stacked Bar Code and matrix two-dimensional barcode.Stacked Bar Code is to be arranged by the bar code layer of many brachymemmas to form, and as PDF 417 (United States Patent (USP) 5304786), it is made up of a plurality of bar code Extra Sections control patterns.Its shortcoming has been to adopt one based on 929 code words coded system of (4 black and white at interval), and each bar code character can only be represented 9.2 bit data, greatly reduces the data volume of single PDF417 bar code.
QR encode (AIM International Symboloby Specification-QR Code), it is the matrix two-dimensional barcode that is used for industrial automation by the Denso Corp of Japanese firm exploitation, this bar code can only be square, and can not scan-synchronized decode, and memory space is limited.Its maximum data capacity during 750 error correction, is 2956 bytes when 177 Z sizes of its maximum area and error correcting capability are minimum.
Another kind is the high density two-dimensional matrix formula bar code described in the PCT patent WO 0051072, is mainly used in the storage biometric information.
Technical scheme the object of the present invention is to provide a kind of large information capacity, highly redundant degree, many anti-grade, bar code length and width and variable two-dimensional bar code coding methods of printing resolution of decreasing that linear contact-type or non-contact type optical scanner are deciphered of being convenient to.Another object of the present invention is to provide a kind of method of utilizing linearity, contact-type or non-contact type imageing sensor scanning back decoding or this two-dimensional bar code of scanning parallel decoding.
A kind of two-dimensional bar code coding method disclosed by the invention, binary load it is believed that breath, output can comprise the steps: attached to the two-dimensional bar code on the carrier
A. calculate the error correcting code of described binary data information according to error correction algorithm and error-correction level, error correcting code is added the new bit stream of formation in the described binary data information;
B. determine the bar code hop count according to bit stream size, bit stream is divided into equal-sized data segment, supply with filler character during one section of last data deficiencies;
C. the head of each section adds the section control information in each data segment; Determine printing resolution, the length and wide of bar code according to the shape and size of carrier; Add beginning, end mode on the head of the bar code both sides pairing, relative respectively, add the left and right side station-keeping mode on the perpendicular other both sides of head and the pairing both sides of afterbody of bar code respectively with afterbody; The output bar code.
After adding error correcting code in the described bit stream among the above-mentioned steps A, more described bit stream is divided into equal-sized data block, adds filler during piecemeal as required; From each data block, extract data more respectively successively in proper order, and according to these data of series arrangement of extracting, thereby the data cross in each data block is arranged, be updated to new bit stream.
After among the above-mentioned steps B described bit stream being divided into described data segment, select the mask kind again, the data in each section are carried out XOR to mask, obtain new bit stream.
Before above-mentioned steps A earlier to the described binary data information of desiring the raddle sign indicating number carry out can amount of compressed data secondary coding, obtain new binary data information bit stream.
Described beginning control model in above-mentioned steps C comprises beginning instruction character and ending bar; End mode comprises finishing control symbol and ending bar, and the structure of described beginning instruction character is a bar, empty alternately along the arrangement of bar code Width, and bar, empty width are respectively [3: 1: 1: 2: 2: 2], with the cell width unit of being of a size of; The structure of finishing control symbol is a bar, empty alternately along the arrangement of bar code Width, and bar, empty width are respectively [3: 2: 2: 1: 1: 2], with the cell width unit of being of a size of; The width of ending bar is 3 times of cell width.
The control information of section described in the above-mentioned steps C comprises total hop count, staggered sign, error correction algorithm grade, mask-type and this section sequence number; Comprise error correcting code in the described section control information.
A kind of two-dimensional bar code coding/decoding method disclosed by the invention uses one dimensional linear array contact-type or non-contact type imageing sensor to obtain the bar code image data, and the binary data information before the output encoder comprises the steps:
A. in view data, survey bar code and begin pattern and end mode, the position coordinates of start-of-record pattern and end mode;
B. according to the angle of beginning and the position of end mode and shape calculating direction of scanning and bar code, judge bar code whether end to end oppositely, left and right sides mirror image whether; Judge the bar code printing resolution according to beginning or end mode;
C. according to the projection of the angle calculation bar code of direction of scanning and bar code, judge the position that obtains all sections separator in vertical direction;
D. from first section separator, survey left row station-keeping mode and right side row station-keeping mode, calculate the coordinate of each all unit of row according to printed resolution;
E. read all sections control information according to the position of section separator;
F. error correction is carried out in each section control information, obtained and the memory paragraph control information;
G. read the total data information in bar code data character district according to the position of section separator and the coordinate of each row unit, recover bit stream;
H. carry out anti-mask according to described section control information for bit stream and calculate and anti-staggered calculating, obtain new bit stream; And then described bit stream is carried out error correction calculations with corresponding error correction algorithm and error-correction level;
I. recover the preceding bit stream information of barcode encoding.
The invention also discloses a kind of two-dimensional bar code coding/decoding method, use one dimensional linear array contact-type or non-contact type imageing sensor to obtain the bar code image data, the binary data information before the output encoder comprises the following step of carrying out in chronological order:
A. scan output image data to memory buffer, and in view data, survey beginning pattern or end mode;
B. judging whether to detect end mode, is then reverse end to end for bar code, transfers scanning back decoding schema to, otherwise continues to carry out next step;
C. judge whether to detect the beginning pattern, otherwise get back to steps A; Being then to begin pattern according to this to judge whether left and right sides mirror image, is that left and right sides mirror image then transfers scanning back decoding schema to; Non-left and right sides mirror image then continues to carry out next step;
D. judge the bar code printing resolution according to the size of the beginning instruction character that begins pattern;
E. obtain the scan-data of new delegation according to the bar code printing resolution;
F. judge whether to be the section separator, otherwise get back to step e; Be then to enter next step;
G. survey left and right sides skidding station-keeping mode;
H. according to left and right sides skidding station-keeping mode location and the section of reading control information;
I. error correction is carried out in the section control information, obtained and the memory paragraph control information;
J. judge according to the section sequence number whether scanning is correctly carried out in proper order; Otherwise change scanning back decoding program; Be then whether staggered,, then change scanning back decoding program if data interlace is arranged according to section control information judgment data; Otherwise enter next step;
K. read bit stream information according to left and right sides skidding station-keeping mode location;
L. carry out the verification decoding according to error correction algorithm in the section control information and error-correction level, recover and output bit flow information;
M. whether section separator of next line is judged in control information according to section, otherwise gets back to step K; Be then to enter next step;
N. judge whether end mode of next line scan-data, otherwise get back to step G; Be that then bar code scan finishes.
Judge in the step F of above-mentioned coding/decoding method delegation's scan-data whether the method for the section of being separator can be, the value sum of these line scanning data is compared the section of being judged as separator during greater than 1.5 times of the value sum of delegation's scan-data of beginning pattern with the value sum of delegation's scan-data of beginning pattern.
Two-dimensional bar code coding method disclosed by the invention is provided with broad-adjustable beginning and end mode, can adapt to the shape and the size of bar code carrier, also can adapt to different bar code printing resolutions, whether reverse end to end can distinguish in coding/decoding method.Because the special construction that beginning and finishing control accord with, in coding/decoding method, can recognize whether left and right sides mirror image of bar code.This coding method is provided with the data sementation pattern, adds the section control information, has strengthened the coding and decoding support for different length information; The locator meams of left and right station-keeping mode and data sementation, special adaptation one dimensional linear array contact-type or non-contact type imageing sensor manual scanning obtain the bar code image data, strengthened the scanning locating accuracy, if in coding/decoding method, there is capable station-keeping mode destroyed, can avoid the cumulative errors of capable station-keeping mode by the position estimation location of section separator.Optionally the data cross arrangement mode has been strengthened the anti-damage degree of coding.Two-dimensional bar code coding method of the present invention has the coding size adjustable, and length breadth ratio is adjustable, and error-correction level is adjustable, supports the advantage of multiple information format.Two-dimensional bar code coding/decoding method of the present invention is decoded in scanning, and recognition speed is fast, recognizer is simple.
Description of drawings the present invention includes the following drawings:
Fig. 1 is a kind of two-dimensional bar code of the present invention;
Fig. 2 is the exploded view of two-dimensional bar code of the present invention;
Fig. 3 is a kind of beginning pattern that two beginning instruction characters are arranged of two-dimensional bar code of the present invention;
Fig. 4 is a kind of beginning pattern that three beginning instruction characters are arranged of two-dimensional bar code of the present invention;
Fig. 5 is a kind of end mode that two finishing control symbols are arranged of two-dimensional bar code of the present invention;
Fig. 6 is the synoptic diagram of the data segment cross arrangement coding of two-dimensional bar code of the present invention;
Fig. 7 is the embodiment of a kind of section control information of two-dimensional bar code of the present invention;
Fig. 8 is three kinds of data masks that the present invention adopts;
Fig. 9 is the coding process flow diagram of two-dimensional bar code of the present invention;
Figure 10 is decoding process figure after the scanning of two-dimensional bar code of the present invention;
Figure 11 is the scanning parallel decoding process flow diagram of two-dimensional bar code of the present invention.
The illumination of embodiment contact scanner in bar code recognizing apparatus is even, it is little that the image that obtains and original image are compared nonlinear distortion, picture quality is good, therefore a kind of structure matrix two-dimensional barcode of simplicity to greatest extent can be designed, thereby the information storage capacity of equal area printing carrier can be improved.
Two-dimensional bar code of the present invention as shown in Figure 1 by rectangular element form, exterior contour is also for rectangle.Fig. 2 is the exploded view of two-dimensional bar code of the present invention, and two-dimensional bar code of the present invention comprises beginning pattern 10, end mode 20, left positioner mode 30, right positioner pattern 40, bar code data character district 50 and is positioned at the section separator 60 in bar code data character district.
Beginning pattern 10 of the present invention is made up of beginning instruction character 101 and ending bar 105.Beginning instruction character 101 by wide 3 spaces of wide 3 bars of different bars and different skies every forming, along the Width arrangement in bar code data character district 50.Can to be one also can be a plurality of to beginning instruction character 101 in a two-dimensional bar code, by the shape size decision of carrier.As shown in Figure 3 by 2 beginning instruction characters 101 and the beginning pattern 10 that ending bar 105 is formed; Fig. 4 is by 3 beginning instruction characters 101 and the beginning pattern 10 that ending bar 105 is formed.
End mode 20 of the present invention is made up of finishing control symbol 201 and ending bar 105.Finishing control symbol 201 by wide 3 spaces of wide 3 bars of different bars and different skies every forming, along the Width arrangement in bar code data character district 50.Can to be one also can be a plurality of to finishing control symbol 201 in a two-dimensional bar code, by the shape size decision of carrier.Accord with the end mode 20 that 201 and ending bars 105 are formed by 2 finishing control as shown in Figure 5.
The quantity of beginning instruction character 101 in beginning pattern 10 and the end mode 20 and finishing control symbol 201 generally equates, ending bar 105 also all is that width is 3 cell width sizes.
Because beginning pattern 10 is different with the structure of end mode 20, therefore read its difference by scanning, can judge whether bar code is upside down or left and right sides mirror image.
The head of two-dimensional bar code of the present invention is determined width by the multiplicity of beginning instruction character 101 in the beginning pattern 10, is respectively [3: 1: 1: 2: 2: 2] as the bar of the beginning instruction character 101 among Fig. 3, Fig. 4, empty width, with the cell width unit of being of a size of.The width of finishing control symbol 201 equates that with beginning instruction character 101 multiplicity also equates in same bar code.Be respectively [3: 2: 2: 1: 1: 2] as the bar of the symbol of the finishing control among Fig. 5 201, empty width, with the cell width unit of being of a size of.So the width of bar code is a C cell width; C=11*N+3 wherein, N=1,2 ..., N is an integer, is the number of times that the beginning instruction character repeats, the upper limit of N is by the shape size decision of carrier.
When adopting hand-scanner recognition two-dimensional bar code, can there be angle in direction of scanning and bar code, sweep velocity can not be evenly, the track of the inswept bar code of scanner has certain uncertainty, therefore in bar code, add the irrelevant control information of information that stores with bar code, can improve scanning recognition success ratio, the left positioner mode 30 of two bar codes of the present invention and right positioner pattern 40 design just for this purpose.
Left positioner mode 30 and right positioner pattern 40 respectively by 2 column width be a cell width size bar and this two row between a column width be a cell width size, form by bar and empty staggered unit; Bar in left positioner mode 30 and the right positioner pattern 40 is identical with cell size empty and in the bar code data character district 50.The middle column of left and right side station-keeping mode can by as shown in Figure 1 and Figure 2 by a bar and a space every arrangement; also can be by a plurality of and a space every arrangement; can also all belong to the content that the present invention is open and protect by bar and empty with other interblock gap arrangement.
As previously described, less by the image non-linear distortion that CIS obtains, that is to say the relative position basic fixed of figure inner structure, therefore can be from the image that scanning obtains accurate positional matrix figure, and the left and right side station-keeping mode that is arranged in the bar code both sides is in that bar on the horizontal line is empty to distribute just the samely, just can reach this purpose.After pair of right and left sky or bar were identified, the center of these all other unit of row also just can accurately be calculated and be preserved, thereby its bitstream information can directly obtain; Just can estimate and calculate, preserve the position of delegation unit below it according to the position of last a pair of left and right side station-keeping mode discal patch sky.Therefore with the witness marker of left and right side station-keeping mode as Figure recognition, recognition speed is fast, recognizer is simple, scan and identification can parallel processing.
As shown in Figure 2, bar code data character district 50 is divided into equal-sized data segment, separates with section separator 60 between the data segment.Section separator 60 is made up of the horizontal continuous bar of delegation.Bar code data character district 50 is the memory block of information, and the information of a bit (bit) is deposited in each unit, for example bar representative " 0 ", empty representative " 1 ".The discharging modes of information can be to arrange from top to bottom with the behavior master in the bar code data character district 50, also can be classifying principal and subordinate's left-to-right as or to arrange from right to left, and different selections can be stored in the section control information.
The present invention has the equal number unit on the direction of the direction of being expert at and row, also can be to have quantity inequality unit on the direction of the direction of being expert at and row, can adhere to the size decision of carrier according to it.
In bar code data character district 50, can realize wrong verification and correction with the Read-Solomon algorithm.The Read-Solomon algorithm proposed by Reed-Solomon is common in nineteen sixty, and it is the strongest digital coding mode of error correcting capability in the known algebraic coding error correcting system, is a kind of canonical algorithm well known to those skilled in the art.Thereby we generate error correcting code to carrying out algebraic operation with the data block of fixed length in this coding.It is 127 byte data pieces that data byte and error correction are combined into length scale.
Relative four different brackets, corresponding error correcting capability is listed as follows
Error-correction level The data yardage The error correction yardage Substitute wrong error correction rate The erasure error error correction rate
1 119 8 3.1% 6.3%
2 111 16 6.3% 12.6%
3 95 32 12.6% 25.2%
4 63 64 25.2% 50.4%
Though error correction algorithm can be corrected the recognition mistake as seen from the above table, error-correction level is high more will to produce many more error correcting codes, has reduced the information density of bar code.
If bar code is damaged the recognition success ratio is reduced, generally the artificial destruction to bar code mainly comprises: dirt, gauffer, damaged, perforation, the destruction to bar code is continuous on carrier usually, therefore often causes the continuous mistake of data.Data cross is arranged recognition rate when can improve bar code artificial destruction being arranged.See Fig. 6, the data block of process verification at first is divided into a plurality of regular lengths, and the length of each data block is 127 bytes in Fig. 6, and A1 is arranged, A2 ... A127; B1, B2 ... B127 and C1, C2 ... three of C127, a plurality of data blocks are staggered in bar code data character district 50, as A1, B1, C1, A2, B2, C2 ....Fig. 6 is to be the synoptic diagram that is staggered of the data of 127 bytes to three block lengths, and 4,5 or more a plurality of data block are staggered in the actual coding.The data block method that is staggered has been strengthened the recognition rate of bar code after by artificial destruction greatly, and does not strengthen actual data volume.
If data volume is very big, single bar code is long, has the capable information location of scanning recognition when damaging to be forbidden in coarse environment bottom left, right positioner pattern.For this reason, coding method of the present invention is also carried out segmentation physically to bar code except to the data piecemeal, uses section separator 60 that bar code is divided into the fixing data segment of length.In scanning process by for the location of section separator, can be contaminated at left and right sides station-keeping mode or the situation of disappearance under estimation row locating information.
The partly section of setting control information of the beginning of coding method of the present invention in each section further improves the bar code reading rate.Be the embodiment of a kind of section control information of two-dimensional bar code of the present invention as shown in Figure 7, this section control information comprises 3 each 15 bit informations, is writing down total hop count, staggered sign, Saloman error-correction level, mask-type (one of 4 kinds of states) and this section sequence number.Described staggered sign is to represent whether to adopt the data block sign of method that is staggered.E0 among the figure, e1 ... e9 represents error correction bit; A0, a1 ... a4 represents the total hop count of bar code; B1, b2 represents error-correction level, and b3, b4 represent the mask pattern; C1, c2 ... c4 represents this section sequence number.These information help the successfully section of deciphering internal information.Total hop count information, staggered sign, Saloman error-correction level and mask-type each section begin carry out repetition, reduced because a section control information can not be restored, the destroyed data message that causes is lost or the failure of scan decoder.
Can produce funneling effect when printing and recognition when occurring large-area dark color or light areas in the bar code, the heterochromatic district of fritter in the homochromy zone of large tracts of land is covered by homochromy district.Carry out XOR with fixing mask mode for the coding that writes, can reduce large tracts of land homochromy zone appearance in the bar code, make the data area discal patch become uniform distribution with sky.So also further avoided obscuring of digital coding and functional module.Show 3 kinds of mask patterns as Fig. 8.Described mask is to be used for coded data is carried out XOR, reduces the homochromy zone appearance of bar code large tracts of land to reach, made barcode data zone discal patch become the serial data of uniform distribution with sky.Carry out corresponding anti-mask and calculate when decoding, it is to recover the preceding data of mask process that described anti-mask calculates.
Coding method of the present invention is used specific secondary coding mode respectively to corresponding character set (numeral, ASCII, Chinese character), so increased the capacity of this bar code greatly, can represent that Chinese character, a 10Bit represent one three decimal digit character with 13BIT, 7Bit represents an ASC127 coding.
The character set that can carry out secondary coding in this coding is listed as follows:
■ GB2312:GB3212 has 6763 codings, and each coding takies two bytes, has a large amount of residue coding, and with 13bit coding 6763 the GB2312 sign indicating numbers (also remaining 1429 codings) of just can encoding fully, so 3 bit can be saved in each Chinese character.
The most significant digit of preceding 128 codings is zero in the ■ ASC127:ASCII coding, it is abandoned adopt the 7bit coding, so each English character can be saved 1 bit.
■ numeric character 0-9: per three continuous numbers are divided into one group, if three numeral zero paddings of last group less than.Every group of digital conversion become 3 decimal numbers, and with 10bit binary number coding, therefore average each numeral only takies 3.3 bits again.
■ 8bit byte: non-above three types data can be handled as the 8bit byte data, and its secondary coding is divided into non-compressed encoding and compressed encoding.Non-compressed encoding is at first exported bit0, is exactly 8bit byte data itself subsequently; Compressed encoding is at first exported bit1, follows compressed encoding by data, and compression is undetermined with decompression algorithm.
■ User Defined data markers coding rule: 4bit type coding and 8bit data length coding and data byte and, maximum 256 bytes of data byte, each byte 8bits.
Fig. 9 is the coding method of two-dimensional bar code of the present invention, comprises the steps:
1, the information of desiring the raddle sign indicating number is carried out secondary coding, obtain data stream (bit stream);
2, according to error-correction level computing error correction sign indicating number, error correction is added in the bit stream, again bit stream is carried out piecemeal; 127 bytes for example shown in Figure 6 are one, if adopt 4 grades of Saloman algorithms, then every has data bit 63 bytes, error correction bit 64 bytes;
3, the data cross in each data block is arranged, obtain new bit stream;
4, determine hop count according to bit stream size, bit stream is divided into equal-sized data segment, can supply last data segment with filler character; Described filler character is the serial data that is used to supply last data segment;
5, select the mask kind, the data in each section are carried out mask calculate, obtain new data stream;
6, in each section, add the section control information respectively; Determine printing resolution, the length and wide of bar code according to the shape and size of carrier; In bar code, add beginning, end mode, add the left and right side station-keeping mode; The output bar code.
During decoding, can from scan-data, judge the bar or the empty printed dimensions of a unit in the bar code, thereby learn the printing resolution according to the size of beginning instruction character in the beginning pattern.
The characteristic of two-dimensional bar code of the present invention is convenient to one dimensional linear array contact-type (CIS) or non-contact type imageing sensor and is read and decode.The principal feature of one dimensional linear array contact-type imageing sensor is 1: 1 contact scanning.Figure 10 is decoding process figure after the scanning of two-dimensional bar code of the present invention, and included step is in chronological order:
1, obtain bar code image by one dimensional linear array contact-type or non-contact type imageing sensor, carry out pre-service for the view data that obtains, for example figure image intensifying (image enhance increases contrast) etc. are carried out binary conversion treatment to view data then;
2, in view data, survey bar code and begin pattern and end mode, the position coordinates of start-of-record pattern and end mode;
3, according to beginning and the position of end mode and shape calculate direction of scanning and bar code angle, judge bar code whether end to end oppositely, left and right sides mirror image whether; Judge the bar code printing resolution according to beginning or end mode;
4,, judge the position of all sections separator 60 according to the projection (each row view data addition on bar code, different unit cell arrangement will obtain different values) of the angle calculation bar code of direction of scanning and bar code in vertical direction;
5, from first section separator, survey left row station-keeping mode 30 and right side row station-keeping mode 40 according to printed resolution, calculate the centre coordinate of each all unit of row;
6, read all sections control information according to the position of section separator 60;
7, error correction is carried out in each section control information, obtained and store section control informations such as total hop count, error-correction level, staggered sign, mask pattern, each segment number;
8, read the total data information in bar code data character district 50 according to the position of section separator 60, recover bit stream;
9, carry out anti-mask for bit stream, the reciprocal cross mistake is carried out error correction with the Read-solomon algorithm then;
10, recover the preceding bit stream information of barcode encoding, again secondary coding is decoded.
Figure 11 is the scanning parallel decoding process flow diagram of two-dimensional bar code of the present invention, and the scan-synchronized decoding comprises the steps:
1, scans output image data to memory buffer, and in view data, survey beginning pattern 10 or end mode 20;
If 2 detect end mode 20, then be that bar code is reverse end to end, transfer scanning back decoding schema to;
If 3 detect beginning pattern 10, judge whether left and right sides mirror image, be then to transfer scanning back decoding schema to;
4, judge the bar code printing resolution according to the beginning pattern;
5, obtain the scan-data of new delegation according to the bar code printing resolution;
6, calculate of the projection of this scan-data in vertical direction, projection value be beginning pattern projection value more than 1.5 times the time section of thinking separator 60; Judge whether to be the section separator, otherwise got back to for the 5th step;
7, survey left and right sides skidding station-keeping mode 30,40;
8, according to 30,40 location and the section of the reading control informations of left and right sides skidding station-keeping mode;
9, error correction is carried out in the section control information, obtained and store control informations such as total hop count, error-correction level, staggered sign, mask pattern, this section sequence number;
10, judge according to the section sequence number whether scanning is correctly carried out in proper order; Otherwise change scanning back decoding program; Be then whether staggered,, then change scanning back decoding program if data interlace is arranged according to section control information judgment data;
11, read bit stream information according to left and right sides skidding station-keeping mode 30,40 location;
12, carry out the verification decoding according to error correction algorithm in the section control information and error-correction level, recover and output bit flow information;
13, whether section separator 60 of next line is judged in control information according to section, otherwise gets back to for the 11st step;
14, judge again whether end mode 20 of next line scan-data, otherwise got back to for the 7th step; Be that then bar code scan finishes.

Claims (9)

1, a kind of two-dimensional bar code coding method comprises that binary load it is believed that breath, and output can is characterized in that comprising the steps: attached to the two-dimensional bar code on the carrier
A. calculate the error correcting code of described binary data information according to error correction algorithm and error-correction level, described error correcting code is added the new bit stream of formation in the described binary data information;
B. determine the bar code hop count according to described bit stream size, bit stream is divided into equal-sized data segment, supply with filler character during one section of last data deficiencies;
C. the head of each section adds the section control information in described each data segment; Determine printing resolution, the length and wide of bar code according to the shape and size of carrier; Add beginning pattern (10), end mode (20) on the head of the bar code both sides pairing, relative respectively, add left positioner pattern (30), right positioner pattern (40) on the perpendicular other both sides of head and the pairing both sides of afterbody of bar code respectively with afterbody; The output bar code.
2, two-dimensional bar code coding method according to claim 1 is characterized in that, add described error correcting code in the described bit stream in the described steps A after, more described bit stream is divided into equal-sized data block, add filler during piecemeal as required; From each data block, extract data more respectively successively in proper order, and according to these data of series arrangement of extracting, thereby the data cross in each data block is arranged, be updated to new bit stream.
3, two-dimensional bar code coding method according to claim 1 is characterized in that, among the described step B described bit stream is divided into described data segment after, select the mask kind again, the data in each section are carried out XOR to mask, obtain new bit stream.
4, two-dimensional bar code coding method according to claim 1 is characterized in that, before described steps A earlier to the described binary data information of desiring the raddle sign indicating number carry out can amount of compressed data secondary coding, obtain new binary data information bit stream.
5, two-dimensional bar code coding method according to claim 1 is characterized in that, the described beginning pattern (10) among the described step C comprises beginning instruction character (101) and ending bar (105); Described end mode (20) comprises finishing control symbol (201) and ending bar (105), the structure of described beginning instruction character (101) is that bar, sky are alternately arranged along the bar code Width, bar, empty width were respectively 3: 1: 1: 2: 2: 2, with the cell width unit of being of a size of; The structure of described finishing control symbol (201) is a bar, empty alternately along the arrangement of bar code Width, and bar, empty width were respectively 3: 2: 2: 1: 1: 2, with the cell width unit of being of a size of; The width of described ending bar (105) is 3 times of cell width.
6, two-dimensional bar code coding method according to claim 1 is characterized in that, the control information of section described in the described step C comprises total hop count, staggered sign, error correction algorithm grade, mask type and this section sequence number; Comprise error correcting code in the described section control information.
7, a kind of two-dimensional bar code coding/decoding method uses one dimensional linear array contact-type or non-contact type imageing sensor to obtain the bar code image data, recovers the preceding binary data information of output encoder, it is characterized in that comprising the steps:
A. in view data, survey bar code and begin pattern (10) and end mode (20), write down the position coordinates of described beginning pattern and end mode;
B. according to the position of described beginning and end mode and shape calculate direction of scanning and bar code angle, judge bar code whether end to end oppositely, left and right sides mirror image whether; Judge the bar code printing resolution according to described beginning or end mode;
C. according to the projection of the angle calculation bar code of described direction of scanning and bar code, judge the position that obtains all sections separators (60) in vertical direction;
D. from first section separator, survey left row station-keeping mode (30) and right side row station-keeping mode (40), calculate the coordinate of each all unit of row according to printed resolution;
E. read all sections control information according to the position of described section separator (60);
F. error correction is carried out in each section control information, obtained and the memory paragraph control information;
G. read the total data information in bar code data character district (50) according to the position of described section separator (60) and the coordinate of each row unit, recover bit stream;
H. carry out anti-mask according to described section control information for bit stream and calculate and anti-staggered calculating, obtain new bit stream; And then described bit stream is carried out error correction calculations with corresponding error correction algorithm and error-correction level;
I. recover the preceding bit stream information of barcode encoding.
8, a kind of two-dimensional bar code coding/decoding method uses one dimensional linear array contact-type or non-contact type imageing sensor to obtain the bar code image data, and the binary data information before the output encoder is characterized in that comprising the following step of carrying out in chronological order:
A. scan output image data to memory buffer, and in view data, survey beginning pattern (10) or end mode (20);
B. judging whether to detect end mode (20), is then reverse end to end for bar code, transfers scanning back decoding schema to; Otherwise continue to carry out next step;
C. judge whether to detect beginning pattern (10), otherwise get back to steps A; Being then to begin pattern (10) according to this to judge whether left and right sides mirror image, is that left and right sides mirror image then transfers scanning back decoding schema to; Non-left and right sides mirror image then continues to carry out next step;
D. judge the bar code printing resolution according to the size of the beginning instruction character (101) that begins pattern;
E. obtain the scan-data of new delegation according to the bar code printing resolution;
F. judge whether to be the section separator, otherwise get back to step e; Be then to enter next step;
G. survey left and right sides skidding station-keeping mode (30), (40);
H. according to left and right sides skidding station-keeping mode (30), locate and the section of reading control information (40);
I. error correction is carried out in the section control information, obtained and the memory paragraph control information;
J. judge according to the section sequence number whether scanning is correctly carried out in proper order; Otherwise change scanning back decoding program; Be then whether staggered,, then change scanning back decoding program if data interlace is arranged according to section control information judgment data; Otherwise enter next step;
K. read bit stream information according to left and right sides skidding station-keeping mode (30), (40) location;
L. carry out the verification decoding according to error correction algorithm in the section control information and error-correction level, recover and output bit flow information;
M. whether section separator (60) of next line is judged in control information according to section, otherwise gets back to step
K; Be then to enter next step;
N. judge whether end mode (20) of next line scan-data, otherwise get back to step G; Be that then bar code scan finishes.
9, two-dimensional bar code coding/decoding method according to claim 8, it is characterized in that, judge in the described step F delegation's scan-data whether the method for the section of being separator be, the value sum of these line scanning data is compared the section of being judged as separator during greater than 1.5 times of the value sum of delegation's scan-data of described beginning pattern (10) with the value sum of delegation's scan-data of described beginning pattern (10).
CNB03117955XA 2002-08-07 2003-05-22 Two-D bar code encoding and decoding method Expired - Lifetime CN1294519C (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CNB03117955XA CN1294519C (en) 2003-05-22 2003-05-22 Two-D bar code encoding and decoding method
US10/634,540 US6802450B2 (en) 2002-08-07 2003-08-05 Guiding a scanning device to decode 2D symbols
US10/634,283 US7028911B2 (en) 2002-08-07 2003-08-05 Methods and systems for encoding and decoding data in 2D symbology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB03117955XA CN1294519C (en) 2003-05-22 2003-05-22 Two-D bar code encoding and decoding method

Publications (2)

Publication Number Publication Date
CN1452117A CN1452117A (en) 2003-10-29
CN1294519C true CN1294519C (en) 2007-01-10

Family

ID=29222830

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB03117955XA Expired - Lifetime CN1294519C (en) 2002-08-07 2003-05-22 Two-D bar code encoding and decoding method

Country Status (1)

Country Link
CN (1) CN1294519C (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010012194A1 (en) * 2008-07-30 2010-02-04 华为技术有限公司 Two-dimensional bar code encoding method, decoding method and device, terminal
CN101908133A (en) * 2010-06-01 2010-12-08 福建新大陆电脑股份有限公司 Method and device for decoding bar code
CN102456354A (en) * 2010-10-22 2012-05-16 山东新北洋信息技术股份有限公司 Magnetic information recording method and device, and magnetic ticket

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100433053C (en) * 2005-08-26 2008-11-12 毛山 Two-dimensional bar code based information transfer method and encoding/decoding device
CN100369059C (en) * 2006-01-18 2008-02-13 冯文伦 Matrix type two-dimensional bar code and its encoding and decoding method
CN100377173C (en) * 2006-03-17 2008-03-26 北京紫光捷通科技有限公司 Two-dimensional code construction based on hexadecimal coding
CN100464345C (en) * 2006-11-07 2009-02-25 中国物品编码中心 Method for converting 2D bar code symbols to coded information
CN101882201B (en) * 2010-06-01 2012-06-27 福建新大陆电脑股份有限公司 Barcode decoding chip and method
CN101840501B (en) * 2010-06-01 2012-05-23 福建新大陆电脑股份有限公司 Method and device for decoding bar code image
CN102129585B (en) * 2011-03-03 2013-03-27 天地融科技股份有限公司 Method and system for transmitting information, device for displaying bar code and device for reading bar code
CN102708349B (en) 2012-05-11 2014-11-05 深圳市天朗时代科技有限公司 Method for decoding matrix two-dimensional code
CN103544516B (en) * 2012-07-12 2016-09-07 中国移动通信集团公司 The coding and decoding method of Quick Response Code and Quick Response Code encoder, decoder
CN104463291B (en) * 2013-09-16 2018-06-05 深圳市同盛绿色科技有限公司 Method for anti-counterfeit and mobile equipment
CN106991348B (en) * 2017-03-21 2019-11-15 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN109389195A (en) * 2017-08-04 2019-02-26 武汉矽感科技有限公司 A kind of method generating seal two dimensional code and the seal with the two dimensional code
TWI635462B (en) * 2017-10-18 2018-09-11 大猩猩科技股份有限公司 A method of evaluating the quality of images
CN109688404B (en) * 2017-10-18 2021-06-29 大猩猩科技股份有限公司 Method for evaluating image quality
CN108507596B (en) * 2018-03-05 2020-06-30 中国科学院上海光学精密机械研究所 Two-dimensional gold matrix absolute position coding method and decoding method thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1076798A (en) * 1992-03-16 1993-09-29 欧林巴斯光学工业股份有限公司 Utilize the method and apparatus of CCD/CMD gamma camera to decoding two-dimensional bar code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1076798A (en) * 1992-03-16 1993-09-29 欧林巴斯光学工业股份有限公司 Utilize the method and apparatus of CCD/CMD gamma camera to decoding two-dimensional bar code

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010012194A1 (en) * 2008-07-30 2010-02-04 华为技术有限公司 Two-dimensional bar code encoding method, decoding method and device, terminal
CN101908133A (en) * 2010-06-01 2010-12-08 福建新大陆电脑股份有限公司 Method and device for decoding bar code
CN101908133B (en) * 2010-06-01 2012-06-06 福建新大陆电脑股份有限公司 Method and device for decoding bar code
CN102456354A (en) * 2010-10-22 2012-05-16 山东新北洋信息技术股份有限公司 Magnetic information recording method and device, and magnetic ticket
CN102456354B (en) * 2010-10-22 2015-05-20 山东新北洋信息技术股份有限公司 Magnetic information recording method, device and magnetic ticket

Also Published As

Publication number Publication date
CN1452117A (en) 2003-10-29

Similar Documents

Publication Publication Date Title
CN1294519C (en) Two-D bar code encoding and decoding method
CN1161705C (en) Framless unclosed two-dimensional bar code and method for printing and fetching said bar code
CN1344399A (en) Two-dimensional printed code for storing biometric information and appts. for reading same
EP1559063B1 (en) Orientation-indicating cyclic position codes
CN1708769A (en) Two-dimensional code having superior decoding property which is possible to control the level of error correcting codes, and method for encoding and decoding the same
CN1670763A (en) A two dimensional bar codes and coding-decoding method thereof
CN1089178C (en) Bar code encoding method and system
US9665759B2 (en) Decoding method for matrix two-dimensional code
KR20040014336A (en) Methods and systems for encoding and decoding data in 2d symbology
US7677463B2 (en) Process for tag imaging and decoding of machine readable coded data
JP2006012162A (en) System and method for encoding high density geometric symbol set
WO2010031110A1 (en) Data storage device and encoding/decoding methods
CN1471685A (en) Method and apparatus for fault tolerant data storage on photographs
CN1301456C (en) Method and device for data decoding
CN102004935A (en) LDPC (Low Density Parity Code)-based method for encoding and decoding two dimensional bar codes
CN1862560A (en) 2-D barcode system capable of fast positioning based on positioning graph
CN1471684A (en) Method and apparatus for fault tolerant data storage on photographs
CN1959704A (en) Method for converting 2D bar code symbols to coded information
CN108734048A (en) Various dimensions Quick Response Code based on proprietary code generates and interpretation method
CN1945622A (en) Digital water mark embedding and extracting method and device
CN100356399C (en) Two-dimensional barcode card and its decoding method
US8544741B2 (en) Data block offset encoding method for coordinates
US6641051B1 (en) System for embedded digital data that allows embedding of data around known obstructions
CN1134895C (en) Method and apparatus for compression of electronic ink
CN101063998A (en) Encoding and decoding method of two-dimension bar-code (Q code )

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: WUHAN SYSCAN TECHNOLOGY CO, LTD.

Free format text: FORMER OWNER: XIGAN SCI. + TECH. CO., LTD., SHENZHEN

Effective date: 20060728

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20060728

Address after: 430040 No. 4 Wu Nan Road, Wuhan Taiwan investment zone, East and West Lake District

Applicant after: WUHAN SYSCAN TECHNOLOGY Co.,Ltd.

Address before: 518034 No. 1 World Plaza office building, No. 7002 Hongli West Road, Guangdong, Shenzhen 19A

Applicant before: SHENZHEN SYSCAN TECHNOLOGY Co.,Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: SHANGHAI SYSCAN INFORMATION TECHNOLOGY CO., LTD.

Effective date: 20130308

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: WUHAN, HUBEI PROVINCE TO: 430040 WUHAN, HUBEI PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20130308

Address after: 430040, No. 4, Wu Nan Road, Taiwan business investment zone, Dongxihu District, Hubei, Wuhan

Patentee after: WUHAN SYSCAN TECHNOLOGY Co.,Ltd.

Patentee after: SHANGHAI SYSCAN INFORMATION TECHNOLOGY Co.,Ltd.

Address before: No. 4, Wu Nan Road, Taiwan business investment zone, Dongxihu District, Wuhan

Patentee before: WUHAN SYSCAN TECHNOLOGY Co.,Ltd.

ASS Succession or assignment of patent right

Free format text: FORMER OWNER: SHANGHAI SYSCAN INFORMATION TECHNOLOGY CO., LTD.

Effective date: 20130930

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20130930

Address after: 430040, No. 4, Wu Nan Road, Taiwan business investment zone, Dongxihu District, Hubei, Wuhan

Patentee after: WUHAN SYSCAN TECHNOLOGY Co.,Ltd.

Address before: 430040, No. 4, Wu Nan Road, Taiwan business investment zone, Dongxihu District, Hubei, Wuhan

Patentee before: WUHAN SYSCAN TECHNOLOGY Co.,Ltd.

Patentee before: SHANGHAI SYSCAN INFORMATION TECHNOLOGY Co.,Ltd.

CX01 Expiry of patent term

Granted publication date: 20070110

CX01 Expiry of patent term