Apparatus and method for decoding damaged optical codes
First Claim
1. A method of decoding a code contained in an image, comprising:
- identifying an area within said image that contains a code;
tracing a contour of said code;
locating at least a portion of a finder pattern within the code;
scanning at least one region of the code to detect a known characteristic of the code;
labeling at least a portion of said at least one region as an erasure region based on whether said known characteristic is detected; and
decoding the code.
7 Assignments
0 Petitions
Accused Products
Abstract
An improved optical code reading system and method that enhances the ability of a reader to locate a symbol within a field of view and enhances the error-correcting properties of the encoding scheme commonly used in 2D bar codes. The reader offsets the effects of damaged finder patterns and missing symbol perimeters and, thereafter, detects high-level symbol information such as the code type, symbol size, and the number of rows and columns in the symbol. The reader then identifies those missing portions of a damaged symbol and marks each missing data bit location with a predetermined indicator. A decoding algorithm then interprets the missing bit indicator as an error of known location (e.g., an “erasure”), thereby nearly doubling the error correcting strength of all bar codes employing the Reed-Solomon error correction scheme.
-
Citations
22 Claims
-
1. A method of decoding a code contained in an image, comprising:
-
identifying an area within said image that contains a code;
tracing a contour of said code;
locating at least a portion of a finder pattern within the code;
scanning at least one region of the code to detect a known characteristic of the code;
labeling at least a portion of said at least one region as an erasure region based on whether said known characteristic is detected; and
decoding the code. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
measuring a width and height of said Data Matrix code based on said contour of the code;
scanning a horizontal edge and a vertical edge of said Data Matrix code to calculate an average element width and height, respectively;
calculating the number of rows and columns in the code by dividing the measured width and height by the average element width and height, respectively; and
identifying defective elements within said “
L”
-shaped finder pattern based on expected dimensions of the finder pattern based on the calculated number of rows and columns in the code.
-
-
5. The method of claim 1 wherein said code type is a Data Matrix code type and said step of scanning at least one region of the code comprises:
-
scanning a horizontal edge of the code to detect alternating light and dark elements located along the horizontal edge;
measuring a width for each of a plurality of light and dark elements along the horizontal edge;
calculating an average element width based on at least a subset of the measured widths of said elements along the horizontal edge;
scanning a vertical edge of the code to detect alternating light and dark elements located along the vertical edge;
measuring a height for each of a plurality of light and dark elements along the vertical edge;
calculating an average element height based on at least a subset of the measured heights of said elements along the vertical edge;
calculating a number of rows in said code by dividing said measured height of the code by said average element height; and
calculating a number of columns in said Data Matrix code by dividing said measured width of the code by said average element width.
-
-
6. The method of claim 5 wherein said characteristic comprises a number of alternating light and dark elements along the horizontal and vertical edges equal to said calculated number of columns and rows, respectively, and wherein said step of labeling said at least one region comprises labeling detected defective elements along said horizontal and vertical edges as erasures.
-
7. The method of claim 1 wherein said code comprises a MaxiCode symbol and said step of locating a finder pattern comprises scanning from a center region of the symbol outwardly toward an edge until at least a portion of a circular finder pattern is located.
-
8. The method of claim 7 wherein said step of scanning comprises scanning at least one portion of the code to detect a substantially uniformly black area and said step of labeling comprises labeling the substantially uniformly black area as an erasure region if it is detected.
-
9. The method of claim 7 wherein said step of scanning comprises:
-
applying a scan line through the middle of said code to measure a minimum element width;
calculating a number of rows and columns in said code based on the minimum element width;
comparing the calculated number of rows and columns to an expected number of rows and columns; and
if said calculated number of rows and columns does not match said expected number of rows and columns, scanning said code to identifying defective elements.
-
-
10. The method of claim 1 wherein said code is a PDF417 code and wherein said step of locating at least a portion of a finder pattern comprises:
-
scanning at least a portion of the code to detect a start bar sequence;
determining a minimum element width based on the start bar sequence; and
determining a width of a row segment based on the minimum element width.
-
-
11. The method of claim 1 wherein:
-
said step of scanning comprises;
applying a plurality of parallel scan lines across said code to detect a number of rows within the code;
measuring a height for a first segment of each detected row; and
said step of labeling comprises labeling as an erasure region any row segments having a measured height not within a predetermined height range.
-
-
12. A method of decoding a code contained in an image, comprising:
-
identifying an area within said image that contains a code;
tracing a contour of said code;
locating at least one portion of a finder pattern within the code;
determining a code type for said code based on said at least one portion of said finder pattern;
scanning at least one region of the code to detect a known characteristic of the code type;
labeling at least a portion of said at least one region as an erasure region based on whether said known characteristic is detected; and
decoding the code. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
measuring a width and height of said Data Matrix code based on said contour of the code;
scanning a horizontal edge and a vertical edge of said Data Matrix code to calculate an average element width and height, respectively;
calculating the number of rows and columns in the code by dividing the measured width and height by the average element width and height, respectively; and
identifying defective elements within said “
L”
-shaped finder pattern based on expected dimensions of the finder pattern determined from the calculated number of rows and columns in the code.
-
-
16. The method of claim 12 wherein if said code type is determined to be a DataMatrix code, said step of scanning at least one region of the code comprises:
-
scanning a horizontal edge of the code to detect alternating light and dark elements located along the horizontal edge;
measuring a width for each of a plurality of light and dark elements along the horizontal edge;
calculating an average element width based on at least a subset of the measured widths of said elements along the horizontal edge;
scanning a vertical edge of the code to detect alternating light and dark elements located along the vertical edge;
measuring a height for each of a plurality of light and dark elements along the vertical edge;
calculating an average element height based on at least a subset of the measured heights of said elements along the vertical edge;
calculating a number of rows in said code by dividing said measured height of the code by said average element height; and
calculating a number of columns in said Data Matrix code by dividing said measured width of the code by said average element width.
-
-
17. The method of claim 16 wherein said characteristic comprises a number of alternating light and dark elements along the horizontal and vertical edges equal to said calculated number of columns and rows, respectively, and wherein said step of labeling said at least one region comprises labeling detected defective elements along said horizontal and vertical edges as erasures.
-
18. The method of claim 12 wherein if said code type is determined to be a MaxiCode symbol, said step of locating a finder pattern comprises scanning from a center region of the symbol outwardly toward an edge until at least a portion of a circular finder pattern is located.
-
19. The method of claim 18 wherein said step of scanning comprises scanning at least one portion of the code to detect a substantially uniformly black area and said step of labeling comprises labeling the substantially uniformly black area as an erasure region if it is detected.
-
20. The method of claim 19 wherein said step of scanning comprises:
-
applying a scan line through the middle of the said code to measure a minimum element width;
calculating a number of rows and columns in said code based on the minimum element width;
comparing the calculated number of rows and columns to an expected number of rows and columns; and
if said calculated number of rows and columns does not match said expected number of rows and columns, scanning said code to identifying defective elements.
-
-
21. The method of claim 12 wherein if said code type is determined to be a PDF417 code, said step of locating at least a portion of a finder pattern comprises:
-
scanning at least a portion of the code to detect a start bar sequence;
determining a minimum element width based on the start bar sequence; and
determining a width of a row segment based on the minimum element width.
-
-
22. The method of claim 21 wherein:
-
said step of scanning comprises;
applying a plurality of parallel scan lines across said code to detect a number of rows within the code;
measuring a height for a first segment of each detected row; and
said step of labeling comprises labeling as an erasure region any row segments having a measured height not within a predetermined height range.
-
Specification