[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

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

Two-D bar code encoding and decoding method Download PDF

Info

Publication number
CN1452117A
CN1452117A CN 03117955 CN03117955A CN1452117A CN 1452117 A CN1452117 A CN 1452117A CN 03117955 CN03117955 CN 03117955 CN 03117955 A CN03117955 A CN 03117955A CN 1452117 A CN1452117 A CN 1452117A
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.)
Granted
Application number
CN 03117955
Other languages
Chinese (zh)
Other versions
CN1294519C (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
SHENZHEN XIGAN SCIENCE AND TECHNOLOGY 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 SHENZHEN XIGAN SCIENCE AND TECHNOLOGY Co Ltd filed Critical SHENZHEN XIGAN SCIENCE AND TECHNOLOGY 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

An encode method and relative decode method for 2D bar codes are disclosed. Said encode emthod includes calculating the error correcting code of binary data information, adding it to data information to form new bit stream, determining the number of bar code segments to divide the bit stream into data segments, mask calculation, adding segment control information to each segment, determining the resolution, length and width of bar code, adding beginning and ending patterns and left and right locating pattern, and outputting bar code.

Description

The Code And Decode method of two-dimensional bar code
Technical fieldThe present invention relates to a kind of coding method of two-dimensional bar code and the method for use linearity, contact-type or non-contact type imageing sensor scan decoder.
Background technologyBar 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 is given bar code relatively have been increased greatly.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 schemeThe 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
Supply with filler character when section, one section of last data deficiencies;
C. in each section, add the section control information respectively; Shape and size decision bar according to carrier
Printing resolution, the length and wide of sign indicating number; In bar code, add beginning, end mode, add
Go into the left and right side station-keeping mode; 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, the data cross in each data block is arranged.
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.
Earlier the described binary data information of desiring the raddle sign indicating number is carried out secondary coding among the above-mentioned steps A, obtain new binary data information bit stream.
Described beginning control model among the 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 start-of-record pattern and
The position coordinates of end mode;
B. according to the position of beginning and end mode and the angle of shape calculating direction of scanning and bar code
Degree, judge bar code whether end to end oppositely, left and right sides mirror image whether; According to beginning or end
Pattern is judged the bar code printing resolution;
C. according to the projection of the angle calculation bar code of direction of scanning and bar code, judge in vertical direction
Obtain the position of all sections separator;
D. from first section separator, survey the left row station-keeping mode according to printed resolution
With right side row station-keeping mode, calculate the coordinate of each all unit of row;
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 bar code data character district according to the coordinate of the position of section separator and each row unit
Total data information is recovered bit stream;
H. carrying out selectable anti-mask according to the section control information for bit stream calculates and reciprocal cross
The wrong arrangement, and then carry out error correction calculations with corresponding error correction algorithm and error-correction level;
Recover the preceding bit stream information of barcode encoding.
The view data that can earlier scanning be obtained among the above-mentioned steps A is carried out figure image intensifying pre-service, carries out binary conversion treatment again.
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. scan output image data to memory buffer, and in view data, survey beginning
Pattern or end mode;
If B. detect end mode, then be that bar code is reverse end to end, transfer the decoding of scanning back to
Pattern;
If C. detect the beginning pattern, judge whether left and right sides mirror image, be after then transferring scanning to
Decoding schema;
D. judge the bar code printing resolution according to the beginning 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;
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 separate after changeing scanning
Coded program; Be then whether staggered, if number is arranged according to section control information judgment data
According to staggered, then change scanning back decoding program;
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, extensive
Redoubling 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;
N. judge whether end mode of next line scan-data, otherwise get back to step G; It is bar then
The sign indicating number end of scan.
Judge among the above-mentioned steps 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 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 drawingsThe 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.
EmbodimentThe illumination of contact scanner is even in bar code recognizing apparatus, it is little that the image that obtains and original image are compared nonlinear distortion, picture quality is good, therefore can design a kind of structure matrix two-dimensional barcode of simplicity to greatest extent, thereby can improve the information storage capacity of equal area printing carrier.
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 by beginning instruction character 101 in the beginning pattern 10 multiplicity determine width, be 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; According to last a pair of left and right side station-keeping mode discal patch empty the position that just can estimate and calculate, preserve delegation unit below it, position.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.
Of the present invention can be to have 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 number encoder 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.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.
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, each coding takies two bytes, have a large amount of residue coding, 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;
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.
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 the contact scanning of 1:1.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 left and right sides skidding station-keeping mode (30), locate and the section of reading control information (40);
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 (10)

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
Supply with filler character when data segment, one section of last data deficiencies;
C. in described each section, add the section control information respectively; Shape and size according to carrier are determined
Decide printing resolution, the length and wide of bar code; In bar code, add beginning pattern (10),
End mode (20) adds left positioner pattern (30), right positioner pattern (40);
The output bar code.
2, two-dimensional bar code coding method according to claim 1, it 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, data cross in each data block is arranged, form 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, earlier the described binary data information of desiring the raddle sign indicating number is carried out secondary coding in the described steps A, obtains 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 are 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 are 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), note
Record the position coordinates of described beginning pattern and end mode;
B. calculate direction of scanning and bar code according to the position and the shape of described beginning and end mode
Angle, judge bar code whether end to end oppositely, left and right sides mirror image whether; Open according to described
Beginning or end mode are judged the bar code printing resolution;
C. according to the projection of the angle calculation bar code of described direction of scanning and bar code in vertical direction,
Judge the position that obtains all sections separators (60);
D. from first section separator, survey the left row station-keeping mode according to printed resolution
(30) and right side row station-keeping mode (40), calculate the coordinate of each all unit of row;
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 bar yardage according to the position of described section separator (60) and the coordinate of each row unit
According to the total data information in symbol district (50), recover bit stream;
H. carrying out selectable anti-mask according to the section control information for bit stream calculates and reciprocal cross
The wrong arrangement, and then carry out error correction calculations with corresponding error correction algorithm and error-correction level;
I. recover the preceding bit stream information of barcode encoding.
8, two-dimensional bar code coding/decoding method according to claim 7 is characterized in that, will scan the view data that obtains in the described steps A earlier and carry out figure image intensifying pre-service, carries out binary conversion treatment again.
9, 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 steps:
A. scan output image data to memory buffer, and in view data, survey the beginning mould
Formula (10) or end mode (20);
If B. detect end mode (20), then be that bar code is reverse end to end, transfer scanning to after
Decoding schema;
If C. detect beginning pattern (10), judge whether left and right sides mirror image, be then to transfer to sweeping
Retouch the back decoding schema;
D. judge the bar code printing resolution according to the beginning 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;
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 the decoding of scanning back
Program; Be then whether staggered, if there are data to hand over according to section control information judgment data
Mistake is then changeed scanning back decoding program;
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;
N. judge whether end mode (20) of next line scan-data, otherwise get back to step G; Be
Then bar code scan finishes.
10, two-dimensional bar code coding/decoding method according to claim 9, 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 true CN1452117A (en) 2003-10-29
CN1294519C 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 (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN100433053C (en) * 2005-08-26 2008-11-12 毛山 Two-dimensional bar code based information transfer method and encoding/decoding device
CN100464345C (en) * 2006-11-07 2009-02-25 中国物品编码中心 Method for converting 2D bar code symbols to coded information
CN101840501A (en) * 2010-06-01 2010-09-22 福建新大陆电脑股份有限公司 Method and device for decoding bar code image
CN101882201A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Barcode decoding chip and method
CN102129585A (en) * 2011-03-03 2011-07-20 北京天地融科技有限公司 Method and system for transmitting information, device for displaying bar code and device for reading bar code
CN102708349A (en) * 2012-05-11 2012-10-03 深圳市天朗时代科技有限公司 Method for decoding matrix two-dimensional code
CN101639899B (en) * 2008-07-30 2013-08-28 华为技术有限公司 Methods and devices for encoding and decoding two-dimension code and terminal
CN103544516A (en) * 2012-07-12 2014-01-29 中国移动通信集团公司 Two-dimensional code encoding and decoding method, two-dimensional code encoder and two-dimensional code decoder
CN104463291A (en) * 2013-09-16 2015-03-25 深圳市同盛绿色科技有限公司 Anti-counterfeiting method and mobile device
CN106991348A (en) * 2017-03-21 2017-07-28 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN108507596A (en) * 2018-03-05 2018-09-07 中国科学院上海光学精密机械研究所 Two-dimentional gold matrixes method for encoding absolute position and its coding/decoding method
TWI635462B (en) * 2017-10-18 2018-09-11 大猩猩科技股份有限公司 A method of evaluating the quality of images
WO2019024628A1 (en) * 2017-08-04 2019-02-07 武汉矽感科技有限公司 Method for generating two-dimensional code of stamp and stamp with two-dimensional code
CN109688404A (en) * 2017-10-18 2019-04-26 大猩猩科技股份有限公司 A method of the assessment quality of image

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908133B (en) * 2010-06-01 2012-06-06 福建新大陆电脑股份有限公司 Method and device for decoding bar code
CN102456354B (en) * 2010-10-22 2015-05-20 山东新北洋信息技术股份有限公司 Magnetic information recording method, device and magnetic ticket

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5319181A (en) * 1992-03-16 1994-06-07 Symbol Technologies, Inc. Method and apparatus for decoding two-dimensional bar code using CCD/CMD camera

Cited By (24)

* 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
CN101639899B (en) * 2008-07-30 2013-08-28 华为技术有限公司 Methods and devices for encoding and decoding two-dimension code and terminal
CN101840501A (en) * 2010-06-01 2010-09-22 福建新大陆电脑股份有限公司 Method and device for decoding bar code image
CN101882201A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Barcode decoding chip and method
CN101882201B (en) * 2010-06-01 2012-06-27 福建新大陆电脑股份有限公司 Barcode decoding chip and method
CN102129585A (en) * 2011-03-03 2011-07-20 北京天地融科技有限公司 Method and system for transmitting information, device for displaying bar code and device for reading bar code
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
US9665759B2 (en) 2012-05-11 2017-05-30 Shenzhen Mpr Technology Co., Ltd Decoding method for matrix two-dimensional code
CN102708349A (en) * 2012-05-11 2012-10-03 深圳市天朗时代科技有限公司 Method for decoding matrix two-dimensional code
CN103544516A (en) * 2012-07-12 2014-01-29 中国移动通信集团公司 Two-dimensional code encoding and decoding method, two-dimensional code encoder and two-dimensional code decoder
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
CN104463291A (en) * 2013-09-16 2015-03-25 深圳市同盛绿色科技有限公司 Anti-counterfeiting method and mobile device
CN106991348A (en) * 2017-03-21 2017-07-28 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN106991348B (en) * 2017-03-21 2019-11-15 浙江华睿科技有限公司 A kind of bar code decoding method and device
WO2019024628A1 (en) * 2017-08-04 2019-02-07 武汉矽感科技有限公司 Method for generating two-dimensional code of stamp and stamp with two-dimensional code
TWI635462B (en) * 2017-10-18 2018-09-11 大猩猩科技股份有限公司 A method of evaluating the quality of images
CN109688404A (en) * 2017-10-18 2019-04-26 大猩猩科技股份有限公司 A method of the assessment quality of image
CN108507596A (en) * 2018-03-05 2018-09-07 中国科学院上海光学精密机械研究所 Two-dimentional gold matrixes method for encoding absolute position and its coding/decoding method
CN108507596B (en) * 2018-03-05 2020-06-30 中国科学院上海光学精密机械研究所 Two-dimensional gold matrix absolute position coding method and decoding method thereof

Also Published As

Publication number Publication date
CN1294519C (en) 2007-01-10

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
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
EP1559063B1 (en) Orientation-indicating cyclic position codes
CN1670763A (en) A two dimensional bar codes and coding-decoding method thereof
US9665759B2 (en) Decoding method for matrix two-dimensional code
CN1215430C (en) Method and apparatus for fault tolerant data storage on photographs
CN1089178C (en) Bar code encoding method and system
CN1882090A (en) Image encoder and image decoder
US7677463B2 (en) Process for tag imaging and decoding of machine readable coded data
KR20040014336A (en) Methods and systems for encoding and decoding data in 2d symbology
CN1326165A (en) Method and device for producing and decoding clear visual barcodes
JP2007317184A (en) Two-dimensional bar code, and encoding and decoding method thereof
CN1471685A (en) Method and apparatus for fault tolerant data storage on photographs
WO2010031110A1 (en) Data storage device and encoding/decoding methods
CN1301456C (en) Method and device for data decoding
CN1959704A (en) Method for converting 2D bar code symbols to coded information
CN1862560A (en) 2-D barcode system capable of fast positioning based on positioning graph
EP1382193A1 (en) Detecting halftone modulations embedded in an image
CN1945622A (en) Digital water mark embedding and extracting method and device
US8544741B2 (en) Data block offset encoding method for coordinates
CN1455370A (en) Two-dimensional barcode card and its decoding method
CN1134895C (en) Method and apparatus for compression of electronic ink
CN1458619A (en) Two-way readable two-dimensional bar code system and its reading method

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