ISO/IEC 16022:2006/Cor 2:2011
(Corrigendum)Information technology — Automatic identification and data capture techniques — Data Matrix bar code symbology specification — Technical Corrigendum 2
Information technology — Automatic identification and data capture techniques — Data Matrix bar code symbology specification — Technical Corrigendum 2
Technologies de l'information — Techniques automatiques d'identification et de capture des données — Spécification de symbologie de code à barres Data Matrix — Rectificatif technique 2
General Information
Relations
Standards Content (Sample)
INTERNATIONAL STANDARD ISO/IEC 16022:2006
TECHNICAL CORRIGENDUM 2
Published 2011-02-01
INTERNATIONAL ORGANIZATION FOR STANDARDIZATION • МЕЖДУНАРОДНАЯ ОРГАНИЗАЦИЯ ПО СТАНДАРТИЗАЦИИ • ORGANISATION INTERNATIONALE DE NORMALISATION
INTERNATIONAL ELECTROTECHNICAL COMMISSION • МЕЖДУНАРОДНАЯ ЭЛЕКТРОТЕХНИЧЕСКАЯ КОМИССИЯ • COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE
Information technology — Automatic identification and data
capture techniques — Data Matrix bar code symbology
specification
TECHNICAL CORRIGENDUM 2
Technologies de l'information — Techniques automatiques d'identification et de capture des données —
Spécification 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 techniques.
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 diameter defined by the application. This will be
the minimum length of the "L" pattern's side.
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
ISO/IEC 16022:2006/Cor.2:2011(E)
2) 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 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 symbol’s X dimension.
4) Form a black/white image using a threshold determined according to the method defined in ISO/IEC
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 resolved 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) Follow 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 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 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) Continue 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 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. 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 not 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 from 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 reached.
2 © ISO/IEC 2011 – All rights reserved
ISO/IEC 16022:2006/Cor.2:2011(E)
2) 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 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 . If the two lines have opposite p1 to p2 directions, verify that the closer
max
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 directions 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.
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 from 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 the 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 "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.
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) 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 3mmin 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 process 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 2011 – All rights reserved 3
ISO/IEC 16022:2006/Cor.2:2011(E)
3) Repeat step 1) above except using a new horizontal scan line 3mmin below 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 are 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 decode 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 two 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” line, 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 line
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 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 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 of the candidate
area plus 50%.
Figure 9 — Expanding search lines
4 © ISO/IEC 2011 – All rights reserved
ISO/IEC 16022:2006/Cor.2:2011(E)
4) 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
line’s distance from the corner of the “L”. A sample plot is shown 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 side’s plot and then increasing X, find the first
instance of a T value (T = maximum of zero and T - 1) that is less than 15% of the preceding local
S S
maximum T value, 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 maximum’s X value until the
number of transitions 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 light quiet zone.
6) Find the peak and valley in the left side’s plot whose descending line X value most closely matches
the right peak and valley’s 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 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 valley 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 side’s valley search line, the left side’s valley search line, and the two sides of the “L” outline
a possible symbol’s data region. Process the data region according 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 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 side’s peak and valley search lines as the
longer two sides of the rectangle, and the “L” side and the other side’s valley search line as the
shorter two sides, as shown in Figure 11.
© ISO/IEC 2011 – All rights reserved 5
ISO/IEC 16022:2006/Cor.2:2011(E)
Figure 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 line 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 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
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.