CN106845593A - A kind of rectangle fixes dot matrix information encoding-decoding method - Google Patents

A kind of rectangle fixes dot matrix information encoding-decoding method Download PDF

Info

Publication number
CN106845593A
CN106845593A CN201710032695.5A CN201710032695A CN106845593A CN 106845593 A CN106845593 A CN 106845593A CN 201710032695 A CN201710032695 A CN 201710032695A CN 106845593 A CN106845593 A CN 106845593A
Authority
CN
China
Prior art keywords
binary
information
coding
matrix
string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710032695.5A
Other languages
Chinese (zh)
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 University WHU
Original Assignee
Wuhan University WHU
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 University WHU filed Critical Wuhan University WHU
Priority to CN201710032695.5A priority Critical patent/CN106845593A/en
Publication of CN106845593A publication Critical patent/CN106845593A/en
Pending legal-status Critical Current

Links

Classifications

    • 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

Abstract

Dot matrix information encoding-decoding method is fixed the present invention relates to a kind of rectangle, based on Data Matrix yards of code segment rule, by user according to the rectangular dimension of the information custom coding of required storage, the information of storage will be needed to be encoded in a specific sequence with based on bit and in the form of providing BCH error correction, information is then read using the information decoding method corresponding with information coding again.Therefore, the invention has the advantages that:1st, coding size is can customize, the redundancy of effective information is reduced;Using Q-character as few as possible when the 2nd, encoding, increase the digit of codified effective information;3rd, the two-dimensional bar code for encoding out has uniqueness, can be used for commodity counterfeit prevention.

Description

A kind of rectangle fixes dot matrix information encoding-decoding method
Technical field
Dot matrix information encoding-decoding method is fixed the invention belongs to informatics, more particularly to a kind of rectangle.
Background technology
Bar code has obtained the common concern of people since the appearance, and development speed is very rapid.But with modern high The development of new technology, in order to meet the need for Protean information represents, an urgent demand bar code is in a limited number of what space It is interior to represent more information.Thus, in order to solve the insurmountable problem of bar code, two-dimensional bar code arises at the historic moment.It is used The geometrical patterns such as rectangle, point, hexagon represent information, are come using several geometrical bodies corresponding with binary system during coding Word numerical information is represented, is then input into or photoelectric scanning device automatically identifying and reading information by image during decoding.Its use, greatly Improve the speed of data acquisition and information processing, improve operating efficiency, and for the scientific and modernization of management is made Very big contribution.With the gradually popularization of smart mobile phone, Quick Response Code codec functions software almost becomes smart mobile phone Standard configuration software.Conventional or well-known two-dimensional bar code coding mechanism has Data Matrix, Maxi Code, QRCode, the Chinese at present Letter code etc..
DataMatrix yards is a kind of matrix two-dimensional barcode in numerous two-dimensional bar codes, and its maximum feature is exactly density Height, its minimum dimension is the code of minimum in current all bar codes.In addition, the DataMatrix yards of error correcting code for employing complexity Technology so that the coding has superpower contamination resistance.But, on the one hand due to can only in Data Matrix encoding mechanisms Selection certain size is encoded, and the size of current minimum Data Matrix is also 10*10 rectangular areas, when storage a small amount of Bulk information position redundancy can be caused during information;On the other hand, the Q-character wanted needed for Data Matrix yards is excessive, certain Being occupied in degree can enter the information bit of row information coding.In order to solve the two problems, the present invention is by having used for reference two dimension The code segment rule of Data Matrix encoding mechanisms in bar code, has invented a kind of fixed dot matrix letter of self-defined rectangular dimension Breath decoding method.
The content of the invention
The present invention is made by oneself by user based on Data Matrix yards of code segment rule according to the information of required storage The rectangular dimension of justice coding, it would be desirable to the information of storage with based on bit and in the form of BCH error correction is provided in a specific sequence Encoded, information is then read using the information decoding method corresponding with information coding again.
The technical scheme is that a kind of rectangle fixing point of bar code generation software zxing designs of being increased income using third party Battle array information encoding-decoding method, including:
The step of information is encoded:The width and height of information coding rectangle are determined first, are then converted into coding information String of binary characters, and the string of binary characters of the coding information comprising error correcting code is obtained based on Bose-Chaudhuri-Hocquenghem Code principle, secondly create One binary matrix, sets the value of the Q-character of binary matrix and by the binary-coded character of the coding information comprising error correcting code Go here and there and be put into binary matrix region in addition to Q-character according to " it " font order, finally covered binary matrix Code, and the matrix is carried out into coloring according to " 0 " " 1 " be converted to picture;
The step of information is decoded:User is parsed using decoding program to encoded picture, and picture is converted into binary system Bitmap obtains glyph image, then finds four summits of glyph image and determines four correct positions on summit, secondly basis Incoming parameter is that glyph image is corrected, binary matrix is transformed to, finally by binary matrix by the width of coding and height Solution mask extracts binary message to carry out BCH error correction and obtains correct string of binary characters, and is converted to and is exported in plain text.
Dot matrix information encoding-decoding method is fixed in a kind of above-mentioned rectangle, is specifically included the step of described information is encoded:
Step 1, the information encoded according to needed for calculating increases the binary length after Bose-Chaudhuri Hocquenghem error correction codes, it is determined that the chi of coding It is very little, i.e. the width of coding region and height, wherein the width for encoding needs the value for meeting (width -1) * (highly -1) to subtract with height The value that the information of coding increases the binary length after Bose-Chaudhuri Hocquenghem error correction codes is no less than 3, and the coding size that will be determined is passed as parameter In entering coded program;
Step 2, string of binary characters is converted to by the information of required coding, and the digit pair of error correction is needed according to hiding information The character string is grouped, and every group contains k binary message, and calculate every group of binary message using Bose-Chaudhuri-Hocquenghem Code principle N Bose-Chaudhuri Hocquenghem error correction codes;If there is certain group binary message after grouping less than k in string of binary characters, should be first in binary system Character string stem adds " 0 " and supplies, and until each packet all includes k binary digit, then string of binary characters after supplying enters Row packet is calculated Bose-Chaudhuri Hocquenghem error correction codes;Every group of Bose-Chaudhuri Hocquenghem error correction codes are inserted into phase respectively after the Bose-Chaudhuri Hocquenghem error correction codes for obtaining each group After answering effective information, the string of binary characters of the coding information comprising error correcting code is formed, the two of as final required coding enters Information processed;
Step 3, creates a width and is equal to custom coding width in step 1, highly equal to custom coding in step 1 The binary matrix of height, and each information bit is all set to " 1 " with bottommost a line by most the first from left row of binary matrix, will It is used as the Q-character for encoding;Then, since binary matrix residue coding region one one the information bit in the most lower left corner The string of binary characters that step 2 finally draws is put into the coding region of binary matrix successively according to the order of "the" shape for position In, the most upper right corner, upper right corner left side and the downside adjacent position of binary matrix are skipped when noting being put into, when binary message is long Selection adds 0 and supplies at end when degree can place length less than rectangular area;Finally, by the information in the most upper right corner of binary matrix Position is " 1 ", and upper right corner left side adjacent position is set to " 0 ", and upper right corner downside adjacent position is equally set to " 0 ";By binary system square These three information bit positions of battle array are set to the Q-character of coding;
Step 4, select a kind of mask pattern to enter line mask in addition to Q-character to the binary matrix that step 3 is ultimately produced, Enable that the region having except color and white in the two-dimensional bar code figure for ultimately producing and white portion ratio are optimal Distribution;
Step 5, the binary matrix after mask is coloured according to " 0 ", " 1 " and picture is converted to.
Dot matrix information encoding-decoding method is fixed in a kind of above-mentioned rectangle, is specifically included the step of described information is decoded:
Step 1, user will need the picture of decoding to be decoded with corresponding decoding program, and by the coding size of picture Size is used as in the incoming decoding program of parameter;Picture is converted into the graphical diagram that binary bitmap obtains image by decoding program first Picture, then draws the position of glyph image, finally determines four summits of glyph image;The method for drawing picture position is from figure A frame of 30X30 is drawn as middle, is then carried out to four sides successively, whether have the point of black on four sides of detection, until every one side Untill point all without black;
Initial ranges are accomplished by determining glyph image four summits at angle after determining, have four summits at angle just can be with Perspective transform is carried out, symbolic code image also can just take out;First at four angles of big detection block with oblique 45 degree in decoding program Straight line go detection:
It is scanned according to direction shown in four arrows at angle in figure, the point for detecting first black is returned to;If Stain is not detected on line, and just scan line is advanced to diagonal;Finally can just find four summits at angle;
Step 2, determines the correct position on each summit of glyph image;The scanning of bresenham algorithms is primarily based on to draw respectively Whether line is straight line between individual summit, such that it is able to the intersection point summit of two straight lines to be defined as the lower-left of glyph image Angular vertex, is not that the intersection point summit of straight line is defined as the upper right angular vertex of glyph image by two;Then by distance between two points From comparing determine the upper left corner and the bottom right angular vertex of glyph image;
Step 3, the coding size according to the incoming picture of step 1 determines each how many module in glyph image each edge, Being then based on SampleGrid carries out perspective transform and sampling transformation, and the glyph image in original image is corrected, me is transformed to Decode the regular of needs, the sign matrix in units of module is the binary matrix of image;
Step 4, the binary matrix solution mask that will be obtained in step 3 first obtains correct binary matrix, Ran Houzai The binary message of data field in correct binary matrix is extracted successively according to coding rule, then packet is carried out BCH decodings obtain correct effective information, and effective information finally is converted into plaintext version is exported, and complete decoding.
Therefore, the invention has the advantages that:1st, user can coding information as needed length custom coding size, On the one hand user can be met to encoding some particular requirements of size, encoded picture on the other hand can be farthest reduced The redundancy of middle effective information;2nd, the Q-character digit used in two-dimensional bar code coding rule conventional at present is compared to, this Invention in coding the Q-character digit that uses considerably less than they, so as to increased codified effective information to a certain extent Digit;3rd, coding rule of the invention is different from presently disclosed all of two-dimensional bar code coding rule, and for according to The two-dimensional bar code of the information coding method coding in the present invention, can only be solved according to the information decoding method proposed in the present invention Code, therefore the two-dimensional bar code that information is encoded out has uniqueness, in commodity sign is applied the present invention to, can meet Businessman carries out false proof demand to commodity.
Brief description of the drawings
Fig. 1 is the coding flow chart of information of the invention.
Fig. 2 is the decoding process figure of information of the invention.
Fig. 3 be information of the present invention decoding extraction step in by the approximate range schematic diagram that is obtained in step 1.
Fig. 4 be information of the present invention decoding extraction step in by decoding program in step 1 at four angles of big detection block The schematic diagram gone after detection with oblique 45 degree of straight line.
Fig. 5 is the Quick Response Code schematic diagram of generation in the present invention.
Specific embodiment
Error-correcting performance of the present invention based on the QR yards of initial data to encoding, it would be desirable to which hiding information is with based on bit And provide the form of error correction be embedded into coding in, then extracted using the extracting method of specific hiding information again so that Reach the purpose of transmission hiding information.
The method that the present invention is provided can realize flow with computer software technology.
For information coding referring to Fig. 1, embodiment is " 123044162062 " with coding information, is carried for coding information It is as follows for carrying out a specific elaboration as a example by 4 error correction to flow of the invention:
Definition t is BCH error correction digits, and s is the string of binary characters of coding information conversion, and t is that coding information increase BCH entangles String of binary characters after error code
Step 1, the information encoded according to needed for calculating increases the binary length after Bose-Chaudhuri Hocquenghem error correction codes, it is determined that the chi of coding It is very little, i.e. the width of coding region and height, wherein the width for encoding needs the value for meeting (width -1) * (highly -1) to subtract with height The value that the information of coding increases the binary length after Bose-Chaudhuri Hocquenghem error correction codes is no less than 3, and the coding size that will be determined is passed as parameter In entering coded program.
The specific implementation process of embodiment is described as follows:
Coding information is converted into string of binary characters is:S= 1110010100110000000001110101000001110, length is 37, and due to needing to entangle four dislocations altogether, selection is by s points It is two groups, every group carries out Bose-Chaudhuri-Hocquenghem Code, i.e. t=2, basis BCH (31,21) code is chosen according to Bose-Chaudhuri-Hocquenghem Code principle, i.e., 21 effectively 10 Bose-Chaudhuri Hocquenghem error correction codes of text string generation of information.Therefore the binary message comprising Bose-Chaudhuri Hocquenghem error correction codes that need to be finally embedded in should have 62 Position, so the coding size minimum that can be chosen should be 7*12, in this example in order to not waste the information bit of codified as far as possible, I To choose the width of coding be 12, be highly 7.
Step 2, string of binary characters is converted to by the information of required coding, and the digit pair of error correction is needed according to hiding information The character string is grouped, and every group contains k binary message, and calculate every group of binary message using Bose-Chaudhuri-Hocquenghem Code principle N Bose-Chaudhuri Hocquenghem error correction codes.If there is certain group binary message after grouping less than k in string of binary characters, should be first in binary system Character string stem adds " 0 " and supplies, and until each packet all includes k binary digit, then string of binary characters after supplying enters Row packet is calculated Bose-Chaudhuri Hocquenghem error correction codes.Every group of Bose-Chaudhuri Hocquenghem error correction codes are inserted into phase respectively after the Bose-Chaudhuri Hocquenghem error correction codes for obtaining each group After answering effective information, the string of binary characters of the coding information comprising error correcting code is formed, the two of as final required coding enters Information processed.
The specific implementation process of embodiment is described as follows:
S is divided to first be two groups, every group of length 21, respectively:000001110010100110000、 000001110101000001110。
Then two groups of Bose-Chaudhuri Hocquenghem error correction codes of binary message are calculated respectively.
The definition of BCH code is:If the generator polynomial of cyclic code has following form:
G (x)=LCM [m1(x), m3(x) ..., m2t-1(x)] wherein LCM represents minimal common multiple, t is error correction number, mi X () is prime polynomial, the then cyclic code for thus generating referred to as BCH code.
BCH code part irreducible function table is as follows:
2 ranks 1 7
3 ranks 1 13
4 ranks 1 23 3 37 5 07
5 ranks 1 45 3 75 5 67
Bose-Chaudhuri Hocquenghem error correction codes can be obtained using BCH (31,21) code by the embodiment of step 1 in the present embodiment, t=2, then n=31 =25- 1, by inquiring about above-mentioned irreducible function Biao Ke get:
m1(x)=(45)8=100101=x5+x2+1;
m3(x)=(75)8=111101=x5+x4+x3+x2+1;
So g (x)=LCM [m1(x), m3(x)]=x10+x9+x8+x6+x5+x3+ 1=11101101001, by every group 21 Binary message carries out Modulo-two operation to generator polynomial and obtains the Bose-Chaudhuri Hocquenghem error correction codes of two groups of binary messages being respectively: 1000101110、0011110100。
Finally error correcting code is inserted and obtain the coding information comprising Bose-Chaudhuri Hocquenghem error correction codes behind corresponding binary system effective information String of binary characters.Character string t will be obtained in above-mentioned error correcting code insertion character string s in this example, the result that can obtain t is: 00000111001010011000010001011100000011101010000011100011110100。
Step 3, creates a width and is equal to custom coding width in step 1, highly equal to custom coding in step 1 The binary matrix of height, and each information bit is all set to " 1 " with bottommost a line by most the first from left row of binary matrix, will It is used as the Q-character for encoding.Then, since binary matrix residue coding region one one the information bit in the most lower left corner The string of binary characters that step 2 finally draws is put into the coding region of binary matrix successively according to the order of "the" shape for position In, the most upper right corner, upper right corner left side and the downside adjacent position of binary matrix are skipped when noting being put into, when binary message is long Selection adds 0 and supplies at end when degree can place length less than rectangular area.Finally, by the information in the most upper right corner of binary matrix Position is " 1 ", and upper right corner left side adjacent position is set to " 0 ", and upper right corner downside adjacent position is equally set to " 0 ".By binary system square These three information bit positions of battle array are set to the Q-character of coding.
The specific implementation process of embodiment is as follows:
It can be seen from implementation process according to step 1, the width of the coding size of selection is 12, is highly 7.Therefore create first One size is the binary matrix of 7*12, and each information bit is all set to bottommost a line by a most right row of matrix " 1 ", as the Q-character of coding.The binary matrix for obtaining is as follows:Subsequently illustrate to be borrowed in figure below for convenience Coordinate diagram represents each position in binary matrix
Then, the information bit of last cell i.e. from coordinate it is (1,5) since binary matrix residue coding region Position starts the most upper right corner and its phase that character string t is skipped an order according to "the" shape binary matrix successively Ortho position is put in the coding region of binary matrix, and because the length of t is 62, codified zone length is (6*11) -3= 63, therefore one " 0 " need to be added supply.Being entirely insertable rear binary matrix is:
Finally, it is that coordinate is set to " 1 " for (11,0) by the information bit in the most upper right corner of binary matrix, upper right corner left side phase Ortho position is put i.e. coordinate and is set to " 0 " for (10,0), and upper right corner downside adjacent position is that coordinate is equally set to " 0 " for (11,1).By two These three information bit positions of system matrix are set to the Q-character of coding.
Step 4, select a kind of mask pattern to enter line mask in addition to Q-character to the binary matrix that step 3 is ultimately produced, Enable having in the two-dimensional bar code figure for ultimately producing color (except white) region be optimal with white portion ratio to divide Cloth.
The specific implementation process of embodiment is as follows:
For simplicity, the mask scheme of selection is in this example:By the region in binary matrix in addition to Q-character And information bit carries out " negating " operation, the binary matrix for finally obtaining is:
Step 5, the binary matrix after mask is coloured according to " 0 ", " 1 " and picture is converted to.
The specific implementation process of embodiment is as follows:
The binary matrix that step 4 embodiment is ultimately generated is coloured, because common encoded picture is black-and-white two color, Therefore binary digit is colored as black for " 1 " in this example, binary digit is colored as white for " 0 ", two for ultimately generating Dimension bar code picture is as shown in Figure 5.
For the decoding of information, referring to Fig. 2, embodiment is by taking the picture generated in above-mentioned example as an example to the flow of this programme Do a specific elaboration:
Definition:S is the string of binary characters for extracting the coding information comprising error correcting code, and T is correct coding information Effective string of binary characters, M be coding information in plain text
Step 1, user will need the picture of decoding to be decoded with corresponding decoding program, and by the coding size of picture Size is used as in the incoming decoding program of parameter.Picture is converted into the symbolic code that binary bitmap obtains image by decoding program first Image, then substantially draws the position of glyph image, finally determines four summits of glyph image.
The specific implementation process of embodiment is as follows:
First, from the coding of the image, the coding size of image is 7*12, is 12 by the width of image, is highly 7 As in the incoming decoding program of parameter.
Then, binary bitmap is converted the image into, symbol is found out using the specific method in above- mentioned information decoding step 1 The approximate range of image, determines four apex coordinates of glyph image, and A, B, C, D are designated as respectively.Four for determining in this example Apex coordinate is respectively A (23.05,53.14), B (25.12,166.53), C (216.85,167.32), D (218.44, 54.45)。
Step 2, determines the correct position on each summit of glyph image.Drawn first with the scanning of bresenham algorithms each Whether line is a solid line between individual summit, such that it is able to the intersection point summit of two solid lines to be defined as the lower-left of glyph image Angular vertex, is not that the intersection point summit of solid line is defined as the upper right angular vertex of glyph image by two.Then by distance between two points From comparing determine the upper left corner and the bottom right angular vertex of glyph image.
The specific implementation process of embodiment is as follows:
It is utilized respectively bresenham algorithms and calculates A-B, whether A-C, A-D, B-C, B-D, C-D is two-by-two one between summit Bar solid line, draws summit A-B in this example, is solid line between B-C, and summit A-D is not solid line between C-D, so as to scheme in this example As correct lower left corner apex coordinate is B (25.12,166.53), upper right angular coordinate is D (218.44,54.45).For summit C (216.85,167.32)) and summit A (23.05,53.14), the distance for arriving summit B and summit D respectively according to them can draw The apex coordinate in the upper left corner is A (23.05,53.14), and the apex coordinate in the lower right corner is C (216.85,167.32).
Step 3, the coding size according to the incoming picture of step 1 determines each how many module in glyph image each edge, Then perspective transform and sampling transformation are carried out using SampleGrid, the glyph image in original image is corrected, me is transformed to Decode the regular of needs, the sign matrix in units of module is the binary matrix of image.
The specific implementation process of embodiment is as follows:
In this example, the coding size of picture is that width is 12, is highly 7, so as to can determine that two up and down of glyph image Respectively there are 12 modules on side, and respectively there are 7 modules on the side of left and right two, glyph image further is carried out into perspective transform and sampling transformation can The binary matrix for obtaining 7*12 is as follows:
Step 4, the binary matrix solution mask that will be obtained in step 3 first obtains correct binary matrix, Ran Houzai The binary message of data field in correct binary matrix is extracted successively according to coding rule, then packet is carried out BCH decodings obtain correct effective information, and effective information finally is converted into plaintext version is exported, and complete decoding.
The specific implementation process of embodiment is as follows:
First, the binary matrix of step 3 embodiment is carried out into solution mask according to the mask scheme for encoding selection, will two All binary systems in system matrix in addition to Q-character carry out inversion operation, and the correct binary matrix for obtaining is as follows:
Then the binary message of data field in binary matrix is extracted the string of binary characters for obtaining successively is: 00000111001010011000010001011100000011101010000011100011 1101000, due to being compiled in information During code, BCH (31,21) code is used, so the string length of coding should be 62, removal said extracted two entering out The latter 1 correct string of binary characters for obtaining of character string processed should be:
S=000001110010100110000100010111000000111010100000111000 11110100
Two groups are divided into by every group 31 to character string S, BCH decodings is carried out to every group respectively, correct effective information is obtained. Wherein to packet character string 1:0000011100101001100001000101110 carries out decoding the correct information for obtaining and is: 000001110010100110000;To packet character string 2:0000011101010000011100011110100 decode To correct information be:000001110101000001110.Finally, the correct information for each group decoding being obtained is suitable according to being grouped Sequence splice the string of binary characters of the coding information for obtaining final, and final result is:T= 000001110010100110000000001110101000001110
Finally, T is converted into metric integer, M=123044162062.
Specific embodiment described herein is only to the spiritual explanation for example of the present invention.Technology neck belonging to of the invention The technical staff in domain can be made various modifications or supplement to described specific embodiment or be replaced using similar mode Generation, but without departing from spirit of the invention or surmount scope defined in appended claims.

Claims (3)

1. rectangle fixes dot matrix information encoding-decoding method and system, it is characterised in that including:
The step of information is encoded:The width and height of information coding rectangle are determined first, coding information is then converted into two and is entered Character string processed, and the string of binary characters of the coding information comprising error correcting code is obtained based on Bose-Chaudhuri-Hocquenghem Code principle, secondly create one Binary matrix, sets the value of the Q-character of binary matrix and presses the string of binary characters of the coding information comprising error correcting code The region in addition to Q-character is put into binary matrix according to " it " font order, binary matrix is finally carried out into mask, and The matrix is carried out into coloring according to " 0 " " 1 " and is converted to picture;
The step of information is decoded:User is parsed using decoding program to encoded picture, and picture is converted into binary bitmap Glyph image is obtained, four summits of glyph image is then found and is determined four correct positions on summit, secondly according to incoming Parameter be coding width with height by glyph image correct, be transformed to binary matrix, finally binary matrix solution is covered Code extracts binary message to carry out BCH error correction and obtains correct string of binary characters, and is converted to and is exported in plain text.
2. rectangle according to claim 1 fixes dot matrix information encoding-decoding method and system, it is characterised in that described information The step of coding, specifically includes:
Step 1, the information encoded according to needed for calculating increases the binary length after Bose-Chaudhuri Hocquenghem error correction codes, it is determined that the size of coding, i.e., The width of coding region and height, wherein the width for encoding needs the value for meeting (width -1) * (height -1) to subtract coding with height Information increase the value of the binary length after Bose-Chaudhuri Hocquenghem error correction codes and be no less than 3, and the coding size that will be determined is used as the incoming volume of parameter In coded program;
Step 2, string of binary characters is converted to by the information of required coding, and the digit of error correction is needed to the word according to hiding information Symbol string is grouped, and every group contains k binary message, and calculate every group the n of binary message using Bose-Chaudhuri-Hocquenghem Code principle Bose-Chaudhuri Hocquenghem error correction codes;If there is certain group binary message after grouping less than k in string of binary characters, should be first in binary-coded character String stem adds " 0 " and supplies, and until each packet all includes k binary digit, then string of binary characters after supplying is divided Group is calculated Bose-Chaudhuri Hocquenghem error correction codes;Being inserted into every group of Bose-Chaudhuri Hocquenghem error correction codes respectively after the Bose-Chaudhuri Hocquenghem error correction codes for obtaining each group should mutually have After effect information, the string of binary characters of the coding information comprising error correcting code is formed, the binary system of as final required coding is believed Breath;
Step 3, creates a width and is equal to custom coding width in step 1, highly equal to custom coding in step 1 highly Binary matrix, and by most the first from left of binary matrix row, each information bit is all set to " 1 " with bottommost a line, is made It is the Q-character of coding;Then, since binary matrix residue coding region in the most lower left corner information bit one one by Be put into the string of binary characters that step 2 finally draws in the coding region of binary matrix successively by the order according to "the" shape, The most upper right corner, upper right corner left side and the downside adjacent position of binary matrix are skipped when noting being put into, when binary message length Selection adds 0 and supplies at end when can place length less than rectangular area;Finally, by the information bit in the most upper right corner of binary matrix It is set to " 1 ", upper right corner left side adjacent position is set to " 0 ", upper right corner downside adjacent position is equally set to " 0 ";By binary matrix These three information bit positions be set to coding Q-character;
Step 4, select a kind of mask pattern to enter line mask in addition to Q-character to the binary matrix that step 3 is ultimately produced so that The region having except color and white and white portion in the two-dimensional bar code figure for ultimately producing being capable of the optimal distributions of ratio;
Step 5, the binary matrix after mask is coloured according to " 0 ", " 1 " and picture is converted to.
3. rectangle according to claim 1 fixes dot matrix information encoding-decoding method and system, it is characterised in that described information The step of decoding, specifically includes:
Step 1, user will need the picture of decoding to be decoded with corresponding decoding program, and by the coding size of picture As in the incoming decoding program of parameter;Picture is converted into the glyph image that binary bitmap obtains image by decoding program first, Then the position of glyph image is drawn, four summits of glyph image are finally determined;The method for drawing picture position is from image A frame of 30X30 is drawn in centre, then carries out to four sides successively, and whether detection has the point of black on four sides, until every one side all Untill there is no the point of black;
Initial ranges are accomplished by determining four summits at angle of glyph image that the summit for having four angles can be carried out after determining Perspective transform, symbolic code image also can just take out;It is straight with oblique 45 degree first at four angles of big detection block in decoding program Line goes detection:
Oblique 45 degree of directions according to four angles are scanned, and the point for detecting first black is returned to;If do not had on line Stain is detected, just scan line is advanced to diagonal;Finally can just find four summits at angle;
Step 2, determines the correct position on each summit of glyph image;It is primarily based on the scanning of bresenham algorithms and show that each is pushed up Whether line is straight line between point, and the lower left corner such that it is able to the intersection point summit of two straight lines to be defined as glyph image is pushed up Point, is not that the intersection point summit of straight line is defined as the upper right angular vertex of glyph image by two;Then by distance between two points Compare the upper left corner and bottom right angular vertex for determining glyph image;
Step 3, the coding size according to the incoming picture of step 1 determines each how many module in glyph image each edge, then Perspective transform and sampling transformation are carried out based on SampleGrid, the glyph image in original image is corrected, our solutions are transformed to It is regular that code needs, and the sign matrix in units of module is the binary matrix of image;
Step 4, the binary matrix solution mask that will be obtained in step 3 first obtains correct binary matrix, then further according to Coding rule extracts the binary message of data field in correct binary matrix successively, and then packet carries out BCH solutions Code obtains correct effective information, and effective information finally is converted into plaintext version is exported, and completes decoding.
CN201710032695.5A 2017-01-16 2017-01-16 A kind of rectangle fixes dot matrix information encoding-decoding method Pending CN106845593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710032695.5A CN106845593A (en) 2017-01-16 2017-01-16 A kind of rectangle fixes dot matrix information encoding-decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710032695.5A CN106845593A (en) 2017-01-16 2017-01-16 A kind of rectangle fixes dot matrix information encoding-decoding method

Publications (1)

Publication Number Publication Date
CN106845593A true CN106845593A (en) 2017-06-13

Family

ID=59124229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710032695.5A Pending CN106845593A (en) 2017-01-16 2017-01-16 A kind of rectangle fixes dot matrix information encoding-decoding method

Country Status (1)

Country Link
CN (1) CN106845593A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107330843A (en) * 2017-06-15 2017-11-07 深圳大学 A kind of gray level image coding hidden method and device, coding/decoding method and device
CN107941256A (en) * 2017-11-20 2018-04-20 中国电子科技集团公司第四十研究所 A kind of numerical value personalized indication method of high precision measuring instrument
CN112418374A (en) * 2020-12-14 2021-02-26 合肥高维数据技术有限公司 Information code generation method
CN114820827A (en) * 2022-05-06 2022-07-29 翼存(上海)智能科技有限公司 Data decoding method of rectangular gray scale dot matrix image for data storage
CN114898002A (en) * 2022-05-03 2022-08-12 翼存(上海)智能科技有限公司 Data coding method of rectangular gray-scale dot matrix image for data storage
CN117273044A (en) * 2023-10-27 2023-12-22 广州通赢科技有限公司 Bitmap, bitmap construction method and bitmap identification method
CN117436907A (en) * 2023-12-20 2024-01-23 中科微点技术有限公司 Anti-fake information tracing method based on combination of mobile phone scanning dot matrix code and digital watermark

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
CN102546095A (en) * 2010-12-03 2012-07-04 英飞凌科技股份有限公司 Apparatus and method for detecting an error within a coded binary word
CN103544516A (en) * 2012-07-12 2014-01-29 中国移动通信集团公司 Two-dimensional code encoding and decoding method, two-dimensional code encoder and two-dimensional code decoder
CN103605950A (en) * 2013-11-25 2014-02-26 广西大学 Method and system for hiding signature in credible two-dimensional code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
CN102546095A (en) * 2010-12-03 2012-07-04 英飞凌科技股份有限公司 Apparatus and method for detecting an error within a coded binary word
CN103544516A (en) * 2012-07-12 2014-01-29 中国移动通信集团公司 Two-dimensional code encoding and decoding method, two-dimensional code encoder and two-dimensional code decoder
CN103605950A (en) * 2013-11-25 2014-02-26 广西大学 Method and system for hiding signature in credible two-dimensional code

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
博客园: "DataMatrix二维条码源码分析检测识别图像位置", 《HTTPS://WWW.CNBLOGS.COM/QQHFENG/P/4240600.HTML》 *
李雅静: "Data_Matrix二维条码图像识别的算法研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
码迷: "DataMatrix二维条码源码分析检测识别图像位置", 《HTTP://WWW.MAMICODE.COM/INFO-DETAIL-435781.HTML》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107330843A (en) * 2017-06-15 2017-11-07 深圳大学 A kind of gray level image coding hidden method and device, coding/decoding method and device
CN107330843B (en) * 2017-06-15 2021-03-16 深圳大学 Gray level image coding hiding method and device and decoding method and device
CN107941256A (en) * 2017-11-20 2018-04-20 中国电子科技集团公司第四十研究所 A kind of numerical value personalized indication method of high precision measuring instrument
CN107941256B (en) * 2017-11-20 2020-03-06 中国电子科技集团公司第四十一研究所 Numerical value personalized display method of high-precision measuring instrument
CN112418374A (en) * 2020-12-14 2021-02-26 合肥高维数据技术有限公司 Information code generation method
CN114898002A (en) * 2022-05-03 2022-08-12 翼存(上海)智能科技有限公司 Data coding method of rectangular gray-scale dot matrix image for data storage
CN114820827A (en) * 2022-05-06 2022-07-29 翼存(上海)智能科技有限公司 Data decoding method of rectangular gray scale dot matrix image for data storage
CN117273044A (en) * 2023-10-27 2023-12-22 广州通赢科技有限公司 Bitmap, bitmap construction method and bitmap identification method
CN117273044B (en) * 2023-10-27 2024-03-29 广州通赢科技有限公司 Lattice diagram construction method and lattice diagram identification method
CN117436907A (en) * 2023-12-20 2024-01-23 中科微点技术有限公司 Anti-fake information tracing method based on combination of mobile phone scanning dot matrix code and digital watermark
CN117436907B (en) * 2023-12-20 2024-03-19 中科微点技术有限公司 Anti-fake information tracing method based on combination of mobile phone scanning dot matrix code and digital watermark

Similar Documents

Publication Publication Date Title
CN106845593A (en) A kind of rectangle fixes dot matrix information encoding-decoding method
CN106815544B (en) A kind of information concealing method based on two dimensional code
CN100369059C (en) Matrix type two-dimensional bar code and its encoding and decoding method
CN104899630B (en) The coding/decoding method of colored QR codes
CN102999772B (en) A kind of decoding method of novel matrix formula Quick Response Code
JP4294025B2 (en) Method for generating interface surface and method for reading encoded data
CN101882207B (en) Bar code decoding chip of Data Matrix codes and decoding method thereof
CN101908125B (en) QR (Quick Response) bar code decoding chip and decoding method thereof
CN103400174B (en) The coded method of a kind of Quick Response Code, coding/decoding method and system
CN107545289A (en) The coding method of matrix two-dimensional code and coding/decoding method
WO2017198189A1 (en) Generation and reading method and device for colour identified colour two-dimensional figure code
US8360333B2 (en) HD barcode
KR100729824B1 (en) Appratus and method for generating a image code, and apparatus and method for decoding a image code
CN104143200B (en) The frame type coding and intelligent identification Method of a kind of additional information of images
CN101334849A (en) Two-dimension code label symbol creation method and apparatus and two-dimension code label structure
WO2010115351A1 (en) Two-dimensional array code
CN111046996B (en) Color QR code generation and identification method
CN102081748B (en) Bar code pattern and bar code group pattern formed by node matrix and node line, and generation and identification method thereof
CN101908128B (en) Aztec Code bar code decoding chip and decoding method thereof
CN108073966A (en) A kind of conversion method of Quick Response Code and hole horizontal and vertical parity check code
US20240086670A1 (en) Methods for constructing, generating, and reading dot-matrix code, dot-matrix code generating and reading terminals, and dot-matrix code system
CN101303742B (en) Microminiature Hanxin code and method for generating symbol thereof
CN108734048A (en) Various dimensions Quick Response Code based on proprietary code generates and interpretation method
ES2808953T3 (en) Barcode Identification Procedure and Apparatus
CN112418374B (en) Information code generation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170613