Bar code information recognition method, device, equipment and storage medium

By combining the methods of text recognition and graphic analysis to process the image of barcode information, the problem of poor recognition effect of incomplete or fuzzy barcode information in the existing technology is solved, and more accurate barcode information recognition is achieved.

CN114004245BActive Publication Date: 2025-10-24BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111241245.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-10-24
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

The existing technology has poor recognition effect when recognizing incomplete or ambiguous barcode information and cannot meet actual application needs.

Method used

By combining text recognition and graphic analysis methods, the image of the barcode information is obtained, and the pre-trained text recognition model and barcode detection model are used for image processing, including redundant text filtering, image enhancement and result comparison, to comprehensively determine the recognition result of the barcode information.

Benefits of technology

It achieves accurate recognition of incomplete or fuzzy barcode information, improves recognition effect, and meets practical application needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114004245B_ABST
    Figure CN114004245B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a barcode information recognition method, device, equipment and storage medium, the method comprising: acquiring an image containing barcode information; recognizing the text in the image to obtain a text recognition result corresponding to the barcode information; analyzing the barcode in the image to obtain a graphic analysis result corresponding to the barcode information; and determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result. The present disclosure can accurately recognize barcode information, improve the recognition effect for incomplete or blurred barcode information, and thus meet the actual application requirements of barcode information recognition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer vision, and particularly relates to a barcode information recognition method and device, equipment and a storage medium. BACKGROUND

[0002] Computer vision technology has a wide range of applications, mainly for image analysis and content understanding, including basic technologies such as target recognition, detection, positioning, segmentation, etc. With the development of deep learning technology, it has played an important role in various scenes in production and life.

[0003] In the related art, the recognition result of barcode information can be determined by scanning the image sequence of the barcode information of the relevant article. This technology is widely used in scenarios such as commodity shopping, and how to improve the accuracy of barcode recognition has become a problem to be solved. SUMMARY

[0004] To overcome the problems in the related art, the embodiments of the present disclosure provide a barcode information recognition method, device, equipment and storage medium to solve the defects in the related art.

[0005] According to a first aspect of the embodiments of the present disclosure, a barcode information recognition method is provided, the method comprising:

[0006] obtaining an image containing barcode information;

[0007] recognizing the text in the image to obtain a text recognition result corresponding to the barcode information;

[0008] parsing the barcode in the image to obtain a graphic parsing result corresponding to the barcode information;

[0009] determining a recognition result of the barcode information based on the text recognition result and the graphic parsing result.

[0010] In some embodiments, the text recognition result includes a character string sequence corresponding to the barcode information.

[0011] The recognizing the text in the image to obtain a text recognition result corresponding to the barcode information comprises:

[0012] inputting the image into a pre-trained text recognition model to obtain a preliminary recognition result;

[0013] filtering out redundant text in the preliminary recognition result based on a pre-set redundant text filtering rule to obtain a character string sequence corresponding to the barcode information.

[0014] In some embodiments, the parsing of the barcode in the image to obtain the graphical parsing result corresponding to the barcode information comprises:

[0015] inputting the image into a pre-trained barcode detection model to obtain the barcode contained in the image and a corresponding position of the barcode;

[0016] cropping a sub-image of the barcode at the corresponding position from the image;

[0017] performing image enhancement processing on the sub-image, the image enhancement processing including adjustment of contrast and / or chroma;

[0018] parsing the sub-image after the image enhancement processing to obtain the graphical parsing result corresponding to the barcode information.

[0019] In some embodiments, the determining of the recognition result of the barcode information based on the text recognition result and the graphical parsing result comprises:

[0020] in response to determining that both the text recognition result and the graphical parsing result are valid, comparing the text recognition result and the graphical parsing result;

[0021] in response to the text recognition result and the graphical parsing result being consistent, determining either of the text recognition result and the graphical parsing result as the recognition result of the barcode information.

[0022] In some embodiments, the determining of the recognition result of the barcode information based on the text recognition result and the graphical parsing result comprises:

[0023] in response to determining that both the text recognition result and the graphical parsing result are valid, comparing the text recognition result and the graphical parsing result;

[0024] in response to the text recognition result and the graphical parsing result being inconsistent, determining the graphical parsing result as the recognition result of the barcode information.

[0025] In some embodiments, the determining of the recognition result of the barcode information based on the text recognition result and the graphical parsing result comprises:

[0026] in response to determining that only one of the text recognition result and the graphical parsing result is valid, determining the valid result as the recognition result of the barcode information.

[0027] In some embodiments, the determining of the recognition result of the barcode information based on the text recognition result and the graphical parsing result comprises:

[0028] In response to determining that both the text recognition result and the graphic analysis result are invalid, a prompt message is outputted to indicate that the barcode information is not recognized.

[0029] According to a second aspect of an embodiment of the present disclosure, a barcode information recognition device is provided, the device comprising:

[0030] An image acquisition module, used for acquiring an image containing barcode information;

[0031] A text recognition module, configured to recognize text in the image and obtain a text recognition result corresponding to the barcode information;

[0032] A graphic analysis module, configured to analyze the barcode in the image and obtain a graphic analysis result corresponding to the barcode information;

[0033] The information recognition module is used to determine the recognition result of the barcode information based on the text recognition result and the graphic analysis result.

[0034] In some embodiments, the text recognition result includes a character string sequence corresponding to the barcode information; the text recognition module is further configured to:

[0035] Inputting the image into a pre-trained text recognition model to obtain a preliminary recognition result;

[0036] Based on a preset redundant text filtering rule, redundant text in the preliminary recognition result is filtered out to obtain a character string sequence corresponding to the barcode information.

[0037] In some embodiments, the graphic parsing module is further configured to:

[0038] Inputting the image into a pre-trained barcode detection model to obtain the barcode contained in the image and the corresponding position of the barcode;

[0039] Cutting out a sub-image of the barcode at the corresponding position from the image;

[0040] Performing image enhancement processing on the sub-image, wherein the image enhancement processing includes adjusting contrast and / or chroma;

[0041] The sub-image that has undergone image enhancement processing is analyzed to obtain a graphic analysis result corresponding to the barcode information.

[0042] In some embodiments, the information identification module includes:

[0043] a result comparison unit for, in response to determining that both the character recognition result and the graphic analysis result are valid, comparing the character recognition result with the graphic analysis result;

[0044] The first determination unit is configured to determine, as the recognition result of the barcode information, any one of the text recognition result and the graphic analysis result in response to the text recognition result being consistent with the graphic analysis result.

[0045] In some embodiments, the information recognition module comprises:

[0046] The result comparison unit is configured to compare the text recognition result and the graphic analysis result in response to determining that both the text recognition result and the graphic analysis result are valid.

[0047] The second determination unit is configured to determine, as the recognition result of the barcode information, the graphic analysis result in response to the text recognition result being inconsistent with the graphic analysis result.

[0048] In some embodiments, the information recognition module comprises:

[0049] The third determination unit is configured to determine, as the recognition result of the barcode information, the valid result in response to determining that only one of the text recognition result and the graphic analysis result is valid.

[0050] In some embodiments, the information recognition module further comprises:

[0051] The prompt output unit is configured to output prompt information for prompting that the barcode information is not recognized in response to determining that both the text recognition result and the graphic analysis result are invalid.

[0052] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, and the device comprises:

[0053] a processor and a memory for storing a computer program;

[0054] The processor is configured to implement the following when executing the computer program:

[0055] obtaining an image containing barcode information;

[0056] recognizing text in the image to obtain a text recognition result corresponding to the barcode information;

[0057] analyzing a barcode in the image to obtain a graphic analysis result corresponding to the barcode information;

[0058] determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result.

[0059] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a computer program. The program is executed by a processor to implement the following steps:

[0060] An image containing barcode information is acquired.

[0061] Text in the image is recognized to obtain a text recognition result corresponding to the barcode information.

[0062] The barcode in the image is parsed to obtain a graphic parsing result corresponding to the barcode information.

[0063] Based on the text recognition result and the graphic parsing result, a recognition result of the barcode information is determined.

[0064] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects:

[0065] The present disclosure acquires an image containing barcode information, recognizes text in the image to obtain a text recognition result corresponding to the barcode information, parses the barcode in the image to obtain a graphic parsing result corresponding to the barcode information, and then determines a recognition result of the barcode information based on the text recognition result and the graphic parsing result. Since the barcode information is recognized based on the comprehensive text recognition result and graphic parsing result of the barcode information, the barcode information can be accurately recognized, the recognition effect of incomplete or blurred barcode information is improved, and the actual application requirement of barcode information recognition is met.

[0066] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0067] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0068] Figure 1 is a flowchart of a barcode information recognition method according to an exemplary embodiment of the present disclosure;

[0069] Figure 2 is a flowchart of how to recognize text in the image to obtain a text recognition result corresponding to the barcode information according to an exemplary embodiment of the present disclosure;

[0070] Figure 3 is a flowchart of how to parse the barcode in the image to obtain a graphic parsing result corresponding to the barcode information according to an exemplary embodiment of the present disclosure;

[0071] Figure 4 is a flowchart illustrating how to determine the recognition result of the barcode information based on the character recognition result and the graphic analysis result according to an example embodiment of the present disclosure;

[0072] Figure 5 is a block diagram of a barcode information recognition apparatus according to an example embodiment of the present disclosure;

[0073] Figure 6 is a block diagram of another barcode information recognition apparatus according to an example embodiment of the present disclosure;

[0074] Figure 7 is a block diagram of an electronic device according to an example embodiment of the present disclosure. DETAILED DESCRIPTION

[0075] The example embodiments will be described in detail herein with reference to the accompanying drawings. In the following description, unless otherwise indicated, like numbers in the different drawings represent the same or similar elements. The following example embodiments described in the example embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0076] In application scenarios such as a shopping mall, a supermarket, a library, etc., a scanning device can be used to scan barcode information printed on the surface of an article (e.g., a commodity in a shopping mall or a supermarket, or a book in a library, etc.), and then an image containing the barcode information scanned can be recognized, so that relevant information of the article such as the name, price, manufacturer, etc. of the article can be determined based on the recognition result of the barcode information.

[0077] In the related art, an image sequence of barcode information of a relevant article can be scanned, different frames of images in the image sequence contain different regions of the barcode information, then a sequence of code word index numbers corresponding to the barcode regions in each frame of image is determined by locating the barcode regions in each frame of image in the image sequence, then a sequence of code word index numbers of the barcode information is obtained by splicing the code word index numbers corresponding to the barcode regions in each frame of image, and finally a recognition result of the barcode information is determined. However, the inventors have found in research that the above technical solution can only recognize complete and clear barcode information, and the recognition effect of incomplete or blurred barcode information caused by factors such as scanning angle or light intensity is poor, which cannot meet the actual application requirements. In view of this, the present disclosure provides the following barcode information recognition method, apparatus, device and storage medium to solve the defects in the related art.

[0078] Figure 1is a flowchart of a bar code information recognition method according to an exemplary embodiment; the method of the embodiment can be applied to an electronic device with a bar code information recognition function, which can be a mobile terminal device such as a mobile phone, a wearable device, a tablet computer, a personal notebook, etc., or other fixed devices such as a scanning device for bar codes of goods in a retail scenario, a scanning device for bar codes of information in the field of information management and information systems, etc.

[0079] As shown in Figure 1 , the method comprises the following steps S101-S103:

[0080] In step S101, an image containing bar code information is acquired.

[0081] In the embodiment, when it is necessary to recognize the bar code information of a relevant article, an electronic device can acquire an image containing the bar code information.

[0082] Taking a scanning device for scanning bar code information of goods in a retail scenario as an example, when it is necessary to recognize the bar code information of a good, a user can scan the bar code information on the surface of the good through the scanning device, and then an image containing the bar code information can be acquired.

[0083] In step S102, the text in the image is recognized to obtain a text recognition result corresponding to the bar code information.

[0084] In the embodiment, after the electronic device acquires an image containing bar code information, the text in the image can be recognized to obtain a text recognition result corresponding to the bar code information.

[0085] The manner of recognizing the text in the image can be selected from related technologies based on actual business needs, and the obtained results are used in subsequent steps of the embodiment, and the embodiment does not limit the specific recognition manner.

[0086] It is worth noting that in related technologies, factors such as scanning angle or strong or weak light of bar code information sometimes cause the bar code to be blurred or incomplete, and thus the existing detection and decoding scheme cannot correctly parse the bar code information, affecting the bar code information recognition effect. In the embodiment, it is considered that in related technologies, the bar code information of an article contains not only a graphical bar code, but also a text bar code (i.e., the encoding result of the graphical bar code) printed beside the graphical bar code. Therefore, in the embodiment, the text bar code can be recognized by a text recognition manner, so that the comprehensiveness and accuracy of bar code information recognition can be improved, and the problem of poor recognition effect of bar code information caused by factors such as scanning angle or strong or weak light can be overcome.

[0087] In another embodiment, the manner of recognizing the text in the image can refer to the following Figure 2 The details are not described herein.

[0088] In step S103, the barcode in the image is parsed to obtain a graphic parsing result corresponding to the barcode information

[0089] In this embodiment, when the electronic device obtains an image containing barcode information, the barcode in the image can be parsed to obtain a graphic parsing result corresponding to the barcode information.

[0090] The manner of parsing the barcode in the image can be selected from related technologies based on actual business needs, for example, an image sequence containing barcode information of a related item can be obtained by scanning, different frames of images in the image sequence contain different regions of the barcode information, then the barcode region in each frame of image in the image sequence is located to determine the sequence of code word index numbers corresponding to the barcode region in each frame of image, then the code word index numbers of the barcode region in each frame of image are spliced to obtain the sequence of code word index numbers of the barcode information, and finally the recognition result of the barcode information is determined. The specific parsing manner is not limited in this embodiment.

[0091] In another embodiment, the manner of recognizing the text in the image can refer to the following Figure 2 In another embodiment, the manner of parsing the barcode in the image can refer to the following Figure 3 The details are not described herein.

[0092] It is worth noting that the execution order of steps S102 and S103 is only used for exemplary description, in actual application, step S103 can be executed first and then step S102 can be executed based on actual needs, or steps S102 and S103 can be executed simultaneously, which is not limited in this embodiment.

[0093] In step S104, the recognition result of the barcode information is determined based on the text recognition result and the graphic parsing result.

[0094] In this embodiment, when the text in the image is recognized to obtain a text recognition result corresponding to the barcode information, and the barcode in the image is parsed to obtain a graphic parsing result corresponding to the barcode information, the recognition result of the barcode information can be determined based on the text recognition result and the graphic parsing result.

[0095] It is worth mentioning that in the embodiment, the text recognition result and the graphic analysis result of the barcode information are both used as the reference information for recognizing the barcode information. In fact, when the text recognition result and the graphic analysis result are both accurate, the text recognition result and the graphic analysis result should be consistent and can both be used as the recognition result of the barcode information. Thus, in the embodiment, after obtaining the text recognition result and the graphic analysis result of the barcode information, the recognition result of the barcode information can be determined based on the two results, that is, the recognition result of the barcode information is obtained based on the content of the text recognition result and the graphic analysis result, so as to obtain the recognition result of the barcode information from the text recognition and the graphic analysis, and the comprehensiveness and accuracy of the barcode information recognition can be ensured.

[0096] In another embodiment, the manner of determining the recognition result of the barcode information based on the text recognition result and the graphic analysis result can refer to the following Figure 4 The embodiment is not described in detail here.

[0097] As can be seen from the above description, in the embodiment, the image containing the barcode information is obtained, the text in the image is recognized to obtain the text recognition result corresponding to the barcode information, the barcode in the image is analyzed to obtain the graphic analysis result corresponding to the barcode information, and then the recognition result of the barcode information is determined based on the text recognition result and the graphic analysis result. Since the barcode information is recognized based on the text recognition result and the graphic analysis result of the barcode information, the barcode information can be accurately recognized, the recognition effect of the incomplete or blurred barcode information is improved, and the actual application requirement of the barcode information recognition is met.

[0098] Figure 2 is a flowchart illustrating how to recognize the text in the image to obtain the text recognition result corresponding to the barcode information according to an example embodiment of the disclosure. The embodiment is exemplarily described taking how to recognize the text in the image to obtain the text recognition result corresponding to the barcode information as an example based on the above embodiment. The text recognition result can include a character string sequence corresponding to the barcode information.

[0099] As Figure 2 illustrated in the above step S102, the text in the image is recognized to obtain the text recognition result corresponding to the barcode information, which can include the following steps S201-S202:

[0100] In step S201, the image is input into a pre-trained text recognition model to obtain a preliminary recognition result.

[0101] In this embodiment, when the image containing the barcode information is acquired, the image can be input into a pre-trained text recognition model to obtain a preliminary recognition result.

[0102] For example, in this embodiment, a text recognition model for text recognition can be pre-trained. The type of the text recognition model can be set based on actual business needs, such as a CTPN (Connectionist Text Proposal Network) model or a SegLink model, and the like, which is not limited in this embodiment. Further, when the electronic device acquires an image of the barcode information by scanning the barcode information, the image can be input into the pre-trained text recognition model to obtain a preliminary recognition result. It can be understood that, in addition to the text form of the barcode, the preliminary recognition result can also contain some redundant text, such as non-alphabetic or non-numeric text, and the like, so that such redundant text can be filtered out through subsequent steps.

[0103] In step S202, based on a pre-set redundant text filtering rule, the redundant text in the preliminary recognition result is filtered out to obtain a string sequence corresponding to the barcode information.

[0104] In this embodiment, when the image is input into the pre-trained text recognition model to obtain a preliminary recognition result, based on a pre-set redundant text filtering rule, the redundant text in the preliminary recognition result can be filtered out to obtain a string sequence corresponding to the barcode information.

[0105] For example, the characters in the string sequence that meet the retention requirements (i.e., will not be filtered out) can be pre-set as alphabetic or numeric characters, and then the characters in the obtained string sequence that are neither alphabetic nor numeric can be filtered out as redundant text, that is, the pre-set redundant text filtering rule includes filtering out “non-alphabetic and non-numeric characters”. On the other hand, the format of the string sequence corresponding to the barcode information can also be pre-determined according to different types of barcode information, for example, the first five characters in the string sequence that meet the requirements are set to be “AB123”, and the like, and then when the preliminary recognition result is obtained, the string sequence in which the first five characters are not “AB123” can be filtered out as redundant text, that is, the pre-set redundant text filtering rule includes filtering out the string that does not meet the string format corresponding to the type of the currently scanned barcode information. It should be noted that the pre-set redundant text filtering rule can also refer to the text recognition scheme in the related art, and the obtained results can be applied to the subsequent steps of this embodiment, and the specific filtering rule is not limited in this embodiment.

[0106] As can be known from the above description, the embodiment can achieve accurate recognition of the text in the image of the barcode information by inputting the image into the pre-trained text recognition model to obtain a preliminary recognition result, and filtering out redundant text in the preliminary recognition result based on pre-set redundant text filtering rules to obtain a character sequence corresponding to the barcode information, so that the subsequent determination of the recognition result of the barcode information based on the obtained text recognition result and the graphic analysis result corresponding to the barcode information can be achieved, and the comprehensiveness and accuracy of barcode information recognition can be ensured.

[0107] Figure 3 is a flowchart illustrating how to analyze the barcode in the image to obtain a graphic analysis result corresponding to the barcode information according to an example embodiment of the present disclosure. The embodiment is exemplarily described taking how to recognize the text in the image to obtain a text recognition result corresponding to the barcode information as an example on the basis of the above embodiment. As shown in Figure 3 The step S102 of analyzing the barcode in the image to obtain a graphic analysis result corresponding to the barcode information can include the following steps S301-S304.

[0108] In step S301, the image is input into a pre-trained barcode detection model to obtain a barcode contained in the image and a corresponding position of the barcode.

[0109] In the embodiment, when an image containing barcode information is obtained, the image can be input into a pre-trained barcode detection model to obtain a barcode contained in the image and a corresponding position of the barcode.

[0110] For example, the embodiment can pre-train a barcode detection model for barcode detection. The type of the barcode detection model can be set based on actual business needs, such as a DBNet deep learning model, and the embodiment does not limit this. Further, when the electronic device obtains an image of barcode information by scanning the barcode information, the image can be input into the pre-trained barcode detection model to obtain a barcode contained in the image and a corresponding position. The corresponding position of the barcode can be the position of the region where the barcode is located in the image.

[0111] For example, if the barcode is a rectangular pattern formed by multiple vertical bars, the corresponding position of the barcode can be the coordinates of the two opposite corners of the rectangle, so that the barcode contained in the image can be cropped from the image based on the coordinates of the two opposite corners in the subsequent step.

[0112] In step S302, a sub-image of the barcode at the corresponding position is cropped from the image.

[0113] In this embodiment, after detecting the barcode and the corresponding position in the image based on the barcode detection model, a sub-image of the barcode at the corresponding position can be cropped from the image.

[0114] In this embodiment, after detecting the barcode and the corresponding position in the image based on the barcode detection model, a sub-image of the barcode at the corresponding position can be cropped from the image.

[0115] In step S303, the sub-image is subjected to image enhancement processing.

[0116] In this embodiment, after cropping the sub-image of the barcode at the corresponding position from the image, the sub-image is subjected to image enhancement processing.

[0117] The image enhancement processing mode can be set based on actual business needs, such as contrast adjustment and / or chroma adjustment, and the present embodiment does not limit this.

[0118] In step S304, the sub-image subjected to image enhancement processing is analyzed to obtain a graphical analysis result corresponding to the barcode information.

[0119] In this embodiment, after the sub-image is subjected to image enhancement processing, the sub-image subjected to image enhancement processing is analyzed to obtain a graphical analysis result corresponding to the barcode information.

[0120] For example, after the sub-image is subjected to image enhancement processing to obtain a sub-image subjected to image enhancement processing, the sub-image subjected to image enhancement processing can be analyzed based on a preset analysis mode, so that the graphical analysis result corresponding to the barcode information can be obtained.

[0121] In some embodiments, the analysis of the sub-image subjected to image enhancement processing based on the preset analysis mode can include analysis of the sub-image subjected to image enhancement processing by a barcode decoding module based on zxing or zbar, and the functions and applications of the barcode decoding module based on zxing or zbar can refer to the explanations and descriptions in the related art, which are not limited in the present embodiment.

[0122] As can be seen from the above description, this embodiment obtains the barcode contained in the image and the corresponding position of the barcode by inputting the image into a pre-trained barcode detection model, and cuts out a sub-image of the barcode at the corresponding position from the image, and performs image enhancement processing on the sub-image. The image enhancement processing includes adjusting the contrast and / or chromaticity, and then parsing the sub-image after image enhancement processing to obtain a graphic analysis result corresponding to the barcode information. This can accurately parse the barcode in the image, thereby enabling subsequent determination of the recognition result of the barcode information based on the text recognition result of the barcode information and the obtained graphic analysis result, and can achieve comprehensive and accurate recognition of the barcode information.

[0123] Figure 4 This is a flowchart showing how to determine the recognition result of the barcode information based on the text recognition result and the graphic analysis result according to an exemplary embodiment of the present disclosure; this embodiment uses how to determine the recognition result of the barcode information based on the text recognition result and the graphic analysis result as an example. Figure 4 As shown, the determination of the recognition result of the barcode information based on the text recognition result and the graphic analysis result in the above step S103 may include the following steps S401-S408:

[0124] In step S401, it is determined whether the text recognition result and the graphic analysis result are both valid: if so, step S402 is executed; if not, step S406 is executed;

[0125] In step S402, the text recognition result and the graphic analysis result are compared;

[0126] In step S403, it is determined whether the text recognition result and the graphic analysis result are consistent: if they are consistent, step S404 is executed; if they are inconsistent, step S405 is executed;

[0127] In step S404, any one of the text recognition result and the graphic analysis result is determined as the recognition result of the barcode information.

[0128] In step S405, the graphic analysis result is determined as the recognition result of the barcode information.

[0129] In step S406 , it is determined whether one and only one of the text recognition result and the graphic analysis result is valid: if so, step S407 is executed; if not, step S408 is executed.

[0130] In step S407, the valid result is determined as the recognition result of the barcode information.

[0131] In step S408, prompt information for prompting that the barcode information is not recognized is output.

[0132] In this embodiment, when the text in the image is recognized to obtain the text recognition result corresponding to the barcode information, and the barcode in the image is parsed to obtain the graphic parsing result corresponding to the barcode information, if it is detected that both the text recognition result and the graphic parsing result are valid, the text recognition result and the graphic parsing result can be compared, and then when it is detected that the text recognition result and the graphic parsing result are consistent (i.e., the text recognition result and the graphic parsing result are the same), any one of the text recognition result and the graphic parsing result can be determined as the recognition result of the barcode information; and when it is detected that the text recognition result and the graphic parsing result are inconsistent, the graphic parsing result can be determined as the recognition result of the barcode information, i.e., if the text recognition result and the graphic parsing result are different, the graphic parsing result is used as the reference. On the other hand, when it is determined that only one of the text recognition result and the graphic parsing result is valid, the valid result can be determined as the recognition result of the barcode information, i.e., the recognition result of the barcode information is determined based on the only valid result; and when it is determined that both the text recognition result and the graphic parsing result are invalid, prompt information for prompting that the barcode information is not recognized can be output to prompt the user that the current barcode information cannot be recognized.

[0133] As can be seen from the above description, the scheme of this embodiment can obtain the recognition result of the barcode through text recognition in the case of failure of graphic detection and decoding, and the graphic parsing result can also be used as the correction of the text recognition result, so as to ensure the comprehensiveness and accuracy of the barcode information recognition result and the robustness of the barcode information recognition scheme in different scenarios.

[0134] Figure 5 is a block diagram of a barcode information recognition device according to an example embodiment; the device of this embodiment can be applied to electronic devices with barcode information recognition function (such as a scanning device of a commodity barcode in a retail scenario, a scanning device of a material barcode in the field of information management and information system, etc.). As shown in the figure, the device can include an image acquisition module 110, a text recognition module 120, a graphic parsing module 130, and an information recognition module 140, wherein: Figure 5

[0135] The image acquisition module 110 is configured to acquire an image containing barcode information.

[0136] The text recognition module 120 is configured to recognize the text in the image to obtain a text recognition result corresponding to the barcode information.​

[0137] a graphic analysis module 130, configured to analyze the barcode in the image to obtain a graphic analysis result corresponding to the barcode information;

[0138] an information identification module 140, configured to determine an identification result of the barcode information based on the text recognition result and the graphic analysis result.

[0139] As can be seen from the above description, the apparatus of the embodiment obtains an image containing barcode information, and recognizes text in the image to obtain a text recognition result corresponding to the barcode information; analyzes the barcode in the image to obtain a graphic analysis result corresponding to the barcode information, and then determines an identification result of the barcode information based on the text recognition result and the graphic analysis result. Since the barcode information is identified based on the text recognition result and the graphic analysis result of the barcode information, the barcode information can be accurately identified, the identification effect of incomplete or blurred barcode information is improved, and the actual application requirement of barcode information identification is met.

[0140] Figure 6 is a block diagram of a barcode information identification apparatus according to yet another exemplary embodiment; the method of the embodiment can be applied to an electronic device with a barcode information identification function (for example, a scanning device of a commodity barcode in a retail scene, a scanning device of a material barcode in the field of information management and information system, etc.). Wherein, the image acquisition module 210, the text recognition module 220, the graphic analysis module 230 and the information identification module 240 have the same functions as the image acquisition module 110, the text recognition module 120, the graphic analysis module 130 and the information identification module 140 in the foregoing Figure 5 embodiment, and will not be described here.

[0141] As Figure 6 shown in the embodiment, the text recognition result can include a character string sequence corresponding to the barcode information; the text recognition module 120 can also be configured to:

[0142] input the image into a pre-trained text recognition model to obtain a preliminary recognition result;

[0143] filter out redundant texts in the preliminary recognition result based on a pre-set redundant text filtering rule to obtain a character string sequence corresponding to the barcode information.

[0144] In some embodiments, the graphic analysis module 130 can also be configured to:

[0145] input the image into a pre-trained barcode detection model to obtain a barcode contained in the image and a corresponding position of the barcode;

[0146] cropping a sub-image of the barcode at the corresponding position from the image;

[0147] performing image enhancement processing on the sub-image, the image enhancement processing including adjustment of contrast and / or chroma;

[0148] performing analysis on the sub-image after the image enhancement processing to obtain a graphic analysis result corresponding to the barcode information.

[0149] In some embodiments, the information recognition module 140 can include:

[0150] The result comparison unit 231 is configured to, in response to determining that both the text recognition result and the graphic analysis result are valid, compare the text recognition result and the graphic analysis result.

[0151] The first determination unit 232 is configured to, in response to the text recognition result and the graphic analysis result being consistent, determine either one of the text recognition result and the graphic analysis result as the recognition result of the barcode information.

[0152] In some embodiments, the information recognition module 240 can include:

[0153] The result comparison unit 231 is configured to, in response to determining that both the text recognition result and the graphic analysis result are valid, compare the text recognition result and the graphic analysis result.

[0154] The second determination unit 233 is configured to, in response to the text recognition result and the graphic analysis result being inconsistent, determine the graphic analysis result as the recognition result of the barcode information.

[0155] In some embodiments, the information recognition module 240 can include:

[0156] The third determination unit 234 is configured to, in response to determining that only one of the text recognition result and the graphic analysis result is valid, determine the valid result as the recognition result of the barcode information.

[0157] In some embodiments, the information recognition module 240 can further include:

[0158] The prompt output unit 235 is configured to, in response to determining that both the text recognition result and the graphic analysis result are invalid, output prompt information for prompting that the barcode information is not recognized.

[0159] As to the apparatus in the above-mentioned embodiments, the specific manners in which various modules perform operations have been described in details in the embodiments of the method, and thus will not be described in details here.

[0160] Figure 7 is a block diagram of an electronic device according to an exemplary embodiment. For example, the device 900 can be a mobile phone, a computer, a digital broadcasting terminal, a message transmitter / receiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0161] Referring to Figure 7 , the device 900 can include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.

[0162] The processing component 902 usually controls overall operations of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 can include one or more processors 920 to execute instructions to complete all or part of steps of the above-described methods. In addition, the processing component 902 can include one or more modules to facilitate interaction between the processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.

[0163] The memory 904 is configured to store various types of data to support operations of the device 900. Examples of these data include instructions for any application or method operating on the device 900, contact data, phonebook data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0164] The power supply component 906 supplies electric power for various components of the device 900. The power supply component 906 can include a power supply management system, one or more power supplies, and other components associated with generating, managing and distributing electric power for the device 900.

[0165] The multimedia component 908 includes a screen providing an output interface between the device 900 and a user. In some embodiments, the screen includes a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensors can not only sense a boundary of a touching or swiping action, but also detect duration and pressure associated with the touching or swiping action. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.

[0166] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC) to receive an external audio signal when the device 900 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 904 or transmitted via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0167] The I / O interface 912 provides an interface between the processing component 902 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0168] The sensor component 914 includes one or more sensors to provide various state assessments for the device 900. For example, the sensor component 914 can detect an open / closed state of the device 900, relative positioning of components, such as a display and a keypad of the device 900, a change in position of the device 900 or a component of the device 900, presence or absence of user contact with the device 900, a change in orientation of the device 900 or acceleration / deceleration of the device 900, and a temperature change of the device 900. The sensor component 914 can also include proximity sensor configured to detect presence of an object in proximity to the device 900, without any physical contact. The sensor component 914 can further include a light sensor (e.g., a CMOS or CCD image sensor) configured to function as an image capture device in a camera application. In some embodiments, the sensor component 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0169] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.

[0170] In an exemplary embodiment, the device 900 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components, for performing the above-described methods.

[0171] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 904 including instructions, is also provided, which can be executed by the processor 920 of the device 900 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0172] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following, in general, the principles of the present disclosure and including such features to the extent that they are not disclosed in the prior art. The specification and examples given are intended as illustrative only and not restrictive of the true scope and spirit of the present disclosure, which is set forth in the following claims.

[0173] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims that follow.

Claims

1. A bar code information recognition method characterized by comprising: The method comprises: acquiring an image containing barcode information; recognizing text in the image to obtain a text recognition result corresponding to the barcode information, the text recognition result comprising a character string sequence corresponding to the barcode information; analyzing the barcode in the image to obtain a graphic analysis result corresponding to the barcode information; determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result; the recognizing text in the image to obtain a text recognition result corresponding to the barcode information comprises: inputting the image into a pre-trained text recognition model to obtain a preliminary recognition result; filtering out redundant text in the preliminary recognition result based on a pre-set redundant text filtering rule to obtain a character string sequence corresponding to the barcode information; the determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result comprises: in response to determining that the text recognition result and the graphic analysis result are both valid, comparing the text recognition result and the graphic analysis result; in response to the text recognition result and the graphic analysis result being inconsistent, determining the graphic analysis result as the recognition result of the barcode information.

2. The method of claim 1, wherein, the analyzing the barcode in the image to obtain a graphic analysis result corresponding to the barcode information comprises: inputting the image into a pre-trained barcode detection model to obtain a barcode contained in the image and a corresponding position of the barcode; cropping a sub-image of the barcode at the corresponding position from the image; performing image enhancement processing on the sub-image, the image enhancement processing comprising adjustment of contrast and / or chroma; analyzing the sub-image subjected to the image enhancement processing to obtain a graphic analysis result corresponding to the barcode information.

3. The method of claim 1, wherein, the determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result further comprises: in response to the text recognition result and the graphic analysis result being consistent, determining either of the text recognition result and the graphic analysis result as the recognition result of the barcode information.

4. The method of claim 1, wherein, the determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result further comprises: in response to determining that only one of the text recognition result and the graphic analysis result is valid, determining the valid result as the recognition result of the barcode information.

5. The method of claim 1, wherein, the determining a recognition result of the barcode information based on the text recognition result and the graphic analysis result comprises: in response to determining that the text recognition result and the graphic analysis result are both invalid, outputting prompt information for prompting that the barcode information is not recognized.

6. A bar code information recognizing apparatus characterized by comprising: The apparatus comprises: an image acquisition module configured to acquire an image containing barcode information; a text recognition module configured to recognize text in the image to obtain a text recognition result corresponding to the barcode information, the text recognition result comprising a character string sequence corresponding to the barcode information; a graphic analysis module configured to analyze the barcode in the image to obtain a graphic analysis result corresponding to the barcode information; The information recognition module is configured to determine the recognition result of the barcode information based on the character recognition result and the graphic analysis result. The character recognition module is further configured to: input the image into a pre-trained character recognition model to obtain a preliminary recognition result; filter out redundant texts in the preliminary recognition result based on a pre-set redundant text filtering rule to obtain a character string sequence corresponding to the barcode information; The information recognition module comprises: a result comparison unit configured to compare the character recognition result and the graphic analysis result in response to a determination that both the character recognition result and the graphic analysis result are valid; a second determination unit configured to determine the graphic analysis result as the recognition result of the barcode information in response to a determination that the character recognition result and the graphic analysis result are inconsistent.

7. An electronic device, comprising: The device comprises: a processor and a memory for storing a computer program; wherein the processor is configured to implement the following when executing the computer program: obtain an image containing barcode information; recognize characters in the image to obtain a character recognition result corresponding to the barcode information, the character recognition result comprising a character string sequence corresponding to the barcode information; analyze the barcode in the image to obtain a graphic analysis result corresponding to the barcode information; determine the recognition result of the barcode information based on the character recognition result and the graphic analysis result; The recognizing characters in the image to obtain a character recognition result corresponding to the barcode information comprises: input the image into a pre-trained character recognition model to obtain a preliminary recognition result; filter out redundant texts in the preliminary recognition result based on a pre-set redundant text filtering rule to obtain a character string sequence corresponding to the barcode information; The determining the recognition result of the barcode information based on the character recognition result and the graphic analysis result comprises: compare the character recognition result and the graphic analysis result in response to a determination that both the character recognition result and the graphic analysis result are valid; determine the graphic analysis result as the recognition result of the barcode information in response to a determination that the character recognition result and the graphic analysis result are inconsistent.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the following: obtain an image containing barcode information; recognize characters in the image to obtain a character recognition result corresponding to the barcode information, the character recognition result comprising a character string sequence corresponding to the barcode information; analyze the barcode in the image to obtain a graphic analysis result corresponding to the barcode information; determine the recognition result of the barcode information based on the character recognition result and the graphic analysis result; The recognizing characters in the image to obtain a character recognition result corresponding to the barcode information comprises: input the image into a pre-trained character recognition model to obtain a preliminary recognition result; filter out redundant texts in the preliminary recognition result based on a pre-set redundant text filtering rule to obtain a character string sequence corresponding to the barcode information; The determining of the recognition result of the bar code information based on the character recognition result and the graphic analysis result comprises: In response to determining that the character recognition result and the graphic analysis result are both valid, comparing the character recognition result and the graphic analysis result; In response to the character recognition result and the graphic analysis result being inconsistent, determining the graphic analysis result as the recognition result of the bar code information.

Citation Information

Patent Citations

  • Image processing method and device

    CN111767750A

  • One-dimensional bar code recognition method and device, equipment and storage medium

    CN112733568A

  • Bar code recognition method and device, storage medium and computer equipment

    CN113312937A

  • Text recognition method and device, equipment and medium

    CN113313111A