CN107247985A - Coding, positioning and the recognition methods of New Two Dimensional code - Google Patents

Coding, positioning and the recognition methods of New Two Dimensional code Download PDF

Info

Publication number
CN107247985A
CN107247985A CN201710393558.4A CN201710393558A CN107247985A CN 107247985 A CN107247985 A CN 107247985A CN 201710393558 A CN201710393558 A CN 201710393558A CN 107247985 A CN107247985 A CN 107247985A
Authority
CN
China
Prior art keywords
mrow
matrix
msub
msup
mtd
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
CN201710393558.4A
Other languages
Chinese (zh)
Other versions
CN107247985B (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.)
Zhejiang Zhengya Dental Co ltd
Original Assignee
ZHEJIANG YINCHILI MEDICAL 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 ZHEJIANG YINCHILI MEDICAL TECHNOLOGY Co Ltd filed Critical ZHEJIANG YINCHILI MEDICAL TECHNOLOGY Co Ltd
Priority to CN201710393558.4A priority Critical patent/CN107247985B/en
Publication of CN107247985A publication Critical patent/CN107247985A/en
Application granted granted Critical
Publication of CN107247985B publication Critical patent/CN107247985B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B33ADDITIVE MANUFACTURING TECHNOLOGY
    • B33YADDITIVE MANUFACTURING, i.e. MANUFACTURING OF THREE-DIMENSIONAL [3-D] OBJECTS BY ADDITIVE DEPOSITION, ADDITIVE AGGLOMERATION OR ADDITIVE LAYERING, e.g. BY 3-D PRINTING, STEREOLITHOGRAPHY OR SELECTIVE LASER SINTERING
    • B33Y80/00Products made by additive manufacturing
    • 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/06046Constructional details

Abstract

The invention discloses a kind of coding of New Two Dimensional code, positioning and recognition methods, increase mark post in the middle of two-dimensional matrix to reach regular coding information, using on the basis of the two-dimensional code symbol of n*n matrixes, a row full 0 or complete 1 value are added in the left side of each row of matrix, method by n*n matrixing for n*2n matrix is encoded, prevent from producing the phenomenon that can not be printed when Quick Response Code is discontinuous when carrying out hollow out printing, when subsequently carrying out Quick Response Code positioning and identification again, n*n matrix is converted into again, the identification of Quick Response Code can either be facilitated, the discontinuous phenomenon occurred during hollow out printing is solved simultaneously, and can not be complete expression whole two-dimension code area the problem of.The present invention prints the printing and identification of Quick Response Code suitable for hollow out.

Description

Coding, positioning and the recognition methods of New Two Dimensional code
Technical field
The invention belongs to information storage, 3D printing field, it is related to a kind of coding, positioning and the identification side of New Two Dimensional code Method.
Background technology
Data Matrix are in the international widely used Quick Response Code in manufacture field, with 1989 by the international data public affairs in the U.S. Department invention, be widely used in commodity it is false proof, plan as a whole mark, be it is a kind of can be marked directly on the coding of the surface of solids, the coding It can automatically be read by corresponding scanning means, favored by manufacturing industry as usual bar code very much.Current Data Matrix quilts It is widely used in the systems such as product identification, false proof, quality tracing, automatic stored, logistics management and control.Data Matrix are used Complicated error-correcting code technique so that the coding has superpower contamination resistance., equally will not shadow even if coded portion is damaged Ring and read full detail.Data Matrix print characteristics allow it directly mark as currently the only support (printing, Scribe, photoetching, the mode such as burn into punching press) in product or the coding of component surface.Its efficient fault freedom holds it By manufacture or the process of circulation in component surface mark is polluted, therefore very by it is manufacturing welcome.For various differences Application, the Data Matrix symbol standards systems of diversified forms have been promulgated in the world.Data Matrix minimum chi It is very little be it is minimum in current all bar codes, be especially particularly suitable for use in the mark of finding, and be directly printed on physically.
Data Matrix codes are a kind of matrix two-dimensional barcodes, and its maximum feature is exactly that density is high, and its minimum dimension is mesh Minimum code in preceding all bar codes.DM codes can be in only 25mm2Area on encode 30 numerals.DM employs the error correction of complexity Code technology so that the coding has superpower contamination resistance.Data Matrix because providing minimum and highdensity label, and Rational data content can be still deposited, therefore is particularly suitable for use in finding mark, commodity counterfeit prevention, circuit identifier etc..Because its is outstanding Error correcting capability, DM codes oneself turn into South Korea's mobile phone two-dimensional bar code mainstream technology.For QR, DM codes are poor due to information capacity It is different few, using simple, it is referred to as in the industry " simple code ", not high to demanding terminal, the mobile phone of 300,000 pixels just can recognize that, it is more Many is the increment based on WAP.Quick Response Code brings new entrance to surfing Internet with cell phone, and by scanning all kinds of bar codes, user is quickly WAP site can just be entered, fast browsing is carried out.Data Matrix symbols look like one and are made up of two kinds of colors of the depth Chessboard, the black or white boxes of each formed objects are referred to as a data unit, and Data Matrix symbols are just It is made up of many such data units.Seeking the dead zone that border area outer layer has width for a data unit.It is " chess to seek border area The border of disk ", is served only for positioning and defines data unit size, and does not contain any coding information.Sought the number of border area encirclement Coding information is included according to area.
Dot matrix Quick Response Code is mainly made up of mark zone, clear area, detecting area, data field, fill area, and data field is located at two The centre of code figure is tieed up, detecting area is located at the surrounding of data field, is made up of two solid lines and two dotted lines, the periphery four of detecting area Week is clear area, and the fill area of part two-dimension code pattern is located at the lower right corner of data field, and mark zone is used for dimensional matrix data Separate.The printout of dot matrix Quick Response Code 3D printer suitable for industrial flow-line production, solves light in Quick Response Code identification According to the problem of irregular, shooting angle is various, contrast is low and is easily stained and during Quick Response Code 3D printing output due to Two-Dimensional Moment formation The discontinuous problem of printing caused into many connected regions.
Dot matrix Quick Response Code is mainly made up of mark zone, clear area, detecting area, data field, fill area, and clear area is located at two The surrounding of code figure is tieed up, is mainly used in two-dimensional code symbol and background separation;Detecting area can represent the width of a module, be several According to the border in area, it is made up of two parts, a part is " L " the type solid line edge being made up of left margin and lower boundary, another part It is " L " the type dotted line edge being made up of coboundary and right margin, is mainly used in the cellular construction of qualifier, it can also be used to it is determined that The problem of physical size and signal distortion;The square area that data field is made up of retention point and hollow out point, the inside information Storage mode is the different permutation and combination of retention point and hollow out point, is encoded using binary system, is wherein included inside data field Codeword information and error correction information, the data field of portion size can not be filled up completely with data field due to codeword information and error correction information, Data field can be caused to there is partial blank, the region is located at the lower right corner of data field, general to replace using retention point and hollow out point The mode of arrangement is filled.In practice, the two-dimensional matrix obtained after coding is connected region more than one, if using ' 1 ' As retention point, ' 0 ' hollow out point, if ' 0 ' is printed as the mode of retention point, meeting are used as hollow out point or ' 1 ' Cause print area discontinuous, it is impossible to the whole two-dimension code area of complete expression.
Therefore, a kind of mark post that increases in the middle of two-dimensional matrix is studied to reach the method for regular coding information, with important Meaning.
The content of the invention
The technical problem to be solved in the present invention, is to provide a kind of coding, positioning and the recognition methods of New Two Dimensional code, two Tieing up increases mark post to reach regular coding information in the middle of matrix, using on the basis of the two-dimensional code symbol of n*n matrixes, in matrix A row full 0 or complete 1 value are added in the left side of each row, and the method by n*n matrixing for n*2n matrix is encoded, Prevent from producing the phenomenon that can not be printed when Quick Response Code is discontinuous when carrying out hollow out printing, Quick Response Code positioning is subsequently carried out again During with identification, then n*n matrix is converted into, the identification of Quick Response Code can either be facilitated, while going out when solving hollow out printing Existing discontinuous phenomenon, and can not be complete expression whole two-dimension code area the problem of.
In order to solve the above technical problems, the technical solution used in the present invention is:
A kind of coding, positioning and the recognition methods of New Two Dimensional code, are carried out according to following steps order:
One) coding method
1) data message is converted into code word data;
2) according to Reed-Solomon algorithms and error correction requirement, error correction code word is generated;
3) error correction code word is placed into matrix according to standard form, generate the two-dimensional code symbol of n*n matrixes;
4) on the basis of the two-dimensional code symbol of n*n matrixes, a row full 0 or complete 1 is added in the left side of each row of matrix Value, by n*n matrixing be n*2n matrix;
Two) two-dimension code area localization method
1) Harris Corner Detection Algorithms, determine the position of angle point;
2) Hough transform method extracts straight line from angle point;
Three) recognition methods of two-dimension code area
1) it is by block size to image I (x, y) with dimensional Gaussian convolution operatorCarry out convolution;
2) binaryzation calculating is done with OTSU algorithms to the image after convolution, obtains binaryzation matrix;
3) starting row are classified as from the second of obtained binaryzation matrix to take out, the value of next column are then taken out every a row, The row of taking-up are placed in a new matrix column in order, the new matrix for the n*n that n*2n matrix conversion is obtained is i.e. For Quick Response Code matrix, the Quick Response Code matrix decode using decoding algorithm to obtain codeword information.
Be used as a kind of restriction of the present invention, described step one) in data message is turned according to ASCII BER Basic Encoding Rules It is changed to code word data.
As the further restriction of above-mentioned restriction, described ASCII BER Basic Encoding Rules is:
1) character that basic ascii character, i.e. ASCII value are 0-127, adds 1, the code after coding during data encoding with initial value Word value is 1-128;
2) character that extension ascii character, i.e. ASCII value is 128-255, two numbers are encoded to using control character 235 Value, first is that switching code word 235 is added in streams of code words, and second is to subtract 128 in former ASCII value and plus 1 and obtain result to compile Character value after code is (235,1)-(235,128);
3) numeral within double figures 00-99, or two ten is connected, and is encoded using 130-299, i.e., double-digit reality Value Jia 130, and the code word value after coding is 130-229;
4) during actual coding, when the code word after coding can not take code word number completely, to increase after coding codeword Plus fill character;Code word after first coding of filling character is 129, and the coding result filled character afterwards is 129 On the basis of along with pseudo random number, the algorithm is 253 state random algorithms.
Be used as another restriction of the present invention, described step one) in error correction method 2) be:
I) set up codeword polynome C (X)
C (X)=Cn-1Xn-1+k+Cn-2Xn-2+k+…+C1X1+k+C0Xk
Wherein, Cn-1, Cn-2..., C1, C0It is code word data, Cn-1It is first code word data, C0It is last numeric data code Word, k is the number of error correction code word;
II) set up error correction code word generator polynomial G (x)
G (X)=Xk+Gk-1Xk-1+…+G1X+G0
All computings are all based on Galois domains in above formula;
III) obtain error correction code polynomial E (X) using C (X) and G (x)
E (X)=Ek-1Xk-1+Ek-2Xk-2+…+E1X+E0
Ek-1,Ek-2,…,E1,E0For error correction code word, Ek-1It is first error correction code word, E0It is last error correction code word;E (X) computational methods are also based on Galois domains.
Be used as the third restriction, described step one of the present invention) in method 3) be:
The streams of code words ultimately generated is Cn-1,Cn-2,…,C1,C0,Ek-1,Ek-1,…,E1,E0, code is placed according to standard form Character number.
Be used as the 4th kind of restriction of the present invention, described step two) in method 1) be:
I) function of piece image is set as I (x, y), each pixel of image is deployed to remove its approximate neighborhood with Taylor Any direction, then the energy of each pixel and its neighborhood be:
Carry out linear transformation expansion to the function and arrange to obtain:
Final result is after then deploying:
In formula, lx is the difference in x directions, and ly is the difference in y directions, and w (x, y) is Gaussian function;
Wherein, δ is standard deviation;
II) due to matrix M two characteristic vector l1And l2It is directly proportional to matrix M principal curvatures;Wherein, l1And l2For square Battle arrayThe base vector of different dimensions under projector space;Utilize l1, l2Change two most fast and most slow sides to characterize To;If both very big is exactly angle point, it is one big it is one small be exactly edge, both small is exactly in the slow image district of change Domain;But solution characteristic vector needs more amounts of calculation, due to two characteristic values and equal to matrix M mark, two features The product of value is equal to matrix M determinant;
The energy of corner point is judged with following formula:
R=detM-k (traceM)2;Wherein, k is 0.04~0.06.
III) for obtained energy matrix R, withArea coverage matrix R, findMaximum in region Point, if the energy response of the point is more than threshold value t, is considered as the angle point of needs.
Be used as the 5th kind of restriction of the present invention, described step two) in method 2) be:
Using Hough transform method to the angle point grid straight line detected, the location information of two-dimension code area is obtained;
If the linear equation of straight line is in rectangular coordinate system:
Y=k*x+b
Because the straight line in rectangular co-ordinate is changed into a sine curve in polar coordinate system, therefore it is converted into polar coordinates System under equation be:
P=x*cos (a)+y*sin (a)
A is the ray and the angle of x-axis forward direction drawn under polar coordinate system from origin in above formula, and p is hanging down from origin extraction Line length;Detect in the picture after angle point, by Hough transform, the sine curve of angle point has a public affairs in polar coordinates Common intersection point;The calculating process of Hough transform algorithm is:
(1) image space every bit is mapped to one group of accumulator in Hough spaces according to the equation of rectangular coordinate system;
(2) each common intersection of above formula is met, the value in corresponding accumulator will be made plus 1;
(3) local maximum in detection accumulator;
If including straight line in image, there is a corresponding accumulator that local maximum occurs, pass through detection Local maximum in Hough spaces, you can it is determined that a pair of parameters with this line correspondences, then extract from common parameter Straight line, as marginal position in two-dimension code area, therefore straight-line detection is carried out to the angle point detected by Hough transform, Two-dimension code area is just extracted.
Be used as the 6th kind of restriction of the present invention, described step three) in method 1) be:
It is by block size to image I (x, y) with dimensional Gaussian convolution operatorCarry out convolution, the mistake of convolution
Journey is in regionIt is interior to be weighted summation with Gauss operator region corresponding with image, as a result export oneMatrix, the value of each pixel represents the Gauss weighted value of each block in the matrix;
Wherein Gauss operator is:
If the image after convolution is G (x, y), then:
Wherein,For convolution operator.
The present invention also have it is a kind of limit, described step three) in method 2) be:
If the span of pixel is that sum of all pixels mesh is N in (min~max), the region in region, if the region two-value The optimal threshold of change is T, T ∈ (min~max), then when threshold value is Ti:
If 1), number of pixels that the area grayscale value is more than Ti is sum1, pixel and for max1, then its gray average is:Its weights is:
2) number of pixels that the area grayscale value is less than Ti is sum2, pixel and for max2, then its gray average is:Its weights is:
3) the overall intensity average for obtaining the region is:Avg3=w1*avg1+w2*avg2;
So as to obtain two parts variance and be:Plus=w1* ((avg1-avg3) ^2)+w2* ((avg2-avg3) ^2);
4) all Ti are traveled through, the threshold value of maximum variance value will be obtained as by the threshold value of the region binaryzation.
As a result of above-mentioned technical scheme, compared with prior art, acquired technological progress is the present invention:
The present invention increases mark post to reach regular coding information in the middle of two-dimensional matrix, using the Quick Response Code in n*n matrixes On the basis of symbol, a row full 0 or complete 1 value are added in the left side of each row of matrix, is n*2n's by n*n matrixing The method of matrix is encoded, and prevents from producing the phenomenon that can not be printed when Quick Response Code is discontinuous when carrying out hollow out printing, When subsequently carrying out Quick Response Code positioning and identification again, then n*n matrix is converted into, the identification of Quick Response Code can either be facilitated, together When the discontinuous phenomenon that occurs when solving hollow out printing, and can not be complete expression whole two-dimension code area the problem of.This hair Dot matrix DM codes in bright are a kind of matrix two-dimensional codes, by retention point and hollow out point according to the form arrangement of two-dimensional matrix Into;It can solve the problem that two-dimensional matrix forms the discontinuous problem of printing that many connected regions are caused using the above method, in printing Using full 0 or complete 1 row as stationary support, printed with the hollow out for realizing Quick Response Code, when follow-up Quick Response Code is recognized, regeneration Into the Quick Response Code that symbol is the n*n square formations for being covered with 0,1 value, convenient printing needs the type-setting mode of reindexing, and the above method is realized Hollow out printing 3D Quick Response Codes, when carrying out Quick Response Code identification, light can be realized and penetrated, and add 0,1 value in light irradiation Under contrast, more facilitate identification, obtain decoding image when illumination is uneven, shooting angle is diversified, contrast is low and The problems such as being easily stained.
The present invention prints the printing and identification of Quick Response Code suitable for hollow out.
The present invention is described in further detail below in conjunction with Figure of description with specific embodiment.
Brief description of the drawings
Fig. 1 is step one in the embodiment of the present invention 1) encode the schematic diagram generated;
Fig. 2 is step 2 in the embodiment of the present invention 1) in the 1) step determine the schematic diagram of angle point;
Fig. 3 is step 2 in the embodiment of the present invention 1) in the 2) step extract the schematic diagram of straight line;
Fig. 4 is step 3 in the embodiment of the present invention 1) in the schematic diagram 3) after the identification of step Quick Response Code.
Embodiment
Coding, positioning and the recognition methods of a kind of New Two Dimensional of embodiment 1 code
A kind of coding, positioning and the recognition methods of New Two Dimensional code, are carried out according to following steps order:
One) coding method
1) data message is converted into code word data;
Data message is converted into code word data according to ASCII BER Basic Encoding Rules;Described ASCII BER Basic Encoding Rules For:
1) character that basic ascii character, i.e. ASCII value are 0-127, adds 1, the code after coding during data encoding with initial value Word value is 1-128;
2) character that extension ascii character, i.e. ASCII value is 128-255, two numbers are encoded to using control character 235 Value, first is that switching code word 235 is added in streams of code words, and second is to subtract 128 in former ASCII value and plus 1 and obtain result to compile Character value after code is (235,1)-(235,128);
3) numeral within double figures 00-99, or two ten is connected, and is encoded using 130-299, i.e., double-digit reality Value Jia 130, and the code word value after coding is 130-229;
4) during actual coding, when the code word after coding can not take code word number completely, to increase after coding codeword Plus fill character;Code word after first coding of filling character is 129, and the coding result filled character afterwards is 129 On the basis of along with pseudo random number, the algorithm is 253 state random algorithms.
2) according to Reed-Solomon algorithms and error correction requirement, error correction code word is generated;
Specific method is as follows:I) set up codeword polynome C (X)
C (X)=Cn-1Xn-1+k+Cn-2Xn-2+k+…+C1X1+k+C0Xk
Wherein, Cn-1, Cn-2..., C1, C0It is code word data, Cn-1It is first code word data, C0It is last numeric data code Word, k is the number of error correction code word;
II) set up error correction code word generator polynomial G (x)
G (X)=Xk+Gk-1Xk-1+…+G1X+G0
All computings are all based on Galois domains in above formula;
III) obtain error correction code polynomial E (X) using C (X) and G (x)
E (X)=Ek-1Xk-1+Ek-2Xk-2+…+E1X+E0
Ek-1,Ek-2,…,E1,E0For error correction code word, Ek-1It is first error correction code word, E0It is last error correction code word;E (X) computational methods are also based on Galois domains.
Described step one) in method 3) be:
The streams of code words ultimately generated is Cn-1,Cn-2,…,C1,C0,Ek-1,Ek-1,…,E1,E0, code is placed according to standard form Character number.
3) error correction code word is placed into matrix according to standard form, generate the two-dimensional code symbol of n*n matrixes;
4) on the basis of the two-dimensional code symbol of n*n matrixes, a row full 0 or complete 1 is added in the left side of each row of matrix Value, by the matrix that n*n matrixing is n*2n, generation coding is as shown in Figure 1;
Two) two-dimension code area localization method
1) Harris Corner Detection Algorithms, determine the position of angle point, as shown in Figure 2;
Specific method is:
I) function of piece image is set as I (x, y), each pixel of image is deployed to remove its approximate neighborhood with Taylor Any direction, then the energy of each pixel and its neighborhood be:
Carry out linear transformation expansion to the function and arrange to obtain:
Final result is after then deploying:
In formula, lx is the difference in x directions, and ly is the difference in y directions, and w (x, y) is Gaussian function;
Wherein, δ is standard deviation;
II) due to matrix M two characteristic vector l1And l2It is directly proportional to matrix M principal curvatures;Wherein, l1And l2For square Battle arrayThe base vector of different dimensions under projector space;Utilize l1, l2Change two most fast and most slow sides to characterize To;If both very big is exactly angle point, it is one big it is one small be exactly edge, both small is exactly in the slow image district of change Domain;But solution characteristic vector needs more amounts of calculation, due to two characteristic values and equal to matrix M mark, two features The product of value is equal to matrix M determinant;
The energy of corner point is judged with following formula:
R=detM-k (traceM)2;Wherein, k is 0.04~0.06.
III) for obtained energy matrix R, withArea coverage matrix R, findMaximum in region Point, if the energy response of the point is more than threshold value t, is considered as the angle point of needs.
2) Hough transform method extracts straight line from angle point, as shown in Figure 3;
Specific method is:Using Hough transform method to the angle point grid straight line detected, determining for two-dimension code area is obtained Position information;
If the linear equation of straight line is in rectangular coordinate system:
Y=k*x+b
Because the straight line in rectangular co-ordinate is changed into a sine curve in polar coordinate system, therefore it is converted into polar coordinates System under equation be:
P=x*cos (a)+y*sin (a)
A is the ray and the angle of x-axis forward direction drawn under polar coordinate system from origin in above formula, and p is hanging down from origin extraction Line length;Detect in the picture after angle point, by Hough transform, the sine curve of angle point has a public affairs in polar coordinates Common intersection point;The calculating process of Hough transform algorithm is:
(1) image space every bit is mapped to one group of accumulator in Hough spaces according to the equation of rectangular coordinate system;
(2) each common intersection of above formula is met, the value in corresponding accumulator will be made plus 1;
(3) local maximum in detection accumulator;
If including straight line in image, there is a corresponding accumulator that local maximum occurs, pass through detection Local maximum in Hough spaces, you can it is determined that a pair of parameters with this line correspondences, then extract from common parameter Straight line, as marginal position in two-dimension code area, therefore straight-line detection is carried out to the angle point detected by Hough transform, Two-dimension code area is just extracted.
Three) recognition methods of two-dimension code area
1) it is by block size to image I (x, y) with dimensional Gaussian convolution operatorCarry out convolution;
It is by block size to image I (x, y) with dimensional Gaussian convolution operatorCarry out convolution, the mistake of convolution
Journey is in regionIt is interior to be weighted summation with Gauss operator region corresponding with image, as a result export oneMatrix, the value of each pixel represents the Gauss weighted value of each block in the matrix;
Wherein Gauss operator is:
If the image after convolution is G (x, y), then:
Wherein,For convolution operator.
2) binaryzation calculating is done with OTSU algorithms to the image after convolution, obtains binaryzation matrix;
If the span of pixel is that sum of all pixels mesh is N in (min~max), the region in region, if the region two-value The optimal threshold of change is T, T ∈ (min~max), then when threshold value is Ti:
If 1), number of pixels that the area grayscale value is more than Ti is sum1, pixel and for max1, then its gray average is:Its weights is:
2) number of pixels that the area grayscale value is less than Ti is sum2, pixel and for max2, then its gray average is:Its weights is:
3) the overall intensity average for obtaining the region is:Avg3=w1*avg1+w2*avg2;
So as to obtain two parts variance and be:Plus=w1* ((avg1-avg3) ^2)+w2* ((avg2-avg3) ^2);
4) all Ti are traveled through, the threshold value of maximum variance value will be obtained as by the threshold value of the region binaryzation.
3) starting row are classified as from the second of obtained binaryzation matrix to take out, the value of next column are then taken out every a row, The row of taking-up are placed in a new matrix column in order, the new matrix for the n*n that n*2n matrix conversion is obtained is i.e. For Quick Response Code matrix, codeword information is obtained as shown in figure 4, being decoded using decoding algorithm to Quick Response Code matrix progress.
Using the above method solve carry out hollow out printing when Quick Response Code it is discontinuous when produce can not be printed show As, when subsequently carrying out Quick Response Code positioning and identification again, then n*n matrix is converted into, the identification of Quick Response Code can either be facilitated, The discontinuous phenomenon that occurs when solving hollow out printing simultaneously, and can not be complete expression whole two-dimension code area the problem of.This Dot matrix DM codes in invention are a kind of matrix two-dimensional codes, by retention point and hollow out point according to the form arrangement of two-dimensional matrix Into;It can solve the problem that two-dimensional matrix forms the discontinuous problem of printing that many connected regions are caused using the above method, in printing Using full 0 or complete 1 row as stationary support, printed with the hollow out for realizing Quick Response Code, when follow-up Quick Response Code is recognized, regeneration Into the Quick Response Code that symbol is the n*n square formations for being covered with 0,1 value, convenient printing needs the type-setting mode of reindexing, and the above method is realized Hollow out printing 3D Quick Response Codes, when carrying out Quick Response Code identification, light can be realized and penetrated, and add 0,1 value in light irradiation Under contrast, more facilitate identification, obtain decoding image when illumination is uneven, shooting angle is diversified, contrast is low and The problems such as being easily stained.
The above described is only a preferred embodiment of the present invention, being not the restriction for making other forms to the present invention, appoint What those skilled in the art is changed or is modified as equivalent variations possibly also with above-mentioned technology contents as enlightenment Equivalent embodiment.But, every to conceive without departing from the technology of the present invention, the technical spirit according to the present invention is made to above example The simple modification gone out, equivalent variations and remodeling, still fall within the protection domain of the claims in the present invention.

Claims (9)

1. a kind of coding, positioning and the recognition methods of New Two Dimensional code, it is characterised in that it is carried out according to following steps order:
One) coding method
1) data message is converted into code word data;
2) according to Reed-Solomon algorithms and error correction requirement, error correction code word is generated;
3) error correction code word is placed into matrix according to standard form, generate the two-dimensional code symbol of n*n matrixes;
4) on the basis of the two-dimensional code symbol of n*n matrixes, a row full 0 or complete 1 value are added in the left side of each row of matrix, By the matrix that n*n matrixing is n*2n;
Two) two-dimension code area localization method
1) Harris Corner Detection Algorithms, determine the position of angle point;
2) Hough transform method extracts straight line from angle point;
Three) recognition methods of two-dimension code area
1) it is by block size to image I (x, y) with dimensional Gaussian convolution operatorCarry out convolution;
2) binaryzation calculating is done with OTSU algorithms to the image after convolution, obtains binaryzation matrix;
3) starting row are classified as from the second of obtained binaryzation matrix to take out, the value of next column is then taken out every a row, will be taken The row gone out are placed in a new matrix column in order, and the new matrix for the n*n that n*2n matrix conversion is obtained is two Code matrix is tieed up, the Quick Response Code matrix decode using decoding algorithm to obtain codeword information.
2. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid one) in data message is converted into code word data according to ASCII BER Basic Encoding Rules.
3. coding, positioning and the recognition methods of New Two Dimensional code according to claim 2, it is characterised in that:Described ASCII BER Basic Encoding Rules is:
1) character that basic ascii character, i.e. ASCII value are 0-127, adds 1, the code word value after coding during data encoding with initial value For 1-128;
2) character that extension ascii character, i.e. ASCII value is 128-255, two values are encoded to using control character 235, the One is that switching code word 235 is added in streams of code words, and second is to subtract 128 in former ASCII value plus 1 and obtain after result codings Character value be (235,1)-(235,128);
3) numeral within double figures 00-99, or two ten is connected, and is encoded using 130-299, i.e., double-digit actual value adds 130, the code word value after coding is 130-229;
4) during actual coding, when the code word after coding can not take code word number completely, to increase after coding codeword and fill out Fill character;Code word after first coding of filling character is 129, and the coding result filled character afterwards is on 129 basis Upper to add a pseudo random number, the algorithm is 253 state random algorithms.
4. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid one) in error correction method 2) be:
I) set up codeword polynome C (X)
C (X)=Cn-1Xn-1+k+Cn-2Xn-2+k+…+C1X1+k+C0Xk
Wherein, Cn-1, Cn-2..., C1, C0It is code word data, Cn-1It is first code word data, C0It is last code word data, k It is the number of error correction code word;
II) set up error correction code word generator polynomial G (x)
G (X)=Xk+Gk-1Xk-1+…+G1X+G0
All computings are all based on Galois domains in above formula;
III) obtain error correction code polynomial E (X) using C (X) and G (x)
E (X)=Ek-1Xk-1+Ek-2Xk-2+…+E1X+E0
Ek-1,Ek-2,…,E1,E0For error correction code word, Ek-1It is first error correction code word, E0It is last error correction code word;E's (X) Computational methods are also based on Galois domains.
5. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid one) in method 3) be:
The streams of code words ultimately generated is Cn-1,Cn-2,…,C1,C0,Ek-1,Ek-1,…,E1,E0, code character is placed according to standard form Number.
6. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid two) in method 1) be:
I) function of piece image is set as I (x, y), each pixel of image is deployed to go appointing for its approximate neighborhood with Taylor Anticipate direction, then the energy of each pixel and its neighborhood be:
<mfenced open = "" close = ""> <mtable> <mtr> <mtd> <mrow> <mi>E</mi> <mrow> <mo>(</mo> <mi>u</mi> <mo>,</mo> <mi>v</mi> <mo>)</mo> </mrow> <mo>=</mo> <munder> <mo>&amp;Sigma;</mo> <mrow> <mi>x</mi> <mo>,</mo> <mi>y</mi> </mrow> </munder> <mi>w</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <msup> <mrow> <mo>&amp;lsqb;</mo> <mi>I</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>+</mo> <mi>u</mi> <mo>,</mo> <mi>y</mi> <mo>+</mo> <mi>v</mi> <mo>)</mo> </mrow> <mo>-</mo> <mi>I</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mo>&amp;rsqb;</mo> </mrow> <mn>2</mn> </msup> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mo>=</mo> <munder> <mo>&amp;Sigma;</mo> <mrow> <mi>x</mi> <mo>,</mo> <mi>y</mi> </mrow> </munder> <mi>w</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <msup> <mrow> <mo>&amp;lsqb;</mo> <msub> <mi>I</mi> <mi>x</mi> </msub> <mi>u</mi> <mo>+</mo> <msub> <mi>I</mi> <mi>y</mi> </msub> <mi>v</mi> <mo>+</mo> <mi>O</mi> <mrow> <mo>(</mo> <msup> <mi>u</mi> <mn>2</mn> </msup> <mo>,</mo> <msup> <mi>v</mi> <mn>2</mn> </msup> <mo>)</mo> </mrow> <mo>&amp;rsqb;</mo> </mrow> <mn>2</mn> </msup> </mrow> </mtd> </mtr> </mtable> </mfenced>
Carry out linear transformation expansion to the function and arrange to obtain:
<mrow> <mi>M</mi> <mo>=</mo> <munder> <mo>&amp;Sigma;</mo> <mrow> <mi>x</mi> <mo>,</mo> <mi>y</mi> </mrow> </munder> <mi>w</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <mrow> <msup> <msub> <mi>I</mi> <mi>x</mi> </msub> <mn>2</mn> </msup> </mrow> </mtd> <mtd> <mrow> <msub> <mi>I</mi> <mi>x</mi> </msub> <msub> <mi>I</mi> <mi>y</mi> </msub> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <msub> <mi>I</mi> <mi>x</mi> </msub> <msub> <mi>I</mi> <mi>y</mi> </msub> </mrow> </mtd> <mtd> <mrow> <msup> <msub> <mi>I</mi> <mi>y</mi> </msub> <mn>2</mn> </msup> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mi>w</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mo>&amp;CircleTimes;</mo> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <mrow> <msup> <msub> <mi>I</mi> <mi>x</mi> </msub> <mn>2</mn> </msup> </mrow> </mtd> <mtd> <mrow> <msub> <mi>I</mi> <mi>x</mi> </msub> <msub> <mi>I</mi> <mi>y</mi> </msub> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <msub> <mi>I</mi> <mi>x</mi> </msub> <msub> <mi>I</mi> <mi>y</mi> </msub> </mrow> </mtd> <mtd> <mrow> <msup> <msub> <mi>I</mi> <mi>y</mi> </msub> <mn>2</mn> </msup> </mrow> </mtd> </mtr> </mtable> </mfenced> </mrow>
Final result is after then deploying:
<mrow> <mi>E</mi> <mrow> <mo>(</mo> <mi>u</mi> <mo>,</mo> <mi>v</mi> <mo>)</mo> </mrow> <mo>&amp;ap;</mo> <mo>&amp;lsqb;</mo> <mi>u</mi> <mo>,</mo> <mi>v</mi> <mo>&amp;rsqb;</mo> <mi>M</mi> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <mi>u</mi> </mtd> </mtr> <mtr> <mtd> <mi>v</mi> </mtd> </mtr> </mtable> </mfenced> </mrow>
In formula, lx is the difference in x directions, and ly is the difference in y directions, and w (x, y) is Gaussian function;
Wherein, δ is standard deviation;
II) due to matrix M two characteristic vector l1And l2It is directly proportional to matrix M principal curvatures;Wherein, l1And l2For matrixThe base vector of different dimensions under projector space;Utilize l1, l2Change most fast and most slow both direction to characterize; If both very big is exactly angle point, it is one big it is one small be exactly edge, both small is exactly in the slow image-region of change;But It is to solve characteristic vector to need more amounts of calculation, due to two characteristic values and equal to matrix M mark, the product of two characteristic values Equal to matrix M determinant;
The energy of corner point is judged with following formula:
R=det M-k (traceM)2;Wherein, k is 0.04~0.06;
III) for obtained energy matrix R, withArea coverage matrix R, findMaximum point in region, If the energy response of the point is more than threshold value t, it is considered as the angle point of needs.
7. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid two) in method 2) be:
Using Hough transform method to the angle point grid straight line detected, the location information of two-dimension code area is obtained;
If the linear equation of straight line is in rectangular coordinate system:
Y=k*x+b
Because the straight line in rectangular co-ordinate is changed into a sine curve in polar coordinate system, therefore it is converted under polar coordinate system Equation be:
P=x*cos (a)+y*sin (a)
A is the ray and the angle of x-axis forward direction drawn under polar coordinate system from origin in above formula, and p is long from the vertical line of origin extraction Degree;Detect in the picture after angle point, by Hough transform, the sine curve of angle point has a public friendship in polar coordinates Point;The calculating process of Hough transform algorithm is:
(1) image space every bit is mapped to one group of accumulator in Hough spaces according to the equation of rectangular coordinate system;
(2) each common intersection of above formula is met, the value in corresponding accumulator will be made plus 1;
(3) local maximum in detection accumulator;
If including straight line in image, there is a corresponding accumulator that local maximum occurs, by detecting Hough Local maximum in space, you can it is determined that a pair of parameters with this line correspondences, then what is extracted from common parameter is straight Marginal position in line, as two-dimension code area, therefore straight-line detection is carried out to the angle point detected by Hough transform, just carry Two-dimension code area is taken out.
8. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid three) in method 1) be:
It is by block size to image I (x, y) with dimensional Gaussian convolution operatorConvolution is carried out, the process of convolution is in regionIt is interior to be weighted summation with Gauss operator region corresponding with image, as a result export oneMatrix, the matrix In the value of each pixel represent the Gauss weighted value of each block;
Wherein Gauss operator is:
<mrow> <mi>g</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mo>=</mo> <msup> <mi>e</mi> <mrow> <mo>-</mo> <mfrac> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> <mrow> <mn>2</mn> <msup> <mi>&amp;sigma;</mi> <mn>2</mn> </msup> </mrow> </mfrac> </mrow> </msup> </mrow>
If the image after convolution is G (x, y), then:
<mrow> <mi>G</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mo>=</mo> <mi>g</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> <mo>&amp;CircleTimes;</mo> <mi>I</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> </mrow>
Wherein,For convolution operator.
9. coding, positioning and the recognition methods of New Two Dimensional code according to claim 1, it is characterised in that:Described step It is rapid three) in method 2) be:
If the span of pixel is that sum of all pixels mesh is N in (min~max), the region in region, if the region binaryzation Optimal threshold is T, T ∈ (min~max), then when threshold value is Ti:
If 1), number of pixels that the area grayscale value is more than Ti is sum1, pixel and for max1, then its gray average is:Its weights is:
2) number of pixels that the area grayscale value is less than Ti is sum2, pixel and for max2, then its gray average is:Its weights is:
3) the overall intensity average for obtaining the region is:Avg3=w1*avg1+w2*avg2;
So as to obtain two parts variance and be:Plus=w1* ((avg1-avg3) ^2)+w2* ((avg2-avg3) ^2);
4) all Ti are traveled through, the threshold value of maximum variance value will be obtained as by the threshold value of the region binaryzation.
CN201710393558.4A 2017-05-27 2017-05-27 Coding, positioning and identifying method of two-dimensional code Active CN107247985B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710393558.4A CN107247985B (en) 2017-05-27 2017-05-27 Coding, positioning and identifying method of two-dimensional code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710393558.4A CN107247985B (en) 2017-05-27 2017-05-27 Coding, positioning and identifying method of two-dimensional code

Publications (2)

Publication Number Publication Date
CN107247985A true CN107247985A (en) 2017-10-13
CN107247985B CN107247985B (en) 2020-07-17

Family

ID=60018827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710393558.4A Active CN107247985B (en) 2017-05-27 2017-05-27 Coding, positioning and identifying method of two-dimensional code

Country Status (1)

Country Link
CN (1) CN107247985B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271826A (en) * 2018-09-29 2019-01-25 连尚(新昌)网络科技有限公司 The method and apparatus of two dimensional code for identification
CN110018633A (en) * 2018-12-14 2019-07-16 华南理工大学 A kind of two-dimensional encoded design method positioned for AGV with navigation
CN110275132A (en) * 2019-06-18 2019-09-24 西京学院 A kind of indoor orientation method based on two dimensional code mapping
CN112149776A (en) * 2020-09-30 2020-12-29 北京小龙潜行科技有限公司 Visual label and assembly thereof
CN114919180A (en) * 2022-05-19 2022-08-19 苏州博思美医疗科技有限公司 Tooth model processing method and system based on DM code information storage and storage medium
CN115195126A (en) * 2022-07-06 2022-10-18 中国科学院空间应用工程与技术中心 Two-dimensional matching method and device for 3D printed object, electronic equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999772A (en) * 2012-11-14 2013-03-27 韩偲铭 Novel array-type two-dimension code encoding and decoding methods
US20150235069A1 (en) * 2014-02-18 2015-08-20 Adobe Systems Incorporated Method and apparatus for storing and retrieving data embedded into the surface of a 3d printed object
CN105550881A (en) * 2015-12-08 2016-05-04 浙江大学 Remote dynamic three-dimensional code generation and authentication method based on two-dimensional code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999772A (en) * 2012-11-14 2013-03-27 韩偲铭 Novel array-type two-dimension code encoding and decoding methods
US20150235069A1 (en) * 2014-02-18 2015-08-20 Adobe Systems Incorporated Method and apparatus for storing and retrieving data embedded into the surface of a 3d printed object
CN105550881A (en) * 2015-12-08 2016-05-04 浙江大学 Remote dynamic three-dimensional code generation and authentication method based on two-dimensional code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨硕: "二维条码Data Matrix的编码和自动识别", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271826A (en) * 2018-09-29 2019-01-25 连尚(新昌)网络科技有限公司 The method and apparatus of two dimensional code for identification
CN110018633A (en) * 2018-12-14 2019-07-16 华南理工大学 A kind of two-dimensional encoded design method positioned for AGV with navigation
CN110018633B (en) * 2018-12-14 2020-08-18 华南理工大学 Two-dimensional code design method for AGV positioning and navigation
CN110275132A (en) * 2019-06-18 2019-09-24 西京学院 A kind of indoor orientation method based on two dimensional code mapping
CN110275132B (en) * 2019-06-18 2023-03-28 西京学院 Indoor positioning method based on two-dimensional code mapping
CN112149776A (en) * 2020-09-30 2020-12-29 北京小龙潜行科技有限公司 Visual label and assembly thereof
CN114919180A (en) * 2022-05-19 2022-08-19 苏州博思美医疗科技有限公司 Tooth model processing method and system based on DM code information storage and storage medium
CN114919180B (en) * 2022-05-19 2023-11-10 苏州博思美医疗科技有限公司 Dental model processing method, system and storage medium based on DM code information storage
CN115195126A (en) * 2022-07-06 2022-10-18 中国科学院空间应用工程与技术中心 Two-dimensional matching method and device for 3D printed object, electronic equipment and medium
CN115195126B (en) * 2022-07-06 2023-02-24 中国科学院空间应用工程与技术中心 Two-dimensional matching method and device for 3D printed object, electronic equipment and medium

Also Published As

Publication number Publication date
CN107247985B (en) 2020-07-17

Similar Documents

Publication Publication Date Title
CN107247985A (en) Coding, positioning and the recognition methods of New Two Dimensional code
CN106529633B (en) Generation method, coding/decoding method and the device of two dimensional code
CN103793735B (en) Circular two-dimensional bar code and encoding and decoding method thereof
CN105989317B (en) Two-dimensional code identification method and device
CN105447546A (en) Two-dimensional code capable of being embedded with large-ratio graph as well as coding and decoding method and device therefor
CN106022431B (en) Method and device for generating, recognizing and reading color two-dimensional graph code of color identification type
CN107563477A (en) Quick Response Code and its generation method and device
CN102999772A (en) Novel array-type two-dimension code encoding and decoding methods
CN106295454B (en) For handling the data processing equipment and method of 2D color bar code
CN106778996A (en) It is embedded with the generation system and method and reading system of the Quick Response Code of visual pattern
CN107122816A (en) A kind of self-defined view finding figure Quick Response Code and generation method
CN111046996B (en) Color QR code generation and identification method
CN113313225B (en) Anti-counterfeiting method based on sparse dot matrix code
CN103119613A (en) Two-dimensional identification pattern, article including such a pattern, and methods for marking and identifying such a pattern
CN112001469A (en) Two-dimensional code encoding method, decoding method and two-dimensional code
CN108073966A (en) A kind of conversion method of Quick Response Code and hole horizontal and vertical parity check code
CN106874819A (en) Can be by sparse horizontal and vertical parity check code control method of handset identity
AU2017380263A1 (en) Method for detecting and recognising long-range high-density visual markers
CN103310251A (en) CCQR (Colorful Coded Quick Response) code encoding method and decoding method
CN108734048A (en) Various dimensions Quick Response Code based on proprietary code generates and interpretation method
CN115423063B (en) Anti-copying shading anti-counterfeiting method and device based on micro-point code
CN106875357A (en) Image in 2 D code processing method
Dean et al. Quick layered response (qlr) codes
CN109325568A (en) Anti-fake two-dimension code and its modulation encryption method and identifying system
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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 314006 Building 2, 3556 Linggongtang Road, Daqiao Town, Nanhu District, Jiaxing City, Zhejiang Province

Patentee after: Zhejiang Zhengya Dental Co.,Ltd.

Address before: 314006 north area, 4th floor, 239 Asia Pacific Road, Nanhu District, Jiaxing City, Zhejiang Province

Patentee before: ZHEJIANG YINCHILI MEDICAL TECHNOLOGY Co.,Ltd.