Label processing method and apparatus, electronic device, and storage medium

By obtaining the text line detection area of ​​the product label during label processing and using numerical matching to process multiple text recognition results, the problem of existing technologies being unable to handle diverse label formats is solved, thereby improving the accuracy and efficiency of label information.

CN116486413BActive Publication Date: 2026-01-13BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310348278.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2026-01-13
Estimated Expiration
2043-04-03

AI Technical Summary

Technical Problem

Existing tag processing methods are unable to effectively cope with the diverse tag layout distributions in real-world business scenarios, resulting in reduced usability.

Method used

By obtaining multiple text line detection areas in the product label, the numerical matching method is used to process the multiple text recognition results to obtain label information, including regular expression matching and numerical matching functions. Abnormal recognition results are filtered out, and small number segments are matched first and then integer fields are matched. Combined with the prominent display design of product price information, the area of ​​numerical regions is calculated and integer positions are corrected.

Benefits of technology

This improves the usability and efficiency of label processing methods in scenarios with diverse label layouts, ensuring the accuracy and reliability of label information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116486413B_ABST
    Figure CN116486413B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of computer vision, image processing, deep learning and the like, which can be applied to optical character recognition, smart city and the like, and specifically relates to a label processing method and device, an electronic device and a storage medium. The specific implementation scheme is as follows: obtaining multiple text line detection regions in a commodity label for identification, obtaining multiple text recognition results, each text recognition result corresponding to a text line detection region; processing the multiple text recognition results through a numerical matching method to obtain label information in the commodity label. The present disclosure can effectively cope with the diversified label layout distribution in the actual business scenario, thereby improving the usability of the label processing method.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of computer vision, image processing, deep learning, etc., and can be applied to optical character recognition, smart city, etc. The present disclosure relates to a label processing method and device, an electronic device and a storage medium. BACKGROUND

[0002] Label processing generally refers to obtaining text content in a label to be processed, for example, obtaining numerical information such as product price information and product code information that may exist in a label to be processed, so as to promote digital operation of a merchant. At present, the commonly used label processing method is usually used only for processing simple format product labels, and it is difficult to effectively cope with the diversified label format distribution in actual business scenarios, thereby reducing the usability of the label processing method. SUMMARY

[0003] The present disclosure provides a label processing method, device, electronic device and storage medium.

[0004] According to an aspect of the present disclosure, a label processing method is provided, comprising:

[0005] obtaining a plurality of text recognition results by identifying a plurality of text line detection regions in a product label, each text recognition result corresponding to a text line detection region;

[0006] processing the plurality of text recognition results by a numerical matching method to obtain label information in the product label.

[0007] According to a second aspect of the present disclosure, a label processing device is provided, comprising:

[0008] a recognition result obtaining unit configured to obtain a plurality of text recognition results by identifying a plurality of text line detection regions in a product label, each text recognition result corresponding to a text line detection region;

[0009] a recognition result processing unit configured to process the plurality of text recognition results by a numerical matching method to obtain label information in the product label.

[0010] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0011] at least one processor;

[0012] a memory in communication connection with the at least one processor;

[0013] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect.

[0014] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method provided in the first aspect.

[0015] According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method provided in the first aspect.

[0016] The present disclosure can effectively cope with diversified label format distribution in actual business scenarios, thereby improving the availability of the label processing method.

[0017] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0018] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0019] Figure 1 A flowchart of a label processing method provided by an embodiment of the present disclosure;

[0020] Figure 2A And Figure 2B A schematic diagram of a text line detection region provided by an embodiment of the present disclosure;

[0021] Figure 3 A schematic diagram of a complete numerical field provided by an embodiment of the present disclosure;

[0022] Figure 4A , Figure 4B And Figure 4C An illustration of a label information acquisition method provided by an embodiment of the present disclosure;

[0023] Figure 5 A schematic diagram of an integer bit distribution provided by an embodiment of the present disclosure;

[0024] Figure 6 An illustration of a commodity attribute information acquisition method provided by an embodiment of the present disclosure;

[0025] Figure 7 A flowchart of a label processing method provided by an embodiment of the present disclosure;

[0026] Figure 8 An auxiliary process illustration of a label processing method provided by an embodiment of the present disclosure;

[0027] Figure 9 A complete flowchart of a label processing method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0028] Figure 10 An application scenario diagram of a label processing method provided by an embodiment of the present disclosure is shown in FIG. 2.

[0029] Figure 11 A schematic structural block diagram of a label processing apparatus provided by an embodiment of the present disclosure is shown in FIG. 3.

[0030] Figure 12 A schematic structural block diagram of an electronic device provided by an embodiment of the present disclosure is shown in FIG. 4. DETAILED DESCRIPTION

[0031] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding them. These should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted from the following description.

[0032] As described in the background, the existing label processing method is generally used only for processing simple format commodity labels, for example, commodity price labels with independent price fields and non-price fields.

[0033] Specifically, the existing label processing method generally performs the following steps: after identifying multiple text line detection regions in a commodity price label through a general Optical Character Recognition (OCR) model to obtain multiple text recognition results, dividing each text recognition result into a price field or a non-price field through a price text detection model, selecting a target recognition result belonging to the price field, and obtaining label information based on the target recognition result, the label information including commodity price information. Since the price text detection model simply divides each text recognition result into a price field or a non-price field, and the actual business scenario also includes complex situations such as mixed price fields and non-price fields. This makes it difficult for the existing label processing method to effectively cope with the diversified label format distribution in the actual business scenario, thus reducing the usability of the label processing method.

[0034] Based on this, the embodiments of the present disclosure provide a label processing method, which can be applied to an electronic device. In the following, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. Figure 1The flowchart shown illustrates a label processing method provided by an embodiment of the present disclosure. It should be noted that although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can also be performed in other sequences.

[0035] In step S101, a plurality of text line detection regions in a commodity label are identified to obtain a plurality of text recognition results, each text recognition result corresponding to a text line detection region.

[0036] In step S102, the plurality of text recognition results are processed by a numerical value matching method to obtain label information in the commodity label.

[0037] The commodity label can be a label obtained by photographing a commodity display shelf in an actual business scenario such as commodity sales inspection, and determined from a label image. Based on this, the commodity label can be a commodity price label used to display the commodity name, commodity price information, capacity specification, shelf life, etc. of the corresponding commodity. The commodity label can also be a label obtained by photographing a commodity in an actual business scenario such as commodity storage warehouse inspection and commodity storage positioning, and determined from a label image. Based on this, the commodity label can also be a commodity code label used to display the commodity name, commodity code number, and commodity storage location of the corresponding commodity.

[0038] Before performing the label processing method provided by the present disclosure, a plurality of text line detection regions can be determined from the commodity label, and each text line detection region can be identified to obtain a text recognition result of each text line detection region, thereby obtaining a plurality of text recognition results. The text line detection region can be a rectangular detection region containing a text field with spatial continuity, consistent height of the line center line, and consistent width of the line as a whole. The text field can be composed of any one of characters, numbers, letters, and symbols, or at least two of them, and the present disclosure does not limit this.

[0039] Please refer to Figure 2A and Figure 2B . Figure 2A In the above examples, the commodity label is a commodity price label including six text line detection regions. Among them, "2.5 yuan" is a text field with spatial continuity, consistent height of the line center line, and consistent width of the line as a whole, so the region where it is located is taken as a text line detection region. Figure 2BIn the specific example, the product label includes 7 text line detection areas. Among them, "2" and ".5" are not a text field with spatial continuity, consistent height of line center line, and consistent overall width of line. Therefore, the areas where the two are located are respectively regarded as a text line detection area.

[0040] In addition, in the embodiment of the present disclosure, after obtaining the multiple text recognition results by identifying the multiple text line detection areas in the product label, the multiple text recognition results can be processed by a numerical value matching method to obtain the label information in the product label. Among them, the label information belongs to numerical value information, for example, in the case of a product price label, the label information can include product price information; for another example, in the case of a product code label, the label information can include the product code label.

[0041] In a specific example, at least one complete numerical value field conforming to a target numerical value format can be matched from the multiple text recognition results by a numerical value matching method; and based on the obtained at least one complete numerical value field, the label information in the product label is obtained. Among them, the numerical value matching method can be implemented based on a regular matching method, or implemented based on a numerical value matching function, and the embodiment of the present disclosure does not limit this. Among them, the target numerical value format can be set according to actual business needs, for example, in the case of a product price label and the label information including product price information, the target numerical value format can be set to at least one of "##.##" and "##,##". For another example, in the case of a product code label and the label information including product code information, the target numerical value format can be set to at least one of "##-##-##" and "##.##.##". . . "##-##-##" and "##.##.##". Among them, "##" is a numerical wildcard.

[0042] ​​​​The label processing method provided in the embodiments of the present disclosure can obtain multiple text recognition results by identifying multiple text line detection regions in a commodity label, and process the multiple text recognition results by a numerical matching manner to obtain label information in the commodity label. The numerical matching manner can focus on numerical fields and is not affected by label formats. Therefore, for any two to-be-processed labels with different label formats but consistent text content, the same label information can be obtained by processing their corresponding multiple text recognition results by the numerical matching manner when they are respectively taken as commodity labels. This can effectively cope with diversified label format distribution in actual business scenarios, thereby improving the usability of the label processing method.

[0043] In addition, it should be noted that, before the multiple text recognition results are processed by the numerical matching manner to obtain the label information in the commodity label, the abnormal recognition results in the multiple text recognition results can also be screened out to improve the label processing efficiency. In a specific example, the abnormal recognition result can be a text recognition result whose corresponding text line detection region accounts for less than an area ratio threshold in the area of the commodity label, or a text recognition result whose corresponding text line detection region has a length-width ratio value less than a length-width ratio threshold. The area ratio threshold and the length-width ratio threshold can be set according to actual business needs, for example, the area ratio threshold can be 1%, and the length-width ratio threshold can also be 1%. The embodiments of the present disclosure do not limit this.

[0044] In some optional embodiments, processing the multiple text recognition results by the numerical matching manner to obtain the label information in the commodity label can include the following steps:

[0045] Matching the target recognition result by the numerical matching manner to obtain a numerical matching result, the target recognition result being any text recognition result in the multiple text recognition results;

[0046] In a case where the numerical matching result represents that the target recognition result contains a complete numerical field, obtaining the complete numerical field;

[0047] Obtaining the label information in the commodity label based on the obtained at least one complete numerical field.

[0048] In the embodiments of the present disclosure, in the case that a complete numerical field is successfully matched from the target recognition result by the numerical matching manner, a numerical matching result for representing that the target recognition result contains the complete numerical field is obtained; in the case that a complete numerical field is not successfully matched from the target recognition result by the numerical matching manner, a numerical matching result for representing that the target recognition result does not contain the complete numerical field is obtained. The complete numerical field can be a decimal field (including an integer part, a decimal point and a decimal part) or an integer field. The decimal field can be used to represent any decimal numerical value in the numerical range of 000.00 to 999.99, and the integer field can be used to represent any integer numerical value in the numerical range of -10 to 2147483647. The two numerical ranges can be set according to actual needs. For example, in the case that the product label is a product code label and the label information includes product code information, the decimal field can also be used to represent any decimal numerical value in the numerical range of 000000.00 to 999999.99.

[0049] Through the above steps, in the embodiments of the present disclosure, it is determined whether each text recognition result contains a complete numerical field, and in the case that the text recognition result contains the complete numerical field, the complete numerical field is obtained to obtain at least one complete numerical field, so that the case that the complete numerical field is missed is avoided. Therefore, it can be ensured that the at least one complete numerical field is all the complete numerical fields contained in the multiple text recognition results. Then, when the label information in the product label is obtained based on the obtained at least one complete numerical field, the reliability of the label information can be improved.

[0050] In the embodiments of the present disclosure, the numerical matching manner can include a decimal matching manner and an integer matching manner. Based on this, in some optional embodiments, "matching the target recognition result by the numerical matching manner to obtain a numerical matching result" can include the following steps:

[0051] matching the target recognition result by the decimal matching manner;

[0052] in the case that a decimal field is successfully matched from the target recognition result by the decimal matching manner, a numerical matching result for representing that the target recognition result contains the complete numerical field and the complete numerical field is the decimal field is obtained;

[0053] in the case that a decimal field is not successfully matched from the target recognition result by the decimal matching manner, the target recognition result is matched by the integer matching manner;

[0054] In a case that an integer field is successfully matched from the target recognition result by the integer matching manner, a numerical matching result is obtained to represent that the target recognition result contains a complete numerical field and the complete numerical field is an integer field.

[0055] The integer matching manner is used to match an integer field, and can be implemented based on the regular matching method or the numerical matching function, which is not limited in the embodiments of the present disclosure.

[0056] That is, in the embodiments of the present disclosure, first, the target recognition result is matched by the decimal matching manner. In a case that a decimal field is successfully matched from the target recognition result by the decimal matching manner, a numerical matching result is obtained to represent that the target recognition result contains a complete numerical field and the complete numerical field is a decimal field. In a case that a decimal field is not successfully matched from the target recognition result by the decimal matching manner, the target recognition result is matched by the integer matching manner. In a case that an integer field is successfully matched from the target recognition result by the integer matching manner, a numerical matching result is obtained to represent that the target recognition result contains a complete numerical field and the complete numerical field is an integer field.

[0057] Through the above steps, it can be understood that the target recognition result is matched in the order of preferentially matching a decimal field and then matching an integer field in the embodiments of the present disclosure. Since the commodity price information and the commodity code information are usually more widely represented in the form of a decimal value, the matching efficiency of the target recognition result can be improved by matching the target recognition result in this order, thereby improving the label processing efficiency.

[0058] In some optional embodiments, the matching of the target recognition result by the decimal matching manner can include the following steps:

[0059] obtaining a first regular expression used to match a decimal value;

[0060] matching the target recognition result by the first regular expression.

[0061] That is, in the embodiments of the present disclosure, the decimal matching manner is implemented based on the regular matching method.

[0062] In a specific example, the first regular expression can be:

[0063] std::string str_radixpoint {"[0-9]+(.[0-9]{1,2}+)?|[1-9]+[0-9]+(.[0-9]{1,2}+)?|[1-9]+[0-9]+[0-9]+(.[0-9]{1,2}+)?"}

[0064] Through the first regular expression, any decimal type numerical value in the numerical range of 000.00 to 999.99 can be matched, and if the decimal type numerical value is successfully matched, it is regarded as the decimal field successfully matched from the target recognition result.

[0065] In addition, it should be noted that in the case of the present embodiment of the present disclosure, when the product label is a product code label and the label information includes product code information, since the decimal field is used to represent any decimal type numerical value in the numerical range of 000000.00 to 999999.99, the aforementioned first regular expression can also be adjusted so that when the target recognition result is matched by the adjusted first regular expression, the decimal type numerical value in the numerical range of 000000.00 to 999999.99 can be successfully matched from the target recognition result.

[0066] Through the above steps, in the present embodiment of the present disclosure, the first regular expression for matching the decimal type numerical value can be obtained, and then the target recognition result is matched by the first regular expression, so as to realize the matching of the decimal field based on the regular matching method. Since the regular matching method can match any field conforming to the target numerical format through a simple regular expression and has the characteristics of efficient matching, the matching efficiency of the target recognition result can be improved to improve the label processing efficiency.

[0067] In the present embodiment of the present disclosure, the decimal matching method can also be realized based on the first numerical matching function.

[0068] In a specific example, the first numerical matching function can include find(".") and isdigit().

[0069] Based on this, in this embodiment of the disclosure, a decimal point can be found in the target recognition result using `find(".")`. If the decimal point is found, `isdigit()` is used to find the first digit segment before the decimal point and the second digit segment after the decimal point. Finally, the first digit segment, the decimal point, and the second digit segment are merged to obtain a decimal merging result. If the decimal merging result meets the target numerical format, it is used as the decimal segment successfully matched from the target recognition result. Where the product label is a product price label and the label information includes product price information, the target numerical format can be set to "". . When the product label is a product code label and the label information includes product code information, the target value format can be set to "". . ".in," " is a numeric wildcard. In some optional implementations, "matching the target recognition result by integer matching" may include the following steps:

[0070] Get the second regular expression used to match integer values;

[0071] The target recognition results are matched using a second regular expression.

[0072] In other words, in this embodiment of the disclosure, the integer matching method is implemented based on the regular expression matching method.

[0073] In a specific example, the second regular expression could be:

[0074] std::string str_number{"-[1-9]+([0-9]+)?|[1-9]+([0-9]+)?"}

[0075] This second regular expression can be used to match any integer value in the range of -10 to 2147483647. If an integer value is successfully matched, it will be used as the integer field successfully matched from the target recognition result.

[0076] Through the above steps, in this embodiment of the disclosure, a second regular expression for matching integer values ​​can be obtained. Then, the target recognition result is matched using the second regular expression, thereby achieving integer field matching based on regular expression matching. Since regular expression matching can match any field conforming to the target numerical format using concise regular expressions and has the characteristic of efficient matching, it can improve the matching efficiency of target recognition results, thereby improving tag processing efficiency.

[0077] In the embodiments of the present disclosure, the integer matching manner can also be implemented based on a second numerical value matching function.

[0078] In a specific example, the second numerical value matching function can include isdigit().

[0079] Based on this, in the embodiments of the present disclosure, the continuous number field can be found in the target recognition result in the order from front to back as the integer field successfully matched from the target recognition result by isdigit().

[0080] In the embodiments of the present disclosure, the numerical value matching manner can also include a decimal part matching manner. Based on this, in an optional implementation, the step of “matching the target recognition result by the numerical value matching manner to obtain a numerical value matching result” can further include the following steps:

[0081] matching the target recognition result by the decimal part matching manner;

[0082] in a case where the decimal part field is successfully matched from the target recognition result by the decimal part matching manner, storing the decimal part field into the to-be-merged array;

[0083] in a case where the decimal part field is not successfully matched from the target recognition result by the decimal part matching manner, performing the step of matching the target recognition result by the decimal matching manner.

[0084] The decimal part matching manner is used to match the decimal part field, and can be implemented based on a regular matching method or a numerical value matching function, and the embodiments of the present disclosure do not make specific limitations thereon. In addition, in the embodiments of the present disclosure, the decimal part field is a numerical value field with a starting character of a decimal point. For example, “.5”.

[0085] That is, in the embodiments of the present disclosure, first, the target recognition result is matched by the decimal part matching manner, in a case where the decimal part field is successfully matched from the target recognition result by the decimal part matching manner, the decimal part field is stored into the to-be-merged array, and in a case where the decimal part field is not successfully matched from the target recognition result by the decimal part matching manner, the step of matching the target recognition result by the decimal matching manner is performed.

[0086] It can be understood that, in the embodiment of the disclosure, the target recognition result is matched in the order of preferentially matching the decimal part field, then matching the decimal field, and finally matching the integer field. Since the target recognition result contains the decimal part field, which belongs to an extreme case and is easy to interfere with the matching of the integer field, the decimal part field can be preferentially matched to exclude the interference, thereby improving the matching accuracy of the target recognition result.

[0087] In some optional embodiments, the matching of the target recognition result by the decimal part matching manner can include the following steps:

[0088] In the case that the target recognition result contains a numerical field starting with a decimal point, a third regular expression for matching integer numerical values is obtained;

[0089] The remaining field after the decimal point in the target recognition result is matched by the third regular expression.

[0090] That is, in the embodiment of the disclosure, the decimal part matching manner is implemented based on the regular matching method.

[0091] In a specific example, the third regular expression can be:

[0092] std::string str_number{"[1-9]+([0-9]+)?"}

[0093] By the third regular expression, any integer numerical value in the numerical range of 1 to 2147483647 can be matched. If an integer numerical value is successfully matched, it is combined with the decimal point to obtain the decimal part field successfully matched from the target recognition result.

[0094] Through the above steps, in the embodiment of the disclosure, in the case that the starting character of the target recognition result is a decimal point, a third regular expression for matching integer numerical values is obtained, and the remaining field after the decimal point in the target recognition result is matched by the third regular expression. Since the regular matching method can match any field conforming to the target numerical format by a simple regular expression and has the characteristics of efficient matching, the matching efficiency of the target recognition result can be improved to improve the label processing efficiency.

[0095] In the embodiment of the disclosure, the decimal part matching manner can also be implemented based on a third numerical value matching function.

[0096] In a specific example, the third numerical value matching function can include find(“.”) and isdigit().

[0097] Based on this, in the embodiments of the present disclosure, the decimal point can be found in the target recognition result by find(". "), and in the case that the decimal point is found and no adjacent number field is determined before the decimal point, the third number field after the decimal point can be found by isdigit(). Finally, the decimal point and the third number field are merged to obtain a decimal part merging result as the successfully matched decimal part field from the target recognition result.

[0098] As described above, in the case that the product label is a product price label, the label information can include product price information. Based on this, in some optional embodiments, "obtaining label information in the product label based on the obtained at least one complete numerical value field" can include the following steps:

[0099] determining a target detection area corresponding to each complete numerical value field from a plurality of text line detection areas, and a numerical value area in the target detection area;

[0100] determining a target field corresponding to the largest numerical value area from at least one complete numerical value field;

[0101] obtaining product price information in the product label based on the target field.

[0102] In the embodiments of the present disclosure, after determining the target detection area corresponding to each complete numerical value field from a plurality of text line detection areas, the footprint area of the complete numerical value field can be determined from the target detection area as the numerical value area in the target detection area. In a specific example, the total area of the target detection area can be determined, the character proportion of the complete numerical value field in the target detection area can be determined, and the product of the total area and the character proportion can be calculated as the numerical value area in the target detection area.

[0103] Please refer to Figure 3 , based on Figure 3 The product price label shown in the figure can obtain three complete numerical value fields, wherein the first complete numerical value field is "500", the second complete numerical value field is "6", and the third complete numerical value field is "2.5". Among them, the first complete numerical value field corresponds to the first target detection area 301, and the numerical value area in the first target detection area 301 is the area of the first internal area 3011; the second complete numerical value field corresponds to the second numerical value detection frame 302, and the numerical value area in the second target detection area 302 is the area of the second internal area 3021; the third complete numerical value field corresponds to the third numerical value detection frame 303, and the numerical value area in the third target detection area 303 is the area of the first internal area 3031.

[0104] Obviously, the third complete numerical field is the target field with the largest numerical region area among the three complete numerical fields, and thus, according to the price tag design thinking that the commodity price information usually needs to be prominently displayed, the commodity price information in the commodity label can be obtained based on the target field.

[0105] Through the above steps, in the embodiments of the present disclosure, the target detection region corresponding to each complete numerical field can be determined from the plurality of text line detection regions, and the numerical region area in the target detection region can be determined, and then the target field with the largest numerical region area can be determined from the at least one complete numerical field, and the commodity price information in the commodity label can be obtained based on the target field. Since this process conforms to the price tag design thinking that the commodity price information usually needs to be prominently displayed, it can be applied to most commodity price labels, thereby improving the usability of the label processing method. In addition, the numerical region area can be obtained by relying on simple processing logic, and thus the label processing complexity can be reduced to improve the label processing efficiency.

[0106] In some optional embodiments, "obtaining the commodity price information in the commodity label based on the target field" can include the following steps:

[0107] In the case where the target field is a decimal field, the decimal field is taken as the commodity price information in the commodity label.

[0108] In the case where the target field is an integer field and the to-be-merged array is not empty, the integer field and the decimal part field in the to-be-merged array are merged to obtain the commodity price information in the commodity label.

[0109] In the case where the target field is an integer field and the to-be-merged array is empty, the integer field is subjected to integer bit correction to obtain the commodity price information in the commodity label.

[0110] Please refer to Figure 4A In the case where the target field is a decimal field, the decimal field can be taken as the commodity price information in the commodity label to cope with the case in the actual business scenario where the commodity price information is represented by a decimal numerical value and the integer part and the decimal part are located in the same text line detection region. Figure 4A In the embodiment of

[0111] Please refer to Figure 4B In the case where the target field is an integer field and the to-be-merged array is not empty, the integer field and the decimal part field in the to-be-merged array can be merged to obtain the commodity price information in the commodity label to cope with the case in the actual business scenario where the commodity price information is represented by a decimal numerical value and the integer part and the decimal part are located in different text line detection regions. Figure 4BIn the integer field, the integer field is specifically "2", and the decimal part field ".5" is stored in the array to be merged.

[0112] Please combine Figure 4C In the case that the target field is an integer field and the array to be merged is empty, the integer field is modified to obtain the product price information in the product label, so as to cope with the actual business scenario in which the product price information is represented by an integer value. In addition, Figure 4C In the integer field, the integer field is specifically "2", and the array to be merged is empty.

[0113] Through the above steps, in the embodiment of the disclosure, corresponding acquisition strategies can be provided for different representations of product price information, thereby avoiding the situation of missing detection or inaccurate detection of product price information, so as to improve the usability of the label processing method.

[0114] In some optional embodiments, "modifying the integer field to obtain the product price information in the product label" can include the following steps:

[0115] Obtaining the character bit number of the integer field;

[0116] Determining the correction ratio according to the character bit number;

[0117] Calculating the quotient of the integer field and the correction ratio as the product price information in the product label.

[0118] In the embodiment of the disclosure, the corresponding relationship between the character bit number and the correction ratio can be set according to actual business needs, and the embodiment of the disclosure does not make specific limitations.

[0119] In a specific example, the actual business scenario is a retail inspection scenario, so in the case that the character bit number is 2, the corresponding correction ratio can be 10; in the case that the character bit number is greater than 2, the corresponding correction ratio can be 100. Based on this, in the embodiment of the disclosure, when the character bit number is 2, the quotient of the integer field and 10 can be calculated as the product price information in the product label; when the character bit number is greater than 2, the quotient of the integer field and 100 can be calculated as the product price information in the product label.

[0120] In another specific example, the actual business scenario is a mobile communication device sales inspection scenario, so in the case that the character bit number is 5, the corresponding correction ratio can be 10; in the case that the character bit number is greater than 5, the corresponding correction ratio can be 100. Based on this, in the embodiment of the disclosure, when the character bit number is 5, the quotient of the integer field and 10 can be calculated as the product price information in the product label; when the character bit number is greater than 5, the quotient of the integer field and 100 can be calculated as the product price information in the product label.

[0121] In the case that the commodity price information is represented by a decimal type numerical value, and the integer part and the decimal part are located in the same text line detection area, in the process of detecting the text line area and obtaining the corresponding text recognition result, the decimal point may be missed, for example, 4.0 is detected as 40. Therefore, the integer field needs to be corrected. In the embodiments of the present disclosure, the character bit number of the integer field can be obtained, and then the correction ratio is determined according to the character bit number, and the quotient of the integer field and the correction ratio is calculated as the commodity price information in the commodity label, which can realize the integer bit correction of the commodity price information, thereby improving the reliability of the label information.

[0122] Similarly, as described above, in the case that the commodity label is a commodity price label, the label information can include commodity price information. Based on this, in some optional embodiments, the label processing method can further include the following steps:

[0123] The commodity price information in the plurality of label information obtained by taking any one of the plurality of to-be-processed labels as a commodity label is subjected to numerical distribution statistics to obtain a statistical result, and the plurality of to-be-processed labels are located in the same label image, and each label information corresponds to one to-be-processed label.

[0124] Based on the statistical result, the to-be-corrected information is determined from the plurality of commodity price information obtained.

[0125] The to-be-corrected information is subjected to normalization correction to obtain normalized commodity price information.

[0126] It can be understood that in the actual business scenarios such as commodity shelf inspection, the label image obtained by photographing the commodity shelf usually includes a plurality of to-be-processed labels, and each to-be-processed label corresponds to one commodity.

[0127] In the embodiments of the present disclosure, after the commodity price information in the plurality of label information obtained by taking any one of the plurality of to-be-processed labels as a commodity label is subjected to numerical distribution statistics to obtain a statistical result, in a specific example, based on the statistical result, the to-be-corrected information can be determined from the plurality of commodity price information obtained. Specifically, based on the statistical result, the commodity price information with a specific numerical value that is greatly different from other commodity price information is determined as the to-be-corrected information. Thereafter, the to-be-corrected information is subjected to normalization correction to obtain normalized commodity price information.

[0128] In actual business scenarios such as commodity sales inspection, the selling prices of multiple commodities in the same display area of a commodity display rack are usually comparable. Based on this, in the above steps, in the embodiments of the present disclosure, the commodity price information in the multiple label information obtained by taking any one of the multiple to-be-processed labels as a commodity label can be subjected to numerical distribution statistics to obtain a statistical result, and based on the statistical result, the to-be-corrected information can be determined from the multiple commodity price information obtained, and the to-be-corrected information can be normalized and corrected to obtain normalized and corrected commodity price information, so that the normalized and corrected commodity price information is comparable to other commodity price information in the same display area, thereby improving the reliability of the label information.

[0129] In a specific example, "determining the to-be-corrected information from the multiple commodity price information based on the statistical result" can include the following steps:

[0130] Based on the statistical result, the integer digit distribution of the multiple commodity price information is determined.

[0131] Based on the integer digit distribution, the global proportion of the integer digit corresponding to each commodity price information is determined.

[0132] The commodity price information corresponding to the global proportion of the integer digit less than the preset proportion is determined from the multiple commodity price information as the to-be-corrected information.

[0133] The preset proportion can be 20%, which can be set according to actual business needs, and the embodiments of the present disclosure do not limit this.

[0134] Suppose, in actual business scenarios such as commodity sales inspection, the commodity display rack is photographed to obtain a label image including 10 to-be-processed labels, and any one of the 10 to-be-processed labels is taken as a commodity label to obtain 10 commodity price information, which are 8.5, 9.3, 9.5, 10.0, 10.5, 12.3, 12.7, 13.0, 13.5, and 145. Then, please refer to Figure 5 After the numerical distribution statistics of the 10 commodity price information is performed to obtain a statistical result, based on the statistical result, the integer digit distribution of the 10 commodity price information can be determined as follows: the integer digit of 3 commodity price information is 1, the integer digit of 6 commodity price information is 2, and the integer digit of 1 commodity price information is 3.

[0135] Based on the above integer digit distribution, it can be determined that the global proportion of integer digits corresponding to the commodity price information 8.5, the commodity price information 9.3, and the commodity price information 9.5 is 30%, the global proportion of integer digits corresponding to the commodity price information 10.0, the commodity price information 10.5, the commodity price information 12.7, and the commodity price information 13.0 is 60%, and the global proportion of integer digits corresponding to the commodity price information 145 is 10%. Therefore, in the case that the preset proportion is 20%, the commodity price information 145 can be taken as the to-be-corrected information.

[0136] Through the above steps, in the embodiment of the disclosure, the integer digit distribution of the plurality of commodity price information can be determined based on the statistical result, and then the global proportion of integer digits corresponding to each commodity price information is determined based on the integer digit distribution, and the commodity price information corresponding to the global proportion of integer digits less than the preset proportion is determined from the plurality of commodity price information as the to-be-corrected information. That is, in the embodiment of the disclosure, the to-be-corrected information can be determined only based on the integer digit distribution, without considering the specific value of the integer part, the specific value of the decimal digit, and the specific value of the decimal part, etc. Therefore, the label processing complexity can be reduced to improve the label processing efficiency.

[0137] In a specific example, "normalizing and correcting the to-be-corrected information to obtain the commodity price information after normalization correction" can include the following steps:

[0138] Based on the integer digit distribution, determining a target integer digit with the largest global proportion of integer digits;

[0139] According to the target integer digit, adjusting the integer digit of the to-be-corrected information to obtain the commodity price information after normalization correction.

[0140] In a specific example, after determining the target integer digit with the largest global proportion of integer digits based on the integer digit distribution, a decimal point can be added in the to-be-corrected information based on the target integer digit to divide a new integer part from the to-be-corrected information, so that the integer digit of the new integer part is consistent with the target integer digit, and the commodity price information after normalization correction is obtained.

[0141] For example, the to-be-corrected information is 145, and the target integer digit is 2. A decimal point can be added between 14 and 5 in the to-be-corrected information 145 to divide 14 as a new integer part from the to-be-corrected information 145, and 5 in the to-be-corrected information 145 as a decimal part, and the commodity price information after normalization correction is 14.5.

[0142] Through the above steps, in the embodiment of the disclosure, the target integer digit with the largest global proportion of integer digits can be determined based on the distribution of integer digits, and the integer digits of the to-be-corrected information are adjusted to be consistent with the target integer digit, so as to obtain the normalized and corrected commodity price information, thereby realizing the normalization correction of the to-be-corrected information through simple processing logic, which can reduce the complexity of label processing and improve the efficiency of label processing.

[0143] In some optional embodiments, the label processing method can further include the following steps:

[0144] From the plurality of text recognition results, at least one remaining recognition result irrelevant to the label information is determined.

[0145] Based on the at least one remaining recognition result, commodity attribute information in the commodity label is obtained.

[0146] Based on the label information and the commodity attribute information in the commodity label, a post-processing result of the commodity label is obtained.

[0147] In a specific example, for each text recognition result, if a numerical field (including a complete numerical field and a decimal part field) is obtained by matching the text recognition result as a target recognition result in the label information, it is determined that the text recognition result is relevant to the label information; if no numerical field is obtained by matching the text recognition result as a target recognition result in the label information, it is determined that the text recognition result is irrelevant to the label information. After determining at least one remaining recognition result irrelevant to the label information from the plurality of text recognition results, the commodity attribute information in the commodity label is obtained based on the at least one remaining recognition result, and the post-processing result of the commodity label is obtained based on the label information and the commodity attribute information in the commodity label.

[0148] In the case of the commodity label being a commodity price label, the label information can include commodity price information, and the commodity attribute information can include at least one of a commodity name, a capacity specification, and a shelf life. In the case of the commodity label being a commodity code label, the label information can include a commodity code label, and the commodity attribute information can include at least one of a commodity name and a commodity storage location.

[0149] In addition, it should be noted that in the embodiment of the disclosure, in the case of the commodity label being a commodity price label and the label information including commodity price information, the commodity price information can be normalized and corrected commodity price information.

[0150] Through the above steps, in the embodiments of the present disclosure, at least one remaining recognition result irrelevant to the label information can be determined from the plurality of text recognition results, and the commodity attribute information in the commodity label can be obtained based on the at least one remaining recognition result, and the post-processing result of the commodity label can be obtained based on the label information and the commodity attribute information in the commodity label, thereby improving the functionality of the label processing method, so as to provide more abundant and more comprehensive commodity related information for promoting the digital operation of the merchant.

[0151] In some optional embodiments, the step of "obtaining the commodity attribute information in the commodity label based on the at least one remaining recognition result" can include the following steps:

[0152] determining a target remaining result with the longest field length from the at least one remaining recognition result;

[0153] obtaining the commodity name in the commodity label based on the target remaining result;

[0154] obtaining the commodity attribute information in the commodity label based on the commodity name in the commodity label.

[0155] In a specific example, the step of "obtaining the commodity name in the commodity label based on the target remaining result" can include the step of: deleting the redundant field in the target remaining result to obtain the commodity name in the commodity label. For example, the target remaining result can be subjected to semantic analysis, and the character segment irrelevant to the commodity name in the target remaining result can be deleted to obtain the commodity name in the commodity label.

[0156] Please refer to Figure 6 , the commodity label is a commodity price label, and the at least one remaining recognition result includes "AA supermarket", "commodity name: AABBCC beverage", "capacity specification: 500ML / bottle", "shelf life: 6 months", "retail price:" and "Yuan". Among them, the target remaining result with the longest field length is "commodity name: AABBCC beverage", and the character segment irrelevant to the commodity name in the target remaining result is "commodity name:", which can be deleted to obtain the commodity name "AABBCC beverage" in the commodity label, and then the commodity attribute information containing the commodity name "AABBCC beverage" can be obtained.

[0157] Through the above steps, in the embodiments of the present disclosure, the commodity name in the commodity label can be obtained based on only the field length, so as to obtain the commodity attribute information in the commodity label based on the commodity name in the commodity label, thereby reducing the label processing complexity and improving the label processing efficiency.

[0158] In addition, it should be noted that the label processing method provided in the embodiments of the present disclosure can be used to provide post-processing support for a complete label processing product, or can be embedded in the complete label processing product, that is, as the internal logic of the complete label processing product. Based on this, in some optional embodiments, the label processing method can further include identifying a plurality of text line detection regions in the commodity label, obtaining a plurality of text recognition results, and using the plurality of text recognition results to implement a label recognition function, as follows:

[0159] determining a plurality of to-be-processed labels from the label image;

[0160] taking any to-be-processed label in the plurality of to-be-processed labels as a commodity label, and determining a plurality of text line detection regions from the commodity label;

[0161] identifying each text line detection region to obtain a text recognition result of each text line detection region.

[0162] Please refer to Figure 7 In the embodiments of the present disclosure, the plurality of to-be-processed labels can be determined from the label image by using a label detection model. Then, any to-be-processed label in the plurality of to-be-processed labels is taken as a commodity label, and the plurality of text line detection regions are determined from the commodity label by using a text line detection model. Finally, each text line detection region is identified by using an OCR model to obtain a text recognition result of each text line detection region, so as to obtain a plurality of text recognition results corresponding to the commodity label. Thereafter, the plurality of text recognition results can be processed by using a numerical value matching method to obtain label information in the commodity label.

[0163] In the embodiments of the present disclosure, the label detection model, the text line detection model, and the OCR model can be pre-trained neural network models, and the present disclosure will not be repeated here.

[0164] In the embodiments of the present disclosure, before any to-be-processed label in the plurality of to-be-processed labels is taken as a commodity label to determine a plurality of text line detection regions from the commodity label by using a text line detection model, an image preprocessing module can be used to perform image cropping, size change, image fusion, and other image preprocessing operations on each to-be-processed label to improve the image quality of the to-be-processed label.

[0165] Please refer to Figure 8In the embodiment of the present disclosure, before the plurality of text recognition results are processed by the numerical value matching manner to obtain the label information in the product label, the error recognition result in the plurality of text recognition results can also be corrected by the text correction model, for example, "has.5 yuan" is corrected to "0.5 yuan". The text correction model can be a pre-trained neural network model, and the embodiment of the present disclosure does not repeat it. In addition, in the embodiment of the present disclosure, after any one of the plurality of to-be-processed labels is taken as a product label to obtain the label information in the product label by the numerical value matching manner, the product price information in the plurality of label information corresponding to the plurality of to-be-processed labels is obtained, and the plurality of product price information obtained can also be uniformly formatted to have a uniform format. For example, the decimal part of the plurality of label information has the same number of digits.

[0166] Through the above steps, in the embodiment of the present disclosure, the plurality of to-be-processed labels can also be determined from the label image, and any one of the plurality of to-be-processed labels is taken as a product label. The plurality of text line detection regions in the product label are determined, and each text line detection region is identified to obtain the text recognition result of each text line detection region, thereby realizing the label recognition function to improve the functionality of the label processing method. In this way, the label processing method can be a complete label processing product.

[0167] In the following, the complete flow of the label processing method provided by the embodiment of the present disclosure will be described. Figure 9 The complete flow of the label processing method provided by the embodiment of the present disclosure will be described.

[0168] The plurality of text line detection regions in the product label are identified to obtain a plurality of text recognition results. The product label is any one of the plurality of to-be-processed labels, and the plurality of to-be-processed labels are located in the same label image. Each text recognition result corresponds to a text line detection region.

[0169] After obtaining the plurality of text recognition results, any one of the plurality of text recognition results can be taken as a target recognition result, and the target recognition result is matched in the order of preferentially matching the decimal part field, then matching the decimal field, and finally matching the integer field. In the case of successfully matching the decimal part field from the target recognition result, the decimal part field is stored in the to-be-merged array; in the case of successfully matching the decimal field or the integer field from the target recognition result, a complete numerical value field containing the decimal field or the integer field is obtained. Since the target recognition result is any one of the plurality of text recognition results, at least one complete numerical value field will be finally obtained.

[0170] The target detection region corresponding to each complete numerical field is determined from the plurality of text line detection regions, and the numerical region area in the target detection region is determined. Then, the target field with the largest numerical region area is determined from the at least one complete numerical field, and the product price information included in the label information in the product label is obtained based on the target field. The process can include: in the case where the target field is a decimal field, the decimal field is taken as the product price information in the product label; in the case where the target field is an integer field and the to-be-merged array is not empty, the integer field is merged with the decimal part field in the to-be-merged array to obtain the product price information in the product label; and in the case where the target field is an integer field and the to-be-merged array is empty, the integer field is modified in the integer bit to obtain the product price information in the product label.

[0171] Since the product label is any one of the plurality of to-be-processed labels, a plurality of product price information corresponding to the plurality of to-be-processed labels is obtained based on the above steps. Thereafter, the numerical distribution of the plurality of product price information can be counted to obtain a statistical result.

[0172] Based on the statistical result, the to-be-corrected information is determined from the plurality of obtained product price information, and the to-be-corrected information is normalized and corrected to obtain the normalized and corrected product price information. Specifically, first, the integer bit distribution of the plurality of product price information can be determined based on the statistical result, and then the global proportion of the integer bit corresponding to each product price information is determined based on the integer bit distribution, and the product price information with a global proportion of the integer bit less than a preset proportion is determined from the plurality of product price information as the to-be-corrected information. Thereafter, the target integer bit with the largest global proportion of the integer bit can be determined based on the integer bit distribution, and the integer bit of the to-be-corrected information is adjusted according to the target integer bit to obtain the normalized and corrected product price information.

[0173] From the plurality of text recognition results, at least one remaining recognition result unrelated to the product price information in the label information is determined, and based on the at least one remaining recognition result, the product attribute information in the product label is obtained, and based on the label information and the product attribute information in the product label, the post-processing result of the product label is obtained. In the case where the product label is a product price label and the label information includes the product price information, the product price information can be the normalized and corrected product price information.

[0174] Please refer to Figure 10 An application scenario diagram of a label processing method provided by the embodiments of the present disclosure.

[0175] As described above, the label processing method provided by the embodiments of the present disclosure is applied to an electronic device. The electronic device is intended to represent various forms of digital computers, such as servers, blade servers, workstations, mainframes, desktops, laptops, or other suitable computers.

[0176] In the embodiments of the present disclosure, the electronic device can be used to execute the label processing method.

[0177] The multiple text recognition results obtained by identifying the multiple text line detection regions in the product label, each text recognition result corresponding to a text line detection region;

[0178] The multiple text recognition results are processed by a numerical matching method to obtain label information in the product label.

[0179] It should be noted that in the embodiments of the present disclosure, the multiple text recognition results obtained by identifying the multiple text line detection regions in the product label can be obtained from a third-party device by the electronic device, or can be generated by the electronic device itself, and the embodiments of the present disclosure do not make specific limitations.

[0180] In addition, it should also be noted that in the embodiments of the present disclosure, Figure 10 The scene diagram shown is only illustrative and not restrictive, and those skilled in the art can make various obvious changes and / or replacements based on the examples Figure 10 The technical solutions obtained still belong to the disclosure range of the embodiments of the present disclosure.

[0181] In order to better implement the above label processing method, the embodiments of the present disclosure also provide a label processing apparatus 1100, which can be integrated in an electronic device. Hereinafter, a label processing apparatus 1100 provided by the embodiments of the present disclosure will be described in conjunction with the structure diagram shown. Figure 11 The structure diagram shown is only illustrative and not restrictive, and those skilled in the art can make various obvious changes and / or replacements based on the examples

[0182] The label processing apparatus 1100 comprises:

[0183] The recognition result obtaining unit 1101 is configured to obtain multiple text recognition results obtained by identifying multiple text line detection regions in the product label, each text recognition result corresponding to a text line detection region;

[0184] The recognition result processing unit 1102 is configured to process the multiple text recognition results by a numerical matching method to obtain label information in the product label.

[0185] In some optional embodiments, the recognition result processing unit 1102 is configured to:

[0186] The target recognition result is matched by a numerical matching manner to obtain a numerical matching result, the target recognition result being any one of the plurality of text recognition results;

[0187] In a case where the numerical matching result represents that the target recognition result contains a complete numerical field, the complete numerical field is obtained;

[0188] Based on the obtained at least one complete numerical field, label information in the product label is obtained.

[0189] In some optional embodiments, the numerical matching manner includes a decimal matching manner and an integer matching manner, and the recognition result processing unit 1102 is configured to:

[0190] The target recognition result is matched by the decimal matching manner;

[0191] In a case where a decimal field is successfully matched from the target recognition result by the decimal matching manner, a numerical matching result representing that the target recognition result contains a complete numerical field and the complete numerical field is a decimal field is obtained;

[0192] In a case where a decimal field is not successfully matched from the target recognition result by the decimal matching manner, the target recognition result is matched by the integer matching manner;

[0193] In a case where an integer field is successfully matched from the target recognition result by the integer matching manner, a numerical matching result representing that the target recognition result contains a complete numerical field and the complete numerical field is an integer field is obtained.

[0194] In some optional embodiments, the recognition result processing unit 1102 is configured to:

[0195] A first regular expression for matching a decimal numerical value is obtained;

[0196] The target recognition result is matched by the first regular expression.

[0197] In some optional embodiments, the recognition result processing unit 1102 is configured to:

[0198] A second regular expression for matching an integer numerical value is obtained;

[0199] The target recognition result is matched by the second regular expression.

[0200] In some optional embodiments, the numerical matching manner further includes a decimal part matching manner, and the recognition result processing unit 1102 is configured to:

[0201] The target recognition result is matched by the decimal part matching manner;

[0202] In the case that the decimal part field is successfully matched from the target recognition result by the decimal part matching manner, the decimal part field is stored in the to-be-merged array;

[0203] In the case that the decimal part field is not successfully matched from the target recognition result by the decimal part matching manner, the step of matching the target recognition result by the decimal matching manner is performed.

[0204] In some optional embodiments, the recognition result processing unit 1102 is configured to:

[0205] In the case that the target recognition result contains a numerical field starting with a decimal point, a third regular expression for matching integer type numbers is obtained;

[0206] The remaining field after the decimal point in the target recognition result is matched by the third regular expression.

[0207] In some optional embodiments, the label information includes product price information, and the recognition result processing unit 1102 is configured to:

[0208] The target detection area corresponding to each complete numerical field and the numerical area of the target detection area are determined from a plurality of text line detection areas;

[0209] The target field corresponding to the largest numerical area is determined from at least one complete numerical field;

[0210] Based on the target field, the product price information in the product label is obtained.

[0211] In some optional embodiments, the recognition result processing unit 1102 is configured to:

[0212] In the case that the target field is a decimal field, the decimal field is taken as the product price information in the product label;

[0213] In the case that the target field is an integer field and the to-be-merged array is not empty, the integer field is merged with the decimal part field in the to-be-merged array to obtain the product price information in the product label;

[0214] In the case that the target field is an integer field and the to-be-merged array is empty, the integer field is corrected by integer bits to obtain the product price information in the product label.

[0215] In some optional embodiments, the recognition result processing unit 1102 is configured to:

[0216] The character bit number of the integer field is obtained;

[0217] The correction ratio is determined according to the character bit number.

[0218] The quotient of the integer field and the correction ratio is calculated as the product price information in the product label.

[0219] In some optional embodiments, the label information includes product price information, and the label processing apparatus 1100 further includes a normalization correction unit configured to:

[0220] For any one of the plurality of to-be-processed labels as a product label, the product price information in the plurality of label information obtained is subjected to numerical distribution statistics to obtain a statistical result, and the plurality of to-be-processed labels are located in the same label image, and each label information corresponds to one to-be-processed label.

[0221] Based on the statistical result, the to-be-corrected information is determined from the plurality of product price information obtained;

[0222] The to-be-corrected information is subjected to normalization correction to obtain the product price information subjected to normalization correction.

[0223] In some optional embodiments, the normalization correction unit is configured to:

[0224] Based on the statistical result, the integer bit distribution of the plurality of product price information is determined;

[0225] Based on the integer bit distribution, the global proportion of the integer bits corresponding to each product price information is determined;

[0226] The product price information corresponding to the global proportion of the integer bits less than a preset proportion is determined from the plurality of product price information as the to-be-corrected information.

[0227] In some optional embodiments, the normalization correction unit is configured to:

[0228] Based on the integer bit distribution, the target integer bit with the largest global proportion of integer bits is determined;

[0229] According to the target integer bit, the integer bits of the to-be-corrected information are adjusted to obtain the product price information subjected to normalization correction.

[0230] In some optional embodiments, the label processing apparatus 1100 further includes a text recognition unit configured to:

[0231] The plurality of to-be-processed labels are determined from the label image;

[0232] Any one of the plurality of to-be-processed labels is taken as a product label, and a plurality of text line detection regions are determined from the product label;

[0233] Each text line detection region is subjected to recognition to obtain a text recognition result of each text line detection region.

[0234] In some optional embodiments, the label processing apparatus 1100 further comprises a post-processing result obtaining unit, configured to:

[0235] from the plurality of text recognition results, determine at least one remaining recognition result irrelevant to the label information;

[0236] based on the at least one remaining recognition result, obtain the product attribute information in the product label;

[0237] based on the label information and the product attribute information in the product label, obtain the post-processing result of the product label.

[0238] In some optional embodiments, the post-processing result obtaining unit is configured to:

[0239] from the at least one remaining recognition result, determine a target remaining result with the longest field length;

[0240] based on the target remaining result, obtain the product name in the product label;

[0241] based on the product name in the product label, obtain the product attribute information in the product label.

[0242] In implementation, each of the above modules can be implemented as an independent entity, or can be combined as the same or several entities, and the specific implementation of each of the above modules can be referred to the label processing method embodiments described above, which will not be repeated here.

[0243] The label processing apparatus provided by the embodiments of the present disclosure can obtain a plurality of text recognition results by detecting and recognizing a plurality of text lines in a product label. The plurality of text recognition results are processed by a numerical matching method to obtain label information in the product label. The numerical matching method can focus on numerical fields and is not affected by label formats. Therefore, for any two labels to be processed with different label formats but the same text content, the same label information can be obtained by processing the corresponding plurality of text recognition results of the two labels as product labels by the numerical matching method. This can effectively cope with the diversified distribution of label formats in actual business scenarios, thereby improving the usability of the label processing method.

[0244] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0245] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a storage medium and a computer program product.

[0246] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown.

[0247] As described previously, an electronic device is intended to represent a wide variety of digital computers such as, for example, laptops, desktops, workstations, personal digital processors, servers, blade servers, mainframes, and other appropriate computers. An electronic device can also represent a wide variety of mobile devices such as, for example, personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0248] As Figure 12 shown, the electronic device 1200 includes a computing unit 1201 that can perform various appropriate actions and processes in accordance with a computer program stored in a Read-Only Memory (ROM) 1202 or a computer program loaded into a Random Access Memory (RAM) 1203 from a storage unit 1208. Various programs and data required for operation of the electronic device 1200 can also be stored in the RAM 1203. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other through a bus 1204. An Input / Output (I / O) interface 1205 is also connected to the bus 1204.

[0249] Various components in the electronic device 1200 are connected to the I / O interface 1205, including an input unit 1206, such as a keyboard, a mouse, etc., an output unit 1207, such as various types of displays, a speaker, etc., a storage unit 1208, such as a magnetic disk, an optical disk, etc., and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the electronic device 1200 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0250] The computing unit 1201 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Process (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs various methods and processes described above, e.g., the label processing method. For example, the label processing method can be implemented as a computer software program in some alternative embodiments, which is tangibly embodied in a non-transitory computer-readable storage medium, e.g., the storage unit 1208. In some alternative embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded onto the RAM 1203 and executed by the computing unit 1201, one or more steps of the label processing method described above can be performed. Alternatively, in other embodiments, the computing unit 1201 can be configured to perform the label processing method by any other suitable means, e.g., by means of firmware.

[0251] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a System on Chip (SOC), a Complex Programmable Logic Device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0252] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0253] In the context of the present disclosure, a non-transitory computer-readable storage medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The non-transitory computer-readable storage medium can be a machine-readable signal medium or a machine-readable storage medium. The non-transitory computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a non-transitory computer-readable storage medium can include, but are not limited to, an electrical connection based on one or more wires, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0254] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a Cathode Ray Tube (CRT) monitor or a Liquid Crystal Display (LCD)) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0255] The systems and techniques described herein can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described herein, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0256] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0257] The disclosure embodiments also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the label processing method.

[0258] The disclosure embodiments also provide a computer program product comprising a computer program which, when executed by a processor, implements the label processing method.

[0259] The electronic device, storage medium and computer program product provided by the disclosure embodiments can obtain multiple text recognition results by recognizing multiple text line detection regions in a product label. The multiple text recognition results are processed by a numerical value matching method to obtain label information in the product label. The numerical value matching method can focus on numerical value fields and is not affected by label formats. Therefore, for any two to-be-processed labels with different label formats but consistent text content, the same label information can be obtained when the labels are respectively taken as product labels and the corresponding multiple text recognition results are processed by the numerical value matching method. This can effectively cope with the diversified label format distribution in actual business scenarios, thereby improving the usability of the label processing method.

[0260] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technology disclosed in the present disclosure can be achieved, which is not limited herein. In addition, in the present disclosure, relationship terms such as "first", "second", "third" and the like are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Furthermore, in the present disclosure, "a plurality of" can be understood as at least two.

[0261] The foregoing detailed description does not constitute a limitation of the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A label processing method, comprising: Multiple text line detection regions in a product label are identified, resulting in multiple text recognition results, each corresponding to one of the text line detection regions. The multiple text recognition results are processed by numerical matching to obtain the tag information in the product label; The label information includes product price information, and the method further includes: The numerical distribution statistics of product price information in multiple tag information obtained by taking any one of the multiple unprocessed tags as the product tag are statistically analyzed to obtain statistical results; wherein, the multiple unprocessed tags are located in the same tag image, and each tag information corresponds to one unprocessed tag; Based on the statistical results, the distribution of integer digits of multiple commodity price information is determined; based on the distribution of integer digits, information to be corrected is determined from the acquired multiple commodity price information. The information to be corrected is normalized to obtain the normalized commodity price information.

2. The method according to claim 1, wherein, The step of processing the multiple text recognition results through numerical matching to obtain the tag information in the product tag includes: The target recognition result is matched by the numerical matching method to obtain a numerical matching result, wherein the target recognition result is any one of the multiple text recognition results; If the numerical matching result indicates that the target recognition result contains a complete numerical field, then the complete numerical field is obtained; Based on at least one complete numerical field obtained, the label information in the product label is obtained.

3. The method according to claim 2, wherein, The numerical matching method includes a decimal matching method and an integer matching method. The step of matching the target recognition result using the numerical matching method to obtain the numerical matching result includes: The target recognition result is matched using the decimal matching method. If a small number segment is successfully matched from the target recognition result using the decimal matching method, a numerical matching result is obtained to characterize that the target recognition result contains a complete numerical field and that the complete numerical field is the small number segment. If no decimal segment is successfully matched from the target recognition result using the decimal matching method, the target recognition result is matched using the integer matching method. If an integer field is successfully matched from the target recognition result using the integer matching method, a numerical matching result is obtained to characterize that the target recognition result contains a complete numerical field and that the complete numerical field is the integer field.

4. The method according to claim 3, wherein, The matching of the target recognition result using the decimal matching method includes: Get the first regular expression used to match decimal numbers; The target recognition result is matched using the first regular expression.

5. The method according to claim 3, wherein, The matching of the target recognition result using the integer matching method includes: Get the second regular expression used to match integer values; The target recognition result is matched using the second regular expression.

6. The method according to claim 3, wherein, The numerical matching method further includes a fractional part matching method. The step of matching the target recognition result using the numerical matching method to obtain the numerical matching result further includes: The target recognition result is matched using the fractional part matching method. If a fractional part field is successfully matched from the target recognition result using the fractional part matching method, the fractional part field is stored in the array to be merged. If the decimal part field is not successfully matched from the target recognition result using the decimal part matching method, the step of matching the target recognition result using the decimal part matching method is performed.

7. The method according to claim 6, wherein, The matching of the target recognition result using the fractional part matching method includes: If the target recognition result contains a numeric field whose starting character is a decimal point, obtain a third regular expression for matching integer numeric values; The third regular expression is used to match the remaining fields after the decimal point in the target recognition result.

8. The method according to claim 6, wherein, The label information includes product price information. Obtaining the label information from the product label based on at least one complete numerical field includes: Determine the target detection region corresponding to each complete numerical field from the plurality of text line detection regions, and the area of ​​the numerical region in the target detection region; From the at least one complete numerical field, determine the target field with the largest corresponding numerical region area; Based on the target field, obtain the product price information from the product label.

9. The method according to claim 8, wherein, The step of obtaining the product price information from the product tag based on the target field includes: When the target field is the small number segment, the small number segment is used as the product price information in the product label; If the target field is the integer field and the array to be merged is not empty, the integer field is merged with the decimal part field in the array to be merged to obtain the product price information in the product label; If the target field is the integer field and the array to be merged is empty, the integer field is corrected for integer positions to obtain the product price information in the product label.

10. The method according to claim 9, wherein, The step of correcting the integer field to obtain the product price information in the product label includes: Get the number of characters in the integer field; Determine the correction ratio based on the number of character bits; The quotient of the integer field and the correction ratio is calculated and used as the product price information in the product label.

11. The method according to any one of claims 1 to 10, wherein, The step of determining the information to be corrected from the multiple product price information obtained based on the integer digit distribution includes: Based on the distribution of integer digits, determine the global proportion of integer digits corresponding to each commodity price information; The product price information whose global percentage of integer digits is less than a preset percentage is determined from the multiple product price information and used as the information to be corrected.

12. The method according to claim 11, wherein, The step of normalizing the information to be corrected to obtain normalized commodity price information includes: Based on the distribution of integer digits, determine the target integer digits with the largest global proportion; Based on the target integer number of digits, the integer number of digits of the information to be corrected is adjusted to obtain the normalized corrected commodity price information.

13. The method according to claim 1, further comprising: The plurality of labels to be processed are determined from the label image; Take any one of the multiple unprocessed tags as the product tag, and determine multiple text line detection areas from the product tag; Each of the text line detection regions is identified to obtain the text recognition result for each of the text line detection regions.

14. The method according to claim 1, further comprising: From the multiple text recognition results, determine at least one remaining recognition result that is unrelated to the tag information; Based on the at least one remaining identification result, the product attribute information in the product label is obtained; Based on the label information and product attribute information in the product label, the post-processing result of the product label is obtained.

15. The method according to claim 14, wherein, The step of obtaining product attribute information from the product label based on the at least one remaining identification result includes: From the at least one remaining identification result, determine the target remaining result with the longest field length; Based on the remaining results of the target, obtain the product name in the product label; Based on the product name in the product label, obtain the product attribute information in the product label.

16. A label processing apparatus, comprising: The recognition result acquisition unit is used to acquire multiple text line detection regions in the product label and obtain multiple text recognition results, each of which corresponds to one of the text line detection regions. The recognition result processing unit is used to process the multiple text recognition results through numerical matching to obtain the label information in the product label; The label information includes product price information, and the device further includes a normalization correction unit for: The numerical distribution statistics of product price information in multiple tag information obtained by taking any one of the multiple unprocessed tags as the product tag are statistically analyzed to obtain statistical results; wherein, the multiple unprocessed tags are located in the same tag image, and each tag information corresponds to one unprocessed tag; Based on the statistical results, the distribution of integer digits of multiple commodity price information is determined; based on the distribution of integer digits, information to be corrected is determined from the acquired multiple commodity price information. The information to be corrected is normalized to obtain the normalized commodity price information.

17. The apparatus according to claim 16, wherein, The recognition result processing unit is used for: The target recognition result is matched by the numerical matching method to obtain a numerical matching result, wherein the target recognition result is any one of the multiple text recognition results; If the numerical matching result indicates that the target recognition result contains a complete numerical field, then the complete numerical field is obtained; Based on at least one complete numerical field obtained, the label information in the product label is obtained.

18. The apparatus according to claim 17, wherein, The numerical matching method includes decimal matching and integer matching, and the recognition result processing unit is used for: The target recognition result is matched using the decimal matching method. If a small number segment is successfully matched from the target recognition result using the decimal matching method, a numerical matching result is obtained to characterize that the target recognition result contains a complete numerical field and that the complete numerical field is the small number segment. If no decimal segment is successfully matched from the target recognition result using the decimal matching method, the target recognition result is matched using the integer matching method. If an integer field is successfully matched from the target recognition result using the integer matching method, a numerical matching result is obtained to characterize that the target recognition result contains a complete numerical field and that the complete numerical field is the integer field.

19. The apparatus according to claim 18, wherein, The numerical matching method also includes a fractional part matching method, and the recognition result processing unit is used for: The target recognition result is matched using the fractional part matching method. If a fractional part field is successfully matched from the target recognition result using the fractional part matching method, the fractional part field is stored in the array to be merged. If the decimal part field is not successfully matched from the target recognition result using the decimal part matching method, the step of matching the target recognition result using the decimal part matching method is performed.

20. An electronic device, comprising: At least one processor; A memory that is communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 15.

21. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 15.

22. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Commodity information processing method and device, electronic equipment and storage medium

    CN113822692A

  • Universal commodity price tag image recognition method and processing equipment

    CN115063814A