CN104657700A - Two-dimensional code anti-damaging decoding method - Google Patents

Two-dimensional code anti-damaging decoding method Download PDF

Info

Publication number
CN104657700A
CN104657700A CN201510131513.0A CN201510131513A CN104657700A CN 104657700 A CN104657700 A CN 104657700A CN 201510131513 A CN201510131513 A CN 201510131513A CN 104657700 A CN104657700 A CN 104657700A
Authority
CN
China
Prior art keywords
point
straight line
boundary
scanning
frontier
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
CN201510131513.0A
Other languages
Chinese (zh)
Other versions
CN104657700B (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.)
Guangzhou Huii Information Technology Co ltd
Original Assignee
Guangzhou Width Information 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 Guangzhou Width Information Technology Co Ltd filed Critical Guangzhou Width Information Technology Co Ltd
Priority to CN201510131513.0A priority Critical patent/CN104657700B/en
Publication of CN104657700A publication Critical patent/CN104657700A/en
Application granted granted Critical
Publication of CN104657700B publication Critical patent/CN104657700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a two-dimensional code anti-damaging decoding method. The two-dimensional code anti-damaging decoding method comprises the following steps: starting; obtaining an image, and judging whether a two-dimensional code exists in the image or not; if so, assuming a first two-dimensional code region; if not, obtaining the image again; assuming the first two-dimensional code region and decoding; if the decoding is successful, outputting a result; if the decoding is failed, assuming a second two-dimensional code region; assuming the second two-dimensional code region and decoding; if the decoding is successful, outputting a result; and if the decoding is failed, finishing, wherein the two-dimensional code is a genuine knowledge code or a Data Matrix code. The two-dimensional code anti-damaging decoding method has the advantages that the identification capability is strong, and a two-dimensional code image subjected to view finding graph stains can be decoded.

Description

A kind of Quick Response Code resistant to damage coding/decoding method
Technical field
The present invention relates to field of data recognition, is a kind of Quick Response Code resistant to damage coding/decoding method specifically.
Background technology
At present, the method for Quick Response Code decoding is generally: first obtain a square region be communicated with, then estimation of the order goes out 4 limits of square region, using these 4 limits as the border of Quick Response Code, decodes; Or adopt polygonal approximation to estimate 4 borders of Quick Response Code, decode.There is recognition capability difference in a kind of front method, have a limit to damage the shortcoming just can not decoded, a kind of rear method exists the shortcoming of recognition capability difference equally, and when there is border damage, polygonal approximation is easily made mistakes, and causes and can not decode.
Summary of the invention
Task of the present invention is exactly for above-mentioned technical matters, to provide a kind of recognition capability strong, the Quick Response Code resistant to damage coding/decoding method can decoded to stained, damaged Quick Response Code.
The present invention is realized by following technical proposals:
A kind of Quick Response Code resistant to damage coding/decoding method, is characterized in that: comprise the steps:
S101: start;
S102: obtain image, judge whether there is Quick Response Code in image, if there is Quick Response Code, jump to step S103, if there is not Quick Response Code, then again obtain image;
S103: suppose the first two-dimension code area, decode, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
S104: suppose the second two-dimension code area, decode, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
S106: export decoded result;
S107: terminate;
Wherein step S102 comprises the steps:
S1021: obtain image, and gray processing, binaryzation are carried out to image;
S1022: with the lower left corner of binary image for true origin, horizontal direction is x-axis, and vertical direction is y-axis, sets up plane right-angle coordinate;
S1023: find out the region identical with possible two-dimension code area color, at this region progressive scanning picture, find first marginal point, with this point for starting point, carry out frontier tracing, find out frontier point, if number >=168 of the frontier point be communicated with, then suppose that frontier point that these are communicated with surrounds a possible two-dimension code area, jump to step S103, otherwise jump to S1021; Wherein, during progressive scanning picture, can determine that the color of possible two-dimension code area represents: if when sweep trace scanning starting point, color is black by leucismus, then possible two-dimension code area is that normal Quick Response Code color represents, i.e. black correspondence 1, white corresponding 0, setting possible two-dimension code area color is black; Otherwise for reversion color represents, i.e. white corresponding 1, black correspondence 0, sets possible two-dimension code area color as white;
Step S103 comprises the steps:
S1031: the frontier point found out according to step S1023, matching boundary straight line, and the order of the boundary straight line of matching by boundary tracking is sorted, the end to end line segment that the point of adjacent boundary straight line intersection connects into is boundary sections;
S1032: find out 4 the longest segment boundary line segments, 4 boundary straight line corresponding to these 4 sections of boundary sections the longest are the first boundary line, suppose that the region that 4 the first boundary lines surround is the first two-dimension code area;
S1033: decode to the first two-dimension code area, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S104;
Step S104 comprises the steps:
S1041: suppose the second two-dimension code area position: find out in the boundary straight line of S1031 matching, 3 boundary straight line that the frontier point number of corresponding connection is maximum, these 3 boundary straight line are Second Edge boundary line, these 3 the second boundary straight lines are sorted by the order of boundary tracking, suppose to there is the 4th article of real the second boundary straight line, the region that 4 the second boundary straight lines are surrounded is the second two-dimension code area, and the 4th article of real the second boundary straight line is designated as L4 ';
S1042: determine the 4th article of the second boundary straight line supposed, the 4th article of the second boundary straight line supposed is designated as L4;
S1043: determine the 4th article of real the second boundary straight line;
S1044: decode to the second two-dimension code area, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
Wherein step S1042, comprises the steps:
The intersection point of any two the adjacent straight lines in 3 the second boundary straight lines of S10421: calculation procedure S1041 sequence, if there is the intersection point of a pair adjacent straight line to there is intersection point outside the region identical with view finding graphic color or not, this is designated as L1 and L2 to adjacent straight line according to the order sorted, article 3, that remaining in the second boundary straight line straight line is designated as L3, then L4 is crossing with L1 and L2 respectively, and L4 and L3 is parallel;
S10422: find out on L1, distance L3 frontier point farthest between upper and L1 and L2 of L2, crossing this farthest boundary point and be parallel on the straight line of L1 or L2, with this farthest boundary point for starting point, scan along the direction away from L3, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on L4, determine L4;
Step S1043 comprises the steps:
S10431: the intersection point calculating L4 and L1, L2, is designated as P1, P2 respectively;
S10432: the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate that calculate P1 and P2, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
S10433: on L4 take P1 as starting point, P2 is terminal, every 1-6 point get a point as scan start point, these are pressed its to P1 distance from the close-by examples to those far off, be designated as successively M1, M2 ... to M n; By M1, M2 ... order to M n scans;
S10434: as F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near L3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of L4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near L3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of L4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point
Find out with M1, M2 ... with all real frontier point that M n is scan start point, simulate straight line, this straight line is L4 ';
Wherein the first threshold values is 4-12 pixel;
Quick Response Code is Z-code or Data Matrix code.
Wherein, according to real frontier point, the method for L4 ' described in matching can adopt Hough transform method or least square method.
The further improvement project of the present invention comprises:
Described Quick Response Code resistant to damage coding/decoding method also comprises: carry out step S105 when described step S1044 decodes unsuccessfully;
S105: suppose the 3rd two-dimension code area, decode, if successfully decoded, then jumps to described step S106, if decode unsuccessfully, then jumps to described step S107;
Wherein, step S105 comprises the steps:
S1051: find out in the boundary straight line of described step S1031 matching, 2 boundary straight line that the frontier point of corresponding connection is maximum, and these 2 boundary straight line are sorted by the order of boundary tracking, be designated as W1 and W2, these 2 articles of boundary straight line are the 3rd boundary line, suppose to there is the 3rd, 4 article of the 3rd real boundary straight line, the region that 4 article of the 3rd boundary straight line is surrounded is the 3rd two-dimension code area, and the 3rd, 4 article of the 3rd real boundary straight line is designated as W3 ', W4 ';
S1052: determine the 3rd, 4 article the 3rd of the hypothesis relation between boundary straight line and W1 and W2, the 3rd, 4 article of the 3rd boundary straight line supposed is designated as W3, W4:
Calculate the intersection point of W1 and W2, and judge position of intersecting point: if this intersection point is on the region identical with view finding graphic color, then W3 and W1 is parallel, and W3 and W2 intersects, W4 and W2 is parallel, and W4 and W1 intersects, and jumps to step S1053; If this intersection point exists intersection point outside the region identical with view finding graphic color or not, then W3 with W4 is parallel, and W3 is crossing with W1 and W2 respectively, and W4 is crossing with W1 and W2 respectively, jumps to step S1054;
S1053:W3 and W1 is parallel, and W3 and W2 intersects, and W4 and W2 is parallel, and when W4 and W1 intersects, determines W3 ', W4 ', decode;
S1054:W3 with W4 is parallel, and W3 is crossing with W1 and W2 respectively, when W4 is crossing with W1 and W2 respectively, determines W3 ', W4 ', decodes;
Wherein, step S1053 comprises the steps:
S10531: determine W3 and W4:
Find out in the frontier point corresponding with W1, distance W2 frontier point farthest, crossing this farthest boundary point and be parallel on the straight line of W1, with this farthest boundary point for starting point, scan along away from the direction of W2, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W4, determine W4, the intersection point of W4 and W1 is designated as Q1;
Find out in the frontier point corresponding with W2, distance W1 frontier point farthest, crossing this farthest boundary point and be parallel on the straight line of W2, with this farthest boundary point for starting point, scan along away from the direction of W1, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W3, determine W3, the intersection point of W3 and W2 is designated as Q2;
Calculate the intersection point of W3 and W4, be designated as Q3;
S10532: determine W3 ':
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of Q2 and Q3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W3, take Q2 as starting point, Q3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W2 from the close-by examples to those far off, be designated as successively T1, T2 ... to T n; By T1, T2 ... order to T n scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W1, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W3 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W1, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W3 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with T1, T2 ... with all real frontier point that T n is scan start point, simulate straight line, this straight line is W3 ';
S10533: determine W4 ':
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of Q1 and Q3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W4, take Q1 as starting point, Q3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively J1, J2 ... to Jn; By J1, J2 ... order to Jn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W2, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W2, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with J1, J2 ... with all real frontier point that Jn is scan start point, simulate straight line, this straight line is W4 ';
S10534: the 3rd two-dimension code area is decoded, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jump to step S107;
Wherein, step S1054 comprises the steps:
S10541: find out in the frontier point corresponding with W1, be positioned at two frontier points at W1 bearing of trend two ends, find out in the frontier point corresponding with W2, be positioned at two frontier points at W2 bearing of trend two ends, and four frontier points are designated as G1, G2, G3 to G4 by the order of boundary tracking, G1 and G2 is the point on W1, G3 and G4 is the point on W2;
S10542: suppose G2 and G3, any one group of point in G1 and G4 two groups of points is the point on straight line W3, decodes, if successfully decoded, then jump to step S106, if decode unsuccessfully, then suppose that group point remaining in two groups of points is the point on straight line W3, decode, if successfully decoded, jump to step S106, if decode unsuccessfully, jump to step S107;
Wherein, in step S10542, suppose G2 and the G3 point that to be point on straight line and hypothesis G1 and G4 be on straight line W3, the decoding step of both of these case is identical; With G2 and G3 for the point on straight line W3, decode, comprise the steps:
S105421: determine W3 according to G2 and G3;
S105422: find out on W1, distance W3 frontier point farthest between upper and W1 and W2 of W2, crossing this farthest boundary point and be parallel on the straight line of W1 or W2, with this farthest boundary point for starting point, scan along the direction away from W3, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W4, determine W4, the intersection point of W4 and W1 is designated as E1, and the intersection point of W4 and W2 is designated as E4; In like manner, redefine W3, find out on W1, distance W4 frontier point farthest between upper and W1 and W2 of W2, crossing this farthest boundary point and be parallel on the straight line of W1 or W2, with this farthest boundary point for starting point, scan along the direction away from W4, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W3, cross this point, make the straight line being parallel to W4, namely can redefine W3, the intersection point of W3 and the W1 redefined is designated as E2, and the intersection point of W3 and the W2 redefined is designated as E3;
S105423: determine W3 ', comprises the steps:
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of E2 and E3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On the W3 redefined, take E2 as starting point, E3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively R1, R2 ... to Rn; By R1, R2 ... order to Rn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W4, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of the W3 redefined time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W4, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of the W3 redefined time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with R1, R2 ... with all real frontier point that R n is scan start point, simulate straight line, this straight line is W3 ';
S105424: determine W4 ', comprises the steps:
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of E1 and E4, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W4, take E1 as starting point, E4 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively V1, V2 ... to Vn; By V1, V2 ... order to Vn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with V1, V2 ... with all real frontier point that Vn is scan start point, simulate straight line, this straight line is W4 ';
S105425: the 3rd two-dimension code area is decoded.
Wherein, according to real frontier point, the method for W3 ' described in matching and/or W4 ' can adopt Hough transform method or least square method.
Beneficial effect: beneficial effect: Quick Response Code resistant to damage coding/decoding method recognition capability disclosed by the invention is strong, effectively can identify the image in 2 D code that view finding figure is stained, damaged.
Accompanying drawing explanation
Fig. 1 is one of decoding process figure of Quick Response Code resistant to damage coding/decoding method of the present invention;
Fig. 2 is the decoding process figure bis-of Quick Response Code resistant to damage coding/decoding method of the present invention;
Fig. 3 is the method schematic diagram that step S103 finds out the first two-dimension code area;
Fig. 4 is the method schematic diagram that step S104 finds out the second two-dimension code area;
Fig. 5 is the method schematic diagram that step S1053 finds out the 3rd two-dimension code area;
Fig. 6 is the method schematic diagram that step S1054 finds out the 3rd two-dimension code area.
Embodiment
As shown in Figure 1, a kind of Quick Response Code resistant to damage coding/decoding method, comprises the steps:
S101: start;
S102: obtain image, judge whether there is Quick Response Code in image, if there is Quick Response Code, jump to step S103, if there is not Quick Response Code, then again obtain image;
S103: suppose the first two-dimension code area, decode, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
S104: suppose the second two-dimension code area, decode, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
S106: export decoded result;
S107: terminate;
Wherein the first threshold values is 4-12 pixel;
Step S102 comprises the steps:
S1021: obtain image, and gray processing, binaryzation are carried out to image;
S1022: with the lower left corner of binary image for true origin, horizontal direction is x-axis, and vertical direction is y-axis, sets up plane right-angle coordinate; Can selection level direction to the right be X-axis positive dirction, can selection level direction left be also the positive dirction of X-axis; Direction straight up can be selected to be Y-axis positive dirction, direction straight down also can be selected to be the positive dirction of Y-axis;
S1023: find out the region identical with possible two-dimension code area color, at this region progressive scanning picture, find first marginal point, with this point for starting point, carry out frontier tracing, find out frontier point, if number >=168 of the frontier point be communicated with, then suppose that frontier point that these are communicated with surrounds a possible two-dimension code area, jump to step S103, otherwise jump to S1021; Wherein, during progressive scanning picture, can determine that the color of possible two-dimension code area represents: if when sweep trace scanning starting point, color is black by leucismus, then possible two-dimension code area is that normal Quick Response Code color represents, i.e. black correspondence 1, white corresponding 0, setting possible two-dimension code area color is black; Otherwise for reversion color represents, i.e. white corresponding 1, black correspondence 0, sets possible two-dimension code area color as white;
Step S103 comprises the steps:
S1031: the frontier point found out according to step S1023, matching boundary straight line, and the order of the boundary straight line of matching by boundary tracking is sorted, the end to end line segment that the point of adjacent boundary straight line intersection connects into is boundary sections; Fig. 3 shows the method for step S103, simulates altogether six boundary lines, is respectively A1, A2, A3, A4, A5 and A6;
S1032: find out 4 the longest segment boundary line segments, 4 boundary straight line corresponding to these 4 sections of boundary sections the longest are the first boundary line, suppose that the region that 4 the first boundary lines surround is the first two-dimension code area; A1, A2, A3 and A4 in Fig. 3 are the first boundary line;
S1033: decode to the first two-dimension code area, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S104;
Step S104 comprises the steps:
S1041: suppose the second two-dimension code area position: find out in the boundary straight line of S1031 matching, 3 boundary straight line that the frontier point number of corresponding connection is maximum, these 3 boundary straight line are Second Edge boundary line, these 3 the second boundary straight lines are sorted by the order of boundary tracking, suppose to there is the 4th article of real the second boundary straight line, the region that 4 the second boundary straight lines are surrounded is the second two-dimension code area, and the 4th article of real the second boundary straight line is designated as L4 '; Fig. 4 shows step S104 method.
S1042: determine the 4th article of the second boundary straight line supposed, the 4th article of the second boundary straight line supposed is designated as L4;
S1043: determine the 4th article of real the second boundary straight line;
S1044: decode to the second two-dimension code area, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
Wherein step S1042, comprises the steps:
The intersection point of any two the adjacent straight lines in 3 the second boundary straight lines of S10421: calculation procedure S1041 sequence, if there is the intersection point of a pair adjacent straight line to there is intersection point outside the region identical with view finding graphic color or not, this is designated as L1 and L2 to adjacent straight line according to the order sorted, article 3, that remaining in the second boundary straight line straight line is designated as L3, then L4 is crossing with L1 and L2 respectively, and L4 and L3 is parallel;
S10422: find out on L1, distance L3 frontier point farthest between upper and L1 and L2 of L2, crossing this farthest boundary point and be parallel on the straight line of L1 or L2, with this farthest boundary point for starting point, scan along the direction away from L3, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on L4, determine L4;
Step S1043 comprises the steps:
S10431: the intersection point calculating L4 and L1, L2, is designated as P1, P2 respectively;
S10432: the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate that calculate P1 and P2, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
S10433: on L4 take P1 as starting point, P2 is terminal, every 1-6 point get a point as scan start point, these are pressed its to P1 distance from the close-by examples to those far off, be designated as successively M1, M2, M3 ... to M n; By M1, M2, M3 ... order to M n scans;
S10434: as F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near L3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of L4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near L3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of L4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point
Find out with M1, M2, M3 ... with all real frontier point that M n is scan start point, simulate straight line, this straight line is L4 '; According to real frontier point, the method for matching L4 ' can adopt Hough transformation or least square method.
Quick Response Code is Z-code or Data Matrix code.
Embodiment 2
As shown in Figure 2, the present embodiment has carried out following improvement on the basis of embodiment 1:
Step S105 is carried out when the step S1044 of embodiment 1 decodes unsuccessfully;
S105: suppose the 3rd two-dimension code area, decode, if successfully decoded, then jump to step S106, if decode unsuccessfully, then jump to step S107;
Wherein, step S105 comprises the steps:
S1051: find out in the boundary straight line of S1031 matching, 2 boundary straight line that the frontier point of corresponding connection is maximum, and these 2 boundary straight line are sorted by the order of boundary tracking, be designated as W1 and W2, these 2 articles of boundary straight line are the 3rd boundary line, suppose to there is the 3rd, 4 article of the 3rd real boundary straight line, the region that 4 article of the 3rd boundary straight line is surrounded is the 3rd two-dimension code area, and the 3rd, 4 article of the 3rd real boundary straight line is designated as W3 ', W4 ';
S1052: determine the 3rd, 4 article the 3rd of the hypothesis relation between boundary straight line and W1 and W2, the 3rd, 4 article of the 3rd boundary straight line supposed is designated as W3, W4:
Calculate the intersection point of W1 and W2, and judge position of intersecting point: if this intersection point is on the region identical with view finding graphic color, then W3 and W1 is parallel, and W3 and W2 intersects, W4 and W2 is parallel, and W4 and W1 intersects, and jumps to step S1053; If this intersection point exists intersection point outside the region identical with view finding graphic color or not, then W3 with W4 is parallel, and W3 is crossing with W1 and W2 respectively, and W4 is crossing with W1 and W2 respectively, jumps to step S1054;
S1053:W3 and W1 is parallel, and W3 and W2 intersects, and W4 and W2 is parallel, and when W4 and W1 intersects, determines W3 ', W4 ', decode;
S1054:W3 with W4 is parallel, and W3 is crossing with W1 and W2 respectively, when W4 is crossing with W1 and W2 respectively, determines W3 ', W4 ', decodes;
Wherein, step S1053 comprises the steps:
S10531: determine W3 and W4:
Find out in the frontier point corresponding with W1, distance W2 frontier point farthest, crossing this farthest boundary point and be parallel on the straight line of W1, with this farthest boundary point for starting point, scan along away from the direction of W2, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W4, determine W4, the intersection point of W4 and W1 is designated as Q1; Fig. 5 shows the method that step S1053 finds out the 3rd two-dimension code area;
Find out in the frontier point corresponding with W2, distance W1 frontier point farthest, crossing this farthest boundary point and be parallel on the straight line of W2, with this farthest boundary point for starting point, scan along away from the direction of W1, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W3, determine W3, the intersection point of W3 and W2 is designated as Q2;
Calculate the intersection point of W3 and W4, be designated as Q3;
S10532: determine W3 ':
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of Q2 and Q3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W3, take Q2 as starting point, Q3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W2 from the close-by examples to those far off, be designated as successively T1, T2, T3 ... to T n; By T1, T2, T3 ... order to T n scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W1, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W3 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W1, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W3 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with T1, T2, T3 ... with all real frontier point that T n is scan start point, simulate straight line, this straight line is W3 ';
S10533: determine W4 ':
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of Q1 and Q3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W4, take Q1 as starting point, Q3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively J1, J2, J3 ... to Jn; By J1, J2, J3 ... order to Jn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W2, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W2, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with J1, J2, J3 ... with all real frontier point that Jn is scan start point, simulate straight line, this straight line is W4 ';
S10534: the 3rd two-dimension code area is decoded, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jump to step S107;
Wherein, step S1054 comprises the steps:
S10541: find out in the frontier point corresponding with W1, be positioned at two frontier points at W1 bearing of trend two ends, find out in the frontier point corresponding with W2, be positioned at two frontier points at W2 bearing of trend two ends, and four frontier points are designated as G1, G2, G3 to G4 by the order of boundary tracking, G1 and G2 is the point on W1, G3 and G4 is the point on W2; Fig. 6 shows the method that step S1054 finds out the 3rd two-dimension code area;
S10542: suppose G2 and G3, any one group of point in G1 and G4 two groups of points is the point on straight line W3, decodes, if successfully decoded, then jump to step S106, if decode unsuccessfully, then suppose that group point remaining in two groups of points is the point on straight line W3, decode, if successfully decoded, jump to step S106, if decode unsuccessfully, jump to step S107;
Wherein, in step S10542, suppose G2 and the G3 point that to be point on straight line and hypothesis G1 and G4 be on straight line W3, the decoding step of both of these case is identical; With G2 and G3 for the point on straight line W3, decode, comprise the steps:
S105421:S105421: determine W3 according to G2 and G3;
S105422: find out on W1, distance W3 frontier point farthest between upper and W1 and W2 of W2, crossing this farthest boundary point and be parallel on the straight line of W1 or W2, with this farthest boundary point for starting point, scan along the direction away from W3, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W4, determine W4, the intersection point of W4 and W1 is designated as E1, and the intersection point of W4 and W2 is designated as E4; In like manner, redefine W3, find out on W1, distance W4 frontier point farthest between upper and W1 and W2 of W2, crossing this farthest boundary point and be parallel on the straight line of W1 or W2, with this farthest boundary point for starting point, scan along the direction away from W4, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W3, cross this point, make the straight line being parallel to W4, namely can redefine W3, the intersection point of W3 and the W1 redefined is designated as E2, and the intersection point of W3 and the W2 redefined is designated as E3;
S105423: determine W3 ', comprises the steps:
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of E2 and E3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On the W3 redefined, take E2 as starting point, E3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively R1, R2, R3 ... to Rn; By R1, R2, R3 ... order to Rn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W4, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of the W3 redefined time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W4, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of the W3 redefined time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with R1, R2, R3 ... with all real frontier point that R n is scan start point, simulate straight line, this straight line is W3 ';
S105424: determine W4 ', comprises the steps:
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of E1 and E4, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W4, take E1 as starting point, E4 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively V1, V2, V3 ... to Vn; By V1, V2, V3 ... order to Vn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with V1, V2, V3 ... with all real frontier point that Vn is scan start point, simulate straight line, this straight line is W4 ';
S105425: the 3rd two-dimension code area is decoded.
Wherein, according to real frontier point, the method for matching W3 ' and/or W4 ' can adopt Hough transform method or least square method.
Quick Response Code resistant to damage coding/decoding method recognition capability of the present invention is strong, can pollute, destroy the environmental applications of Quick Response Code at commute, even if a damaged limit even two limits when, Z-code still can correctly identify, effectively can expand the usable range of Quick Response Code.

Claims (4)

1. a Quick Response Code resistant to damage coding/decoding method, is characterized in that: comprise the steps:
S101: start;
S102: obtain image, judge whether there is Quick Response Code in image, if there is Quick Response Code, jump to step S103, if there is not Quick Response Code, then again obtain image;
S103: suppose the first two-dimension code area, decode, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
S104: suppose the second two-dimension code area, decode, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
S106: export decoded result;
S107: terminate;
Wherein step S102 comprises the steps:
S1021: obtain image, and gray processing, binaryzation are carried out to image;
S1022: with the lower left corner of binary image for true origin, horizontal direction is x-axis, and vertical direction is y-axis, sets up plane right-angle coordinate;
S1023: find out the region identical with possible two-dimension code area color, at this region progressive scanning picture, find first marginal point, with this point for starting point, carry out frontier tracing, find out frontier point, if number >=168 of the frontier point be communicated with, then suppose that frontier point that these are communicated with surrounds a possible two-dimension code area, jump to step S103, otherwise jump to S1021; Wherein, during progressive scanning picture, can determine that the color of possible two-dimension code area represents: if when sweep trace scanning starting point, color is black by leucismus, then possible two-dimension code area is that normal Quick Response Code color represents, i.e. black correspondence 1, white corresponding 0, setting possible two-dimension code area color is black; Otherwise for reversion color represents, i.e. white corresponding 1, black correspondence 0, sets possible two-dimension code area color as white;
Step S103 comprises the steps:
S1031: the frontier point found out according to step S1023, matching boundary straight line, and the order of the boundary straight line of matching by boundary tracking is sorted, the end to end line segment that the point of adjacent boundary straight line intersection connects into is boundary sections;
S1032: find out 4 the longest segment boundary line segments, 4 boundary straight line corresponding to these 4 sections of boundary sections the longest are the first boundary line, suppose that the region that 4 the first boundary lines surround is the first two-dimension code area;
S1033: decode to the first two-dimension code area, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S104;
Step S104 comprises the steps:
S1041: suppose the second two-dimension code area position: find out in the boundary straight line of S1031 matching, 3 boundary straight line that the frontier point number of corresponding connection is maximum, these 3 boundary straight line are Second Edge boundary line, these 3 the second boundary straight lines are sorted by the order of boundary tracking, suppose to there is the 4th article of real the second boundary straight line, the region that 4 the second boundary straight lines are surrounded is the second two-dimension code area, and the 4th article of real the second boundary straight line is designated as L4 ';
S1042: determine the 4th article of the second boundary straight line supposed, the 4th article of the second boundary straight line supposed is designated as L4;
S1043: determine the 4th article of real the second boundary straight line;
S1044: decode to the second two-dimension code area, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jumps to step S107;
Wherein step S1042, comprises the steps:
The intersection point of any two the adjacent straight lines in 3 the second boundary straight lines of S10421: calculation procedure S1041 sequence, if there is the intersection point of a pair adjacent straight line to there is intersection point outside the region identical with view finding graphic color or not, this is designated as L1 and L2 to adjacent straight line according to the order sorted, article 3, that remaining in the second boundary straight line straight line is designated as L3, then L4 is crossing with L1 and L2 respectively, and L4 and L3 is parallel;
S10422: find out on L1, distance L3 frontier point farthest between upper and L1 and L2 of L2, crossing this farthest boundary point and be parallel on the straight line of L1 or L2, with this farthest boundary point for starting point, scan along the direction away from L3, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on L4, determine L4;
Step S1043 comprises the steps:
S10431: the intersection point calculating L4 and L1, L2, is designated as P1, P2 respectively;
S10432: the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate that calculate P1 and P2, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
S10433: on L4 take P1 as starting point, P2 is terminal, every 1-6 point get a point as scan start point, these are pressed its to P1 distance from the close-by examples to those far off, be designated as successively M1, M2 ... to M n; By M1, M2 ... order to M n scans;
S10434: as F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near L3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of L4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near L3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of L4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point
Find out with M1, M2 ... with all real frontier point that M n is scan start point, simulate straight line, this straight line is L4 ';
Wherein the first threshold values is 4-12 pixel;
Quick Response Code is Z-code or Data Matrix code.
2. Quick Response Code resistant to damage coding/decoding method according to claim 1, is characterized in that: described Quick Response Code resistant to damage coding/decoding method also comprises: carry out step S105 when described step S1044 decodes unsuccessfully;
S105: suppose the 3rd two-dimension code area, decode, if successfully decoded, then jumps to described step S106, if decode unsuccessfully, then jumps to described step S107;
Wherein, step S105 comprises the steps:
S1051: find out in the boundary straight line of described step S1031 matching, 2 boundary straight line that the frontier point of corresponding connection is maximum, and these 2 boundary straight line are sorted by the order of boundary tracking, be designated as W1 and W2, these 2 articles of boundary straight line are the 3rd boundary line, suppose to there is the 3rd, 4 article of the 3rd real boundary straight line, the region that 4 article of the 3rd boundary straight line is surrounded is the 3rd two-dimension code area, and the 3rd, 4 article of the 3rd real boundary straight line is designated as W3 ', W4 ';
S1052: determine the 3rd, 4 article the 3rd of the hypothesis relation between boundary straight line and W1 and W2, the 3rd, 4 article of the 3rd boundary straight line supposed is designated as W3, W4:
Calculate the intersection point of W1 and W2, and judge position of intersecting point: if this intersection point is on the region identical with view finding graphic color, then W3 and W1 is parallel, and W3 and W2 intersects, W4 and W2 is parallel, and W4 and W1 intersects, and jumps to step S1053; If this intersection point exists intersection point outside the region identical with view finding graphic color or not, then W3 with W4 is parallel, and W3 is crossing with W1 and W2 respectively, and W4 is crossing with W1 and W2 respectively, jumps to step S1054;
S1053:W3 and W1 is parallel, and W3 and W2 intersects, and W4 and W2 is parallel, and when W4 and W1 intersects, determines W3 ', W4 ', decode;
S1054:W3 with W4 is parallel, and W3 is crossing with W1 and W2 respectively, when W4 is crossing with W1 and W2 respectively, determines W3 ', W4 ', decodes;
Wherein, step S1053 comprises the steps:
S10531: determine W3 and W4:
Find out in the frontier point corresponding with W1, distance W2 frontier point farthest, crossing this farthest boundary point and be parallel on the straight line of W1, with this farthest boundary point for starting point, scan along away from the direction of W2, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W4, determine W4, the intersection point of W4 and W1 is designated as Q1;
Find out in the frontier point corresponding with W2, distance W1 frontier point farthest, crossing this farthest boundary point and be parallel on the straight line of W2, with this farthest boundary point for starting point, scan along away from the direction of W1, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W3, determine W3, the intersection point of W3 and W2 is designated as Q2;
Calculate the intersection point of W3 and W4, be designated as Q3;
S10532: determine W3 ':
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of Q2 and Q3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W3, take Q2 as starting point, Q3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W2 from the close-by examples to those far off, be designated as successively T1, T2 ... to T n; By T1, T2 ... order to T n scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W1, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W3 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W1, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W3 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with T1, T2 ... with all real frontier point that T n is scan start point, simulate straight line, this straight line is W3 ';
S10533: determine W4 ':
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of Q1 and Q3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W4, take Q1 as starting point, Q3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively J1, J2 ... to Jn; By J1, J2 ... order to Jn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W2, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W2, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with J1, J2 ... with all real frontier point that Jn is scan start point, simulate straight line, this straight line is W4 ';
S10534: the 3rd two-dimension code area is decoded, if successfully decoded, then jumps to step S106, if decode unsuccessfully, then jump to step S107;
Wherein, step S1054 comprises the steps:
S10541: find out in the frontier point corresponding with W1, be positioned at two frontier points at W1 bearing of trend two ends, find out in the frontier point corresponding with W2, be positioned at two frontier points at W2 bearing of trend two ends, and four frontier points are designated as G1, G2, G3 to G4 by the order of boundary tracking, G1 and G2 is the point on W1, G3 and G4 is the point on W2;
S10542: suppose G2 and G3, any one group of point in G1 and G4 two groups of points is the point on straight line W3, decodes, if successfully decoded, then jump to step S106, if decode unsuccessfully, then suppose that group point remaining in two groups of points is the point on straight line W3, decode, if successfully decoded, jump to step S106, if decode unsuccessfully, jump to step S107;
Wherein, in step S10542, suppose G2 and the G3 point that to be point on straight line and hypothesis G1 and G4 be on straight line W3, the decoding step of both of these case is identical; With G2 and G3 for the point on straight line W3, decode, comprise the steps:
S105421: determine W3 according to G2 and G3;
S105422: find out on W1, distance W3 frontier point farthest between upper and W1 and W2 of W2, crossing this farthest boundary point and be parallel on the straight line of W1 or W2, with this farthest boundary point for starting point, scan along the direction away from W3, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W4, determine W4, the intersection point of W4 and W1 is designated as E1, and the intersection point of W4 and W2 is designated as E4; In like manner, redefine W3, find out on W1, distance W4 frontier point farthest between upper and W1 and W2 of W2, crossing this farthest boundary point and be parallel on the straight line of W1 or W2, with this farthest boundary point for starting point, scan along the direction away from W4, if number >=5 of the point different from view finding graphic color that continuous sweep is arrived, then suppose that this farthest boundary point is the point on W3, cross this point, make the straight line being parallel to W4, namely can redefine W3, the intersection point of W3 and the W1 redefined is designated as E2, and the intersection point of W3 and the W2 redefined is designated as E3;
S105423: determine W3 ', comprises the steps:
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of E2 and E3, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On the W3 redefined, take E2 as starting point, E3 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively R1, R2 ... to Rn; By R1, R2 ... order to Rn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W4, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of the W3 redefined time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W4, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of the W3 redefined time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with R1, R2 ... with all real frontier point that R n is scan start point, simulate straight line, this straight line is W3 ';
S105424: determine W4 ', comprises the steps:
Calculate the absolute value │ Δ y │ of difference of ordinate and the absolute value │ Δ x │ of the difference of horizontal ordinate of E1 and E4, and compare size, comparative result is designated as F, if │ Δ y │≤│ Δ x │, then and F=1, otherwise, F=0;
On W4, take E1 as starting point, E4 be terminal, get a point as scan start point every 1-6 point, these are pressed its distance to W1 from the close-by examples to those far off, be designated as successively V1, V2 ... to Vn; By V1, V2 ... order to Vn scans;
As F=1, crossing a scan start point and be parallel on the straight line of y-axis, from this scan start point towards the enterprising line scanning in direction near W3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
As F=0, crossing a scan start point and be parallel on the straight line of x-axis, from this scan start point towards the enterprising line scanning in direction near W3, when finding identical with a view finding graphic color point or the point of scanning to distance >=the first threshold values of W4 time, stop the scanning on this straight line, the point that this is identical with view finding graphic color is recorded as real frontier point;
Find out with V1, V2 ... with all real frontier point that Vn is scan start point, simulate straight line, this straight line is W4 ';
S105425: the 3rd two-dimension code area is decoded.
3. Quick Response Code resistant to damage coding/decoding method according to claim 1, is characterized in that: according to real frontier point, and the method for L4 ' described in matching is: adopt Hough transformation or least square fitting straight line.
4. Quick Response Code resistant to damage coding/decoding method according to claim 2, is characterized in that: according to real frontier point, and the method for W3 ' described in matching and/or W4 ' is: adopt Hough transformation or least square fitting straight line.
CN201510131513.0A 2015-03-25 2015-03-25 A kind of Quick Response Code resistant to damage coding/decoding method Active CN104657700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510131513.0A CN104657700B (en) 2015-03-25 2015-03-25 A kind of Quick Response Code resistant to damage coding/decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510131513.0A CN104657700B (en) 2015-03-25 2015-03-25 A kind of Quick Response Code resistant to damage coding/decoding method

Publications (2)

Publication Number Publication Date
CN104657700A true CN104657700A (en) 2015-05-27
CN104657700B CN104657700B (en) 2017-07-25

Family

ID=53248802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510131513.0A Active CN104657700B (en) 2015-03-25 2015-03-25 A kind of Quick Response Code resistant to damage coding/decoding method

Country Status (1)

Country Link
CN (1) CN104657700B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107545289A (en) * 2017-09-19 2018-01-05 闫河 The coding method of matrix two-dimensional code and coding/decoding method
CN108491897A (en) * 2018-01-30 2018-09-04 阿里巴巴集团控股有限公司 A kind of information identifying method, server, client and system
CN109472178A (en) * 2018-09-18 2019-03-15 广州思林杰网络科技有限公司 Two-dimensional code scanning method
CN109492451A (en) * 2018-10-30 2019-03-19 维沃移动通信有限公司 A kind of coded image recognition methods and mobile terminal
CN110222547A (en) * 2019-04-29 2019-09-10 北京三快在线科技有限公司 Bar code recognition and device
CN113947097A (en) * 2020-07-15 2022-01-18 华为技术有限公司 Two-dimensional code identification method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070181684A1 (en) * 2004-10-15 2007-08-09 Masanori Takano Object, image data, image data transmission method, card, game mat, card game system, image analysis device, and image analysis method
CN102708349A (en) * 2012-05-11 2012-10-03 深圳市天朗时代科技有限公司 Method for decoding matrix two-dimensional code
KR101293703B1 (en) * 2011-11-28 2013-08-06 (주)이컴앤드시스템 A system for decoding skewed data matrix barcode, and the method therefor
CN103955663A (en) * 2014-04-22 2014-07-30 广州宽度信息技术有限公司 QR code fouling resistance identification method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070181684A1 (en) * 2004-10-15 2007-08-09 Masanori Takano Object, image data, image data transmission method, card, game mat, card game system, image analysis device, and image analysis method
KR101293703B1 (en) * 2011-11-28 2013-08-06 (주)이컴앤드시스템 A system for decoding skewed data matrix barcode, and the method therefor
CN102708349A (en) * 2012-05-11 2012-10-03 深圳市天朗时代科技有限公司 Method for decoding matrix two-dimensional code
CN103955663A (en) * 2014-04-22 2014-07-30 广州宽度信息技术有限公司 QR code fouling resistance identification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
欧福超: "基于图像处理的QR码图像预处理的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107545289A (en) * 2017-09-19 2018-01-05 闫河 The coding method of matrix two-dimensional code and coding/decoding method
CN108491897A (en) * 2018-01-30 2018-09-04 阿里巴巴集团控股有限公司 A kind of information identifying method, server, client and system
CN109472178A (en) * 2018-09-18 2019-03-15 广州思林杰网络科技有限公司 Two-dimensional code scanning method
CN109472178B (en) * 2018-09-18 2021-12-14 广州思林杰科技股份有限公司 Two-dimensional code scanning method
CN109492451A (en) * 2018-10-30 2019-03-19 维沃移动通信有限公司 A kind of coded image recognition methods and mobile terminal
CN110222547A (en) * 2019-04-29 2019-09-10 北京三快在线科技有限公司 Bar code recognition and device
CN113947097A (en) * 2020-07-15 2022-01-18 华为技术有限公司 Two-dimensional code identification method and electronic equipment
CN113947097B (en) * 2020-07-15 2024-04-09 花瓣云科技有限公司 Two-dimensional code identification method and electronic equipment

Also Published As

Publication number Publication date
CN104657700B (en) 2017-07-25

Similar Documents

Publication Publication Date Title
CN104657700A (en) Two-dimensional code anti-damaging decoding method
JP7429542B2 (en) Graphical fiducial marker identification suitable for augmented reality, virtual reality, and robotics
JP3209108B2 (en) 2D code reader
Samra et al. Localization of license plate number using dynamic image processing techniques and genetic algorithms
US8194983B2 (en) Method and system for preprocessing an image for optical character recognition
US9087253B2 (en) Method and system for determining edge line in QR code binary image
CN103955663B (en) QR code fouling resistance identification method
CN112784853B (en) Terminal connection state detection method and device
CN106845314B (en) A kind of method for rapidly positioning of two dimensional code
CN111968185A (en) Calibration board, nine-point calibration object grabbing method and system based on code definition
CN110705442B (en) Automatic test paper answer acquisition method, terminal equipment and storage medium
CN109740403B (en) Method and device for reading one-dimensional bar code
Masalovitch et al. Usage of continuous skeletal image representation for document images de-warping
CN107563314B (en) Lane line detection method based on parallel coordinate system
CN112800731B (en) Table repairing method for dealing with distorted graphs in image table extraction
KR100991878B1 (en) Code decoding method being indicated on printed object
US8708237B2 (en) Encoding and decoding method for microdot matrix
CN103250179A (en) Method for marking graphical elements and method for detecting said marking in graphical elements
CN106412377B (en) Image processing apparatus
CN108647697A (en) A kind of object boundary detection method and device based on Improved Hough Transform
CN111260723B (en) Barycenter positioning method of bar and terminal equipment
CN110035279B (en) Method and device for searching SFR test area in checkerboard test pattern
CN112518759A (en) Robot and scanning pile feeding method and device thereof
CN111860025A (en) Two-dimensional code region-of-interest positioning method and device
CN112541894B (en) Product deformation detection method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220531

Address after: 510663 No. b013-b015, office card space of yueembedded Zhongchuang space on the fourth floor of block A107 and block B, creative center, TCL Cultural Industry Park, No. 69, spectrum West Road, Science City, Huangpu District, Guangzhou, Guangdong Province

Patentee after: Guangzhou Huii Information Technology Co.,Ltd.

Address before: 510663 Room 502, floor 5, zone B2, No. 162, science Avenue, Science City, high tech Development Zone, Guangzhou, Guangdong

Patentee before: GUANGZHOU WIDTH INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right