Code reader and method of reading an optical code
20230196808 · 2023-06-22
Inventors
Cpc classification
G06V10/60
PHYSICS
G06V10/22
PHYSICS
International classification
G06V10/22
PHYSICS
Abstract
A method of reading an optical code is provided in which a brightness profile of the code is recorded, light and dark part regions are identified in the brightness profile, and the code content of the optical code is read, First sum measurements for the light quantity in the respective light part regions and second sum measurements for the light quantity lacking for a white level in the respective dark part regions are determined from the brightness profile and the code content is read based on the first and second sum measurements.
Claims
1. A method of reading an optical code in which a brightness profile of the code is recorded, light and dark part regions are identified in the brightness profile, and the code content of the optical code is read, wherein first sum measurements for the light quantity in the respective light part regions and second sum measurements for the light quantity lacking for a white level in the respective dark part regions are determined from the brightness profile and the code content is read based on the first and second sum measurements.
2. The method in accordance with claim 1, wherein the respective brightness profile is summed between two of its minima for the first sum measurements.
3. The method in accordance with claim 1, wherein the respective brightness profile is summed between two of its maxima for the second sum measurements.
4. The method in accordance with claim 1, wherein the brightness profile is inverted and is compensated by an offset corresponding to the white level to determine the second sum measurement.
5. The method in accordance with claim 1, wherein the first sum measurements and/or the second sum measurements are determined by integration.
6. The method in accordance with claim 1, wherein the code content is determined from an alternating sequence of the first sum measurements and the second sum measurements.
7. The method in accordance with claim 1, wherein the first sum measurements and the second sum measurements are classified.
8. The method in accordance with claim 7, wherein the first sum measurements and the second sum measurements are classified with reference to a reference value estimated from at least one finest sum measurement.
9. The method in accordance with claim 1, wherein the first sum measurements and the second sum measurements are divided by a reference value and then discretized.
10. The method in accordance with claim 9, wherein the reference value is estimated from at least one finest sum measurement.
11. The method in accordance with claim 1, wherein the optical code is a 2D code.
12. The method in accordance with claim 11, wherein the first sum measurements and the second measurements are determined in an environment of minima or maxima up to a brightness boundary determined by a threshold value.
13. The method in accordance with claim 1, wherein the brightness profile is divided into subsections in which respective first sum measurements and second sum measurements are determined.
14. The method in accordance with claim 13, wherein the subsections comprise rectangular subsections, rows, or columns.
15. The method in accordance with claim 13, wherein the brightness profile is divided multiple times into different subsections to determine first and second sum measurements multiple times; and wherein the results are offset or compared with one another.
16. The method in accordance with claim 15, wherein the results are offset or compared with one another by a logical link.
17. A code reader for reading optical codes that has a light receiver for detecting a brightness profile of the optical code and a control and evaluation unit that is configured to identify light part regions and dark part regions in the brightness profile and to read the code content of the optical code, wherein the control and evaluation unit is further configured to determine first sum measurements for the light quantity in the respective light part regions in the respective light part regions and second sum measurements for the light quantity lacking for a white level in the respective dark part regions from the brightness profile and to read the code content based on the first and second sum measurements.
Description
[0026] The invention will be explained in more detail in the following also with respect to further features and advantages by way of example with reference to embodiments and to the enclosed drawing. The Figures of the drawing show in:
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042] The code reader 10 detects the conveyed objects 14 and their optical codes using a light receiver 24 and the corresponding brightness profiles or gray scale value profiles are further processed in a control and evaluation unit 26 to read the code content. It is not the specific detection process that is important for the invention so that the code reader 10 can be set up in accordance with any principle known per se. For example, only one row is detected in each case, whether by means of a linear image sensor or in a scanning process, with a simple light receiver such as photodiode being sufficient in the latter case. A direct attempt can be made to read the code 20 from a linear detection or the control and evaluation unit 26 assembles the rows detected in the course of the conveying movement. A larger region can already be detected in a recording using a matrix-like image sensor, with the assembly of recordings here also being possible both in the conveying direction and transversely thereto.
[0043] The code reader 10 can output information such as read codes or image data via an interface 28. It is also conceivable that the control and evaluation unit 26 is not arranged in the actual code reader 10, that is the camera shown in
[0044]
[0045]
[0046] For better clarity,
[0047] The washed out detection of the barcode could be compensated at least in part by methods known from image processing, for instance by algorithmic resharpening or an image processing filter. This is conceivable in accordance with the invention as a pre-processing step. The resharpening or filtering could, however, on the one hand, change transitions in a manner that would ultimately lead to an incorrect reading. On the other hand, artifacts would also remain after such a pre-processing as a rule.
[0048]
[0049] It may now further be assumed that the artifacts remain local at least to the extent that light of a light part region only illuminates the adjacent part regions, but not more remote part regions. However, then the integral over the brightness profile in the region from a dark part region to the next dark part region that comprises exactly to one light part region has to correspond exactly to the light quantity remitted by the light part region. The trick here is that this is a summary observation and the integral of specific brightness extents such as flatter or steeper flanks or of other irregularities is only influenced a little.
[0050] Corresponding first sum measurements for the light part regions are entered at the bottom in
[0051] The same idea can be transferred to the dark part regions in that the inverted brightness profile is looked at. Inversion can be understood as a mirroring at the X axis or by calculation as a multiplication by −1. To avoid the negative values that thereby arise, the maximum level can subsequently be added everywhere to the inverted brightness profile, that is, for example, the value 255 with an 8 bit encoding of the brightness values. The integration limits are in turn the minima in the inverted brightness profile and accordingly the maxima in the non-inverted brightness profile. Corresponding sum measurements for the dark part regions are entered at the top in
[0052] The assumption that light remitted from a light part region only influences the directly adjacent dark part regions can also be relaxed. A matching light portion can then also be assigned to every light part region and the principle can still be used analogously, correspondingly for the dark part regions. The integral boundaries do not therefore necessarily have to be fixed to directly adjacent minima or maxima.
[0053] The result of the described evaluation is a plurality of first sum measurements and second sum measurements, in each case a first sum measurement per light part region and a second sum measurement per dark part region of the barcode. These sum measurements can now be alternatingly combined to form a sequence. With a homogeneous illumination of the barcode, the sum measurements for each part region having an extent corresponding to a specific multiple proportional to the module size It must be remembered here that the module size describes the extent of the smallest bar of the barcode and the extent of all the bars amounts to a respective multiple of the module size is the same. Decoding can be understood as a classification that seeks these multiples since the code information is actually located therein. Instead of measuring the width of the bars as customary, in accordance with the invention the sum measurements or integrals are used that likewise include the information required for a decoding in accordance with the above statements.
[0054] In the example of
[0055] Any desired classifiers can be used to classify the example sequence. There are recognizably large differences between the sum measurement of bars of different widths so that the classification work becomes a lot easier and more robust to solve than, for example, with widths that are subject to great fluctuation due to washed out edges. The smallest sum measurement could, for example, be selected as the reference value or the i smallest sum measurements are averaged. i here should be small enough to not dilute the average value by an integral from a wider bar.
[0056] The sequence 2, 1, 3, 1, 1, 1, 3, 3, 2, 2, 1, 1, 3, 2, 1, 1, 2 results from the above exemplary sequence using such a classification that can also be understood as a standardization or discretization. This is the decoding result in accordance with the invention that is actually correct for the section of the barcode shown in
[0057]
[0058]
[0059] There is also a module size as a smallest extent of a code element in a 2D code, but it now applies in two dimensions and thus defines a least square. A determination can be made via the sum measurements as to how many of these least squares form a light part region or a dark part region respectively. In contrast to a one-dimensional case, this is, however, alone not sufficient for decoding since the arrangement in, for example, a long row, a compact block, or any intermediate shape is not unambiguous without additional spatial information. The summary information on the number of smallest squares per part region can be decisive as an additional information source of whether a code is still read, for example to parameterize or plausibilize a different decoding process.
[0060] To enrich the summary information and provide a greater spatial reference, 2D brightness profiles can be subdivided and an embodiment of the method in accordance with the invention is respectively applied to the subregions of the subdivisions. The divisor results are then subsequently assembled. Examples for such subdivisions are rectangles with n×m pixels, in particular selected in dependence on an estimated module size, and rows, columns, or slanted lines. Especially the subdivision into rows or columns has the advantage that the method described for barcodes can be directly applied thereto. It is conceivable to apply the method in accordance with the invention multiple times with different subdivisions and to link the results.
[0061]
[0062] In
[0063]