1、ICS 01.080.50; 35.040 Ref. No. ISO/IEC 16022:2006/Cor.2:2011(E) ISO/IEC 2011 All rights reserved Published in Switzerland INTERNATIONAL STANDARD ISO/IEC 16022:2006 TECHNICAL CORRIGENDUM 2 Published 2011-02-01 INTERNATIONAL ORGANIZATION FOR STANDARDIZATION ORGANISATION INTERNATIONALE DE NORMALISATION
2、 INTERNATIONAL ELECTROTECHNICAL COMMISSION COMMISSION LECTROTECHNIQUE INTERNATIONALEInformation technology Automatic identification and data capture techniques Data Matrix bar code symbology specification TECHNICAL CORRIGENDUM 2 Technologies de linformation Techniques automatiques didentification et
3、 de capture des donnes Spcification de symbologie de code barres Data Matrix RECTIFICATIF TECHNIQUE 2 Technical Corrigendum 2 to ISO/IEC 16022:2006 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 31, Automatic identification and data capture technique
4、s. Page 28 Replace Clause 9 with the following: 9 Reference decode algorithm for Data Matrix This reference decode algorithm finds a Data Matrix symbol in an image and decodes it. a) Define measurement parameters and form a digitised image: 1) Define a distance dmin which is 7,5 times the aperture d
5、iameter defined by the application. This will be the minimum length of the “L“ patterns side. ISO/IEC 16022:2006/Cor.2:2011(E) 2 ISO/IEC 2011 All rights reserved2) Define a distance gmax which is 7,5 times the aperture diameter. This is the largest gap in the “L“ finder that will be tolerated by the
6、 finder algorithm in step b). 3) Define a distance mmin which is 1,25 times the aperture diameter. This would be the nominal minimum module size when the aperture size is 80% of the symbols X dimension. 4) Form a black/white image using a threshold determined according to the method defined in ISO/I
7、EC 15415. b) Search horizontal and vertical scan lines for the two outside edges of the Data Matrix “L“: 1) Extend a scan line horizontally in both directions from the centre point of the image. Sample along the scan line. For each white/black or black/white transition found along the scan line reso
8、lved to the pixel boundary: i) Follow the edge upward sampling pixel by pixel until either it reaches a point 3,5mmin distant from the intersection of the scan line and the edge starting point, or the edge turns back toward the intersection of the scan line and the edge - the starting point. ii) Fol
9、low the edge downward pixel by pixel until either it reaches a point 3,5mmin distant from the intersection of the scan line and the edge starting point, or the edge turns back toward the intersection of the scan line and the edge - the starting point. iii) If the upward edge reaches a point 3,5mmin
10、from the starting point: I) Plot a line A connecting the end points of the upward edge. II) Test whether the intermediate edge points lie within 0,5mmin from line A. If so, continue to step III. Otherwise proceed to step 1)iv) to follow the edge in the opposite direction. III) Continue following the
11、 edge upward until the edge departs 0,5mmin from line A. Back up to the closest edge point greater than or equal to mmin from the last edge point along the edge before the departing point and save this as the edge end point. This edge point should be along the “L“ candidate outside edge. IV) Continu
12、e following the edge downward until the edge departs 0,5mmin from line A. Back up to the closest edge point greater than or equal to mmin from the last edge point along the edge before the departing point and save this as the edge end point. This edge point should be along the “L“ candidate outside
13、edge. V) Calculate a new adjusted line A1 that is a “best fit“ line to the edge in the two previous steps. The “best fit“ line uses the linear regression algorithm (using the end points to select the proper dependent axis, i.e. if closer to horizontal, the dependent axis is x) applied to each point.
14、 The “best fit“ line terminates lines at points p1 and p2 that are the points on the “best fit“ line closest to the endpoints of the edge. VI) Save the line A1 segment two end points, p1 and p2. Also save the colour of the left side of the edge viewed from p1 to p2. iv) If step iii) failed or did no
15、t extend upward by 3,5mmin in step iii)IV), test if the downward edge reaches a point 3,5mmin from the starting point. If so, repeat the steps in iii) but with the downward edge. v) If neither steps iii) or iv) were successful, test if both the upward and downward edges terminated at least 2mmin fro
16、m the starting point. If so, form an edge comprised of the appended 2mmin length upward and downward edge segments and repeat the steps in iii) but with the appended edge. vi) Proceed to and process the next transitions on the scan line, repeating from step i), until the boundary of the image is rea
17、ched. ISO/IEC 16022:2006/Cor.2:2011(E) ISO/IEC 2011 All rights reserved 32) Extend a scan line vertically in both directions from the centre point of the image. Look for line segments using the same logic in step 1) above but following each edge transition first left and then right. 3) Search among
18、the saved line A1 segments for pairs of line segments that meet the following four criteria: i) If the two lines have the same p1 to p2 directions, verify that the closer of the interline p1 to p2 distances is less than g max . If the two lines have opposite p1 to p2 directions, verify that the clos
19、er of the interline p1 to p1 or p2 to p2 distances is less than g max . ii) Verify that the two lines are co-linear within 5 degrees. iii) Verify that the two lines have the same saved colour if their p1 to p2 directions are the same or that the saved colours are opposite if their p1 to p2 direction
20、s are opposite to each other. iv) Form two temporary lines by extending each line to reach the point on the extension that is closest to the furthest end point of the other line segment. Verify that the two extended lines are separated by less than 0,5mmin at any point between the two extended lines
21、. 4) For each pair of lines meeting the criteria of step 3) above, replace the pair of line segments with a longer A1 line segment that is a “best fit“ line to the four end points of the pair of shorter line segments. Also save the colour of the left side of the edge of the new longer line viewed fr
22、om its p1 endpoint to its p2 endpoint. 5) Repeat steps 3) and 4) until no more A1 line pairs can be combined. 6) Select line segments that are at least as long as dmin. Flag them as “L“ side candidates. 7) Look for pairs of “L“ side candidates that meet the following three criteria: i) Verify that t
23、he closest points on each line are separated by less than 1,5gmax. ii) Verify that they are perpendicular within 5 degrees. iii) Verify that the same saved colour is on the inside of the “L“ formed by the two lines. Note that if one or both lines extend past their intersection, then the two or four
24、“L“ patterns formed will need to be tested for matching colour and maintaining a minimum length of dmin for the truncated side or sides before they can become “L“ candidates. 8) For each candidate “L“ pair found in step 7) form an “L“ candidate by extending the segments to their intersection point.
25、9) If the “L“ candidate was formed from line segments with the colour white on the inside of the “L“, form a colour inverted image to decode. Attempt to decode the symbol starting with the appropriate normal or inverted image starting from step d) below using each of the “L“ candidates from step 8)
26、as the “L“ shaped finder. If none decode, proceed to step c). c) Maintain the line A1 line segments and “L“ side candidates from the previous steps. Continue searching for “L“ candidates using horizontal and vertical scan lines offset from previous scan lines: 1) Using a new horizontal scan line 3mm
27、in above the centre horizontal scan line, repeat the process in step b)1), except starting from the offset from the centre point, and then b)3) through b)9). If there is no decode, proceed to the next step. 2) Using a new vertical scan line 3mmin left of the centre vertical scan line, repeat the pro
28、cess in step b)2), except starting from the offset from the centre point, and then steps b)3) through b)9). If there is no decode, proceed to the next step. ISO/IEC 16022:2006/Cor.2:2011(E) 4 ISO/IEC 2011 All rights reserved3) Repeat step 1) above except using a new horizontal scan line 3mmin below
29、the centre horizontal scan line. If there is no decode, repeat step 2) above except using a new vertical scan line 3mmin right of the centre vertical scan line. If there is no decode, proceed to step 4) below. 4) Continue processing horizontal and vertical scan lines as in steps 1) through 3) that a
30、re 3mmin above, then left, then below, then right of the previously processed scan lines until either a symbol is decoded or the boundary of the image is reached. d) First assume that the candidate area contains a square symbol. If the area fails to decode as a square symbol, then try to find and de
31、code a rectangular symbol starting from procedure j). For a square symbol, first plot a normalised graph of transitions for the equal sides of the candidate area in order to find the alternating module finder pattern: 1) Project a line through the candidate area bisecting the interior angle of the t
32、wo sides of the “L“ found above as shown in figure 9. Define the two equal areas formed by the bisecting line as the right side and the left side as viewed from the corner of the “L“. 2) For each side, form a line called a “search line” between a point dmin distance from the corner along the “L” lin
33、e, parallel to the other “L” side line, and extending to the bisecting line as shown in Figure 9. 3) Move each search line away from the corner of the “L” as shown in Figure 9, lengthening each line as it expands to span its two bounding lines, the “L” line and the bisecting line. Keep each search l
34、ine parallel to the other “L” side line. As each side is moved by the size of an image pixel, count the number of black/white and white/black transitions, beginning and ending the count with transitions from the colour of the “L” side to the opposite colour. A transition from one colour to the other
35、 is to be counted only when the current search line as well as the search lines immediately above and below have the same colour, opposite to the previously counted transition colour. Plot the number of transitions multiplied by the length of the longest “L” side divided by the current length of the
36、 search line measured between the two bounding lines: T = (number of transitions) (“L” max. line length) / (search line length). This formula normalises T to keep it from increasing because the line lengthens. Continue to calculate the T values until the search line is longer than the longest axis o
37、f the candidate area plus 50%. Figure 9 Expanding search lines ISO/IEC 16022:2006/Cor.2:2011(E) ISO/IEC 2011 All rights reserved 54) Form a plot of the T values for each side, where the Y-axis is the T value and the X-axis is the search lines distance from the corner of the “L”. A sample plot is sho
38、wn in Figure 10. Figure 10 Example plot of T as the search line expands 5) Starting from the T value with the smallest X in the right sides plot and then increasing X, find the first instance of a T S value (T S = maximum of zero and T - 1) that is less than 15% of the preceding local maximum T valu
39、e, provided that T value is greater than 1. Increment this X value until the number of transitions stops decreasing. If the number of transitions does not increase, increment the X value once more. Refer to this X value as the valley. Increment the local maximums X value until the number of transiti
40、ons decreases and refer to this X as the peak. Refer to the average of the peak and valley X values as the descending line X value. The search line at the peak may correspond to an alternating finder pattern side. At the valley, the search line may correspond to the solid dark interior line or a lig
41、ht quiet zone. 6) Find the peak and valley in the left sides plot whose descending line X value most closely matches the right peak and valleys descending line X value. If returning to this step from a later step, consider additional left peaks and valleys, ordered in terms of how closely they match
42、 the right peak and valley. However, any left peak and valley under consideration must be checked to ensure that the absolute difference between the right and left peak X values is less than 15% of the average of the two peak X values and that the absolute difference between the right and left valle
43、y X values is less than 15% of the average of the two valley X values. The 15% specifies the maximum allowed foreshortening. 7) The right sides valley search line, the left sides valley search line, and the two sides of the “L” outline a possible symbols data region. Process the data region accordin
44、g to step e). If the decode fails, find the next left peak and valley from step d)6). Once all left peaks and valleys have been discarded, discard the right side peak and valley and continue searching from step d)5) for the next right peak and valley. e) For each of the two sides of the alternating
45、pattern, find the line passing through the centre of the alternating light and dark modules: 1) For each side, form a rectangular region bounded by the sides peak and valley search lines as the longer two sides of the rectangle, and the “L” side and the other sides valley search line as the shorter
46、two sides, as shown in Figure 11. ISO/IEC 16022:2006/Cor.2:2011(E) 6 ISO/IEC 2011 All rights reservedFigure 11 Rectangular region construction 2) Within the rectangular region, find pixel edge pairs on the outside boundary of teeth: i) Traverse test lines starting with and parallel to the valley lin
47、e looking for transitions to the opposite colour normally orthogonal to the test line. Select only transitions that are either dark to light or light to dark where the first colour matches the predominate colour of the image along the valley line. ii) If the number of transitions found is less than
48、15% of the number of pixels comprising the valley line, and the test line is not the peak line, move the test line toward the peak line by nominally one pixel and repeat step i), now considering new transitions in addition to those already found. If the 15% criterion is met or the peak line is reach
49、ed, continue to the next step, otherwise continue searching from step d)6) for the next left peak and valley. iii) Calculate a preliminary “best fit line“ with linear regression using the points on the edge between the selected pixel pairs. iv) Discard the 25% of the points which are furthest from the preliminary “best fit line“. Calculate a final “best fit line“ with linear regression using the remaining 75%