Label capture using optical pattern recognition and barcode semantics
One or more images of a real scene are analyzed to identify a plurality of text fields and one or more barcodes. A plurality of edges are defined, wherein each edge of the plurality of edges links a text field of the plurality of text fields with a barcode of the one or more barcodes. The plurality of edges are used to match a text field with a barcode to classify the barcode.
1 . A system for image analysis of optical patterns in a real scene, the system comprising:
a camera; and
one or more computer-readable media comprising instructions that, when executed by one or more processors, perform the following steps:
receiving one or more images of a scene acquired by the camera;
performing image processing on an image of the one or more images to computationally identify boundaries for a plurality of text fields within the
image and for one or more barcodes within the image;
constructing a data graph that represents spatial relationships between the plurality of text fields and the one or more barcodes, wherein the data graph comprises a plurality of edges, wherein each edge of the plurality of edges links a text field node associated with a text field of the plurality of text fields with a barcode node associated with a barcode of the one or more barcodes, and wherein the data graph is constructed based on the boundaries; and
analyzing the data graph to identify a correct match between a text field of the plurality of text fields and a corresponding barcode of the one or more barcodes, and in response to identifying the correct match, automatically decoding the corresponding barcode to extract its data.
2 . The system of claim 1 , wherein analyzing the data graph comprises analyzing the plurality of edges.
3 . The system of claim 2 , wherein the correct match is identified without decoding any text field of the plurality of text fields or any barcode of the one or more barcodes.
4 . The system of claim 1 , wherein analyzing the data graph comprises ascertaining that an edge of the plurality of edges fails to define a one-to-one match between a text field of the plurality of text fields and a barcode of the one or more barcodes.
5 . A method for image analysis of optical patterns in a real scene, the method comprising:
receiving one or more images of a scene acquired by a camera;
performing image processing on an image of the one or more images to computationally identify boundaries for a plurality of text fields within the
image and for one or more barcodes within the image; and
constructing a data graph that represents spatial relationships between the plurality of text fields and the one or more barcodes, wherein the data graph comprises a plurality of edges, wherein each edge of the plurality of edges links a text field node associated with a text field of the plurality of text fields with a barcode node associated with a barcode of the one or more barcodes, and wherein the data graph is constructed based on the boundaries; and
analyzing the data graph to identify a correct match between a text field of the plurality of text fields and a corresponding barcode of the one or more barcodes, and in response to identifying the correct match, automatically decoding the corresponding barcode to extract its data.
6 . The method of claim 5 , wherein analyzing the data graph comprises analyzing the plurality of edges.
7 . The method of claim 6 , wherein the correct match is identified without decoding any text field of the plurality of text fields or any barcode of the one or more barcodes.
8 . The method of claim 5 , wherein analyzing the data graph comprises ascertaining that an edge of the plurality of edges defines a one-to-one match between a text field of the plurality of text fields and a barcode of the one or more barcodes.
9 . The method of claim 5 , wherein analyzing the data graph comprises ascertaining that an edge of the plurality of edges fails to define a one-to-one match between a text field of the plurality of text fields and a barcode of the one or more barcodes.
10 . The method of claim 9 , further comprising:
comparing nodes of the plurality of edges to a predefined threshold, based on ascertaining that an edge of the plurality of edges fails to define the one-to-one match between the text field of the plurality of text fields and a barcode of the one or more barcodes; and
deleting edges that fail to meet the predefined threshold.
11 . The method of claim 9 , further comprising:
decoding one or more of the plurality of text fields, based on the ascertaining that the edge of the plurality of edges fails to define the one-to-one match between the text field of the plurality of text fields and a barcode of the one or more barcodes;
decoding the one or more barcodes to develop one or more character strings, based on the ascertaining that the edge of the plurality of edges fails to define the one-to-one match between the text field of the plurality of text fields and a barcode of the one or more barcodes; and
matching a barcode of the one or more barcodes to a text field of the one or more of the plurality of text fields based on text and/or format of a character string of the barcode matching a text and/or expected format of the text field.
12 . The method of claim 9 , further comprising mapping one barcode to multiple text fields.
13 . A non-transitory computer-readable storage medium comprising instructions that, when executed by one or more processors, perform the following steps for image analysis of optical patterns in a real scene:
receiving one or more images of a scene acquired by a camera;
performing image processing on an image of the one or more images to computationally identify boundaries for a plurality of text fields within the
image and for one or more barcodes within the image;
constructing a data graph that represents spatial relationships between the plurality of text fields and the one or more barcodes, wherein the data graph comprises a plurality of edges, wherein each edge of the plurality of edges links a text field node associated with a text field of the plurality of text fields with a barcode node associated with a barcode of the one or more barcodes, and wherein the data graph is constructed based on the boundaries; and
analyzing the data graph to identify a correct match between a text field of the plurality of text fields and a corresponding barcode of the one or more barcodes, and in response to identifying the correct match, automatically decoding the corresponding barcode to extract its data.
14 . The non-transitory computer-readable storage medium of claim 13 , wherein analyzing the data graph comprises analyzing the plurality of edges.
15 . The non-transitory computer-readable storage medium of claim 14 , wherein the correct match is identified without decoding any text field of the plurality of text fields or any barcode of the one or more barcodes.
16 . The non-transitory computer-readable storage medium of claim 13 , wherein analyzing the data graph comprises ascertaining that an edge of the plurality of edges defines a one-to-one match between a text field of the plurality of text fields and a barcode of the one or more barcodes.
17 . The non-transitory computer-readable storage medium of claim 13 , wherein analyzing the data graph comprises ascertaining that an edge of the plurality of edges fails to define a one-to-one match between a text field of the plurality of text fields and a barcode of the one or more barcodes.
18 . The non-transitory computer-readable storage medium of claim 17 , wherein the instructions, when executed by the one or more processors, further perform the following steps:
comparing nodes of the plurality of edges to a predefined threshold, based on ascertaining that an edge of the plurality of edges fails to define the one-to-one match between the text field of the plurality of text fields and a barcode of the one or more barcodes; and
deleting edges that fail to meet the predefined threshold.
19 . The non-transitory computer-readable storage medium of claim 17 , wherein the instructions, when executed by the one or more processors, further perform the following steps:
decoding one or more of the plurality of text fields, based on the ascertaining that the edge of the plurality of edges fails to define the one-to-one match between the text field of the plurality of text fields and a barcode of the one or more barcodes;
decoding the one or more barcodes to develop one or more character strings, based on the ascertaining that the edge of the plurality of edges fails to define the one-to-one match between the text field of the plurality of text fields and a barcode of the one or more barcodes; and
matching a barcode of the one or more barcodes to a text field of the one or more of the plurality of text fields based on text and/or format of a character string of the barcode matching a text and/or expected format of the text field.
20 . The non-transitory computer-readable storage medium of claim 17 , wherein the instructions, when executed by the one or more processors, further perform the following step of mapping one barcode to multiple text fields.