Plaque information acquisition method and device
By using optical character recognition technology to classify and merge nameplate information into text boxes, the problems of large differences in nameplate formats and high computing resources were solved, enabling efficient and accurate nameplate information collection on mobile terminals.
Patent Information
- Application Number
- CN202411854000.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2026-06-23
Smart Images

Figure CN122266013A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a method and apparatus for acquiring nameplate information. Background Technology
[0002] With the continuous development of mobile internet technology, more and more production and operational activities are closely coupled with online data. For a large number of electromechanical equipment, the operating system needs to collect and store relevant information about these devices. In order to effectively collect nameplate information of a large number of electromechanical equipment, it is usually necessary to manually collect nameplate images, and then manually or by relying on optical character recognition (OCR) algorithms to identify the content of the nameplate images and save them as the corresponding attributes of electromechanical equipment for the operation system to manage.
[0003] However, the format of nameplates varies significantly between different manufacturers and batches. Furthermore, the content of the nameplates is structured text, leading to numerous errors in traditional OCR algorithms, requiring manual review to reduce the error rate. On the other hand, algorithms based on deep learning models, which offer higher accuracy, require substantial computing resources, making them difficult to run on mobile devices and hindering convenient data collection and review by on-site personnel. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method and apparatus for collecting nameplate information, which aims to accurately identify the content of nameplate images and collect nameplate information in nameplate information collection scenarios without significantly increasing computational complexity and required computing resources, thus facilitating offline staff to collect and review nameplate information.
[0005] Firstly, a method for collecting nameplate information is provided, wherein the method includes:
[0006] Obtain the nameplate image;
[0007] Optical character recognition is performed on the nameplate image to determine the recognition information, which includes the position information of multiple text boxes and the text information of the text boxes.
[0008] Determine the category of text information in each text box, thereby classifying each text box into a unit information text box, an attribute value text box, or an attribute name text box;
[0009] For each unit information text box, merge it with the nearest attribute value text box to determine the new attribute value text box;
[0010] For each attribute value text box, retrieve the attribute name text box to which it belongs;
[0011] The key-value pairs for the nameplate information are determined based on the text information in each attribute name text box and the corresponding attribute value text box.
[0012] Secondly, a nameplate information collection device is provided, wherein the device includes:
[0013] The image acquisition unit is used to acquire the nameplate image;
[0014] The recognition unit is used to perform optical character recognition on the nameplate image and determine the recognition information, which includes the position information of multiple text boxes and the text information of the text boxes.
[0015] The classification unit is used to determine the category of the text information in each text box, thereby dividing each text box into a unit information text box, an attribute value text box, or an attribute name text box.
[0016] The text box merging unit is used to merge each unit information text box with the nearest attribute value text box to determine a new attribute value text box.
[0017] The relation extraction unit is used to retrieve the attribute name text box to which each attribute value text box belongs;
[0018] The output unit determines the key-value pairs of the nameplate information based on the text information in each attribute name text box and the corresponding attribute value text box.
[0019] Thirdly, an electronic device is provided, the controller including a memory and a processor, the memory for storing one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in the first aspect.
[0020] Fourthly, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the method described in the first aspect.
[0021] The method and apparatus of this invention, based on the characteristic that nameplate information is typically represented as key-value pairs of attribute names and attribute values, employs optical character recognition (OCR) to extract text boxes from the nameplate image, resulting in multiple distinct text boxes clustered in different areas of the image. These text boxes are then categorized to determine their class, and the unit information text box is merged with the nearest attribute value text box. This process identifies all attribute value and attribute name text boxes. Furthermore, the attribute value and attribute name text boxes are matched based on their positional information to extract the corresponding relationships. After matching, the corresponding text information is extracted to form key-value pairs of the nameplate information. Therefore, without requiring complex recognition models or significantly increasing computational complexity, nameplate information can be accurately identified, facilitating automated information collection by offline staff. Attached Figure Description
[0022] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:
[0023] Figure 1 This is a flowchart of the nameplate information collection method according to an embodiment of the present invention;
[0024] Figure 2 This is a data flow diagram of the text box matching process in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram illustrating the arrangement of nameplate text in an example of an embodiment of the present invention;
[0026] Figure 4 This is a flowchart illustrating the merging of unit information text boxes according to an embodiment of the present invention;
[0027] Figure 5 This is a flowchart of an embodiment of the present invention to obtain the attribute name text box to which the attribute value text box belongs;
[0028] Figure 6 This is a flowchart illustrating another implementation method of the attribute name text box to which the attribute value text box belongs, according to an embodiment of the present invention.
[0029] Figure 7 This is a flowchart illustrating the process of determining key-value pairs according to an embodiment of the present invention;
[0030] Figure 8 This is a flowchart illustrating another implementation method for determining key-value pairs in an embodiment of the present invention;
[0031] Figure 9 This is a schematic diagram of the nameplate information collection device according to an embodiment of the present invention;
[0032] Figure 10 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0033] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0034] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0035] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0036] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0037] The solutions described in this specification and embodiments, if involving the processing of personal information, will be processed only under the premise of having a legal basis (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract), and will only be processed within the scope stipulated or agreed upon. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.
[0038] A nameplate is an information plaque used to identify products or equipment, typically made of materials such as metal or plastic. Its surface is engraved or printed with text, images, and other information to indicate the name, model, specifications, manufacturer, contact information, and other important details, allowing users to identify and understand its basic information.
[0039] During the process of collecting nameplate information, significant differences arise due to variations in shooting angles, manufacturers, and production batches. Specifically, the characteristics of these nameplate images include: relatively simple backgrounds, text information arranged in a table-like format, and inconsistent spacing between attribute names and values. Furthermore, due to differences in personnel and site conditions, images captured by mobile devices are prone to tilting, resulting in varying distortion angles for the text. Additionally, different nameplate information formats lead to variations in the way the same attribute names are expressed. For example, for "output current," some nameplates might label it as "rated / maximum output current," while others might label it as "total output current." The arrangement may also differ, with some attribute names displayed in two lines while others are displayed in a single line. These variations make accurate identification and acquisition of nameplate information from the images difficult.
[0040] To improve recognition accuracy, both correcting for text region deformation and employing larger-scale deep learning models significantly increase computational resource requirements. This invention combines post-device matching with known knowledge to categorize text boxes obtained from optical character recognition into attribute values, unit information, or attribute names. Then, it performs two-step matching based on location: attribute value and unit, and attribute value and attribute name. This improves recognition accuracy without drastically increasing computational resources.
[0041] Figure 1 This is a flowchart of the nameplate information collection method according to an embodiment of the present invention. Figure 1 As shown, the nameplate information collection method in this embodiment includes the following steps:
[0042] Step S100: Obtain the nameplate image.
[0043] Specifically, the nameplate image can be obtained by offline staff using mobile devices such as smartphones.
[0044] Step S200: Perform optical character recognition on the nameplate image to determine the recognition information. The recognition information includes the position information of multiple recognized text boxes and the text information of the text boxes.
[0045] In this embodiment, optical character recognition (OCR) can include several steps such as preprocessing, character segmentation, feature extraction, pattern matching or classification, and post-processing. First, in the preprocessing stage, the algorithm performs operations such as grayscale conversion and binarization on the input image to reduce noise and enhance the contrast between text and background, thereby improving the accuracy of subsequent processing. Next is the character segmentation stage, which separates the text regions in the image using methods such as connected component analysis and projection, and further subdivides them into individual characters. Then comes the feature extraction stage, where feature vectors representing the shape, structure, and other information of each character are extracted to prepare for subsequent recognition. Next is pattern matching or classification, where a pre-trained model is used to compare the extracted feature vectors to determine the most likely corresponding character. It should be understood that OCR can be implemented using existing OCR algorithms with computational resource requirements adapted to the application scenario.
[0046] In this embodiment, the recognition information obtained after optical character recognition includes the position information of a text box containing multiple characters and the text information of the text box. The position information can be the coordinates of the four vertices of the text box, the coordinates of the center point of the text box, and the size of the text box. Optionally, the recognition information may also include the confidence level of the text information, that is, the probability that the image corresponding to the text box contains the aforementioned text information. Subsequently, the confidence level can be used to further improve the recognition success rate.
[0047] Step S300: Determine the categories of the text information in each text box, so as to classify each text box into a unit information text box, an attribute value text box or an attribute name text box. That is to say, the categories for classification include unit information, attribute value or attribute name.
[0048] In this embodiment, the text information is divided into unit information, attribute value and attribute name. Among them, unit information refers to text information that is a numerical unit, such as "V", "A", "volt" or "ampere". The attribute value is a numerical or text information with or without a unit as the nameplate data value. For example, "220", "220V", "May 1, 2023", etc. The attribute name, which can also be called key information, is text information used to characterize the meaning of the attribute value, such as "output current", "output voltage", etc. After classifying the text information, it can be determined that the text box to which the text information belongs is one of the unit information text box, the attribute value text box or the attribute name text box. Subsequently, further processing is performed according to the classification of the text box.
[0049] It should be understood that in the nameplate information, for example, the attribute values of attributes such as date and phone number that have nothing to do with the device performance do not have units. The nameplate acquisition method of this embodiment does not require that all attribute values have units, but can flexibly handle different situations according to the recognition results.
[0050] In step S300, different types of methods can be used to classify the text information.
[0051] In some optional implementation manners, the text information can be classified by using the template matching method. Specifically, a text template library for text information of the three categories of unit information, attribute value and attribute name is established in advance. When classifying, the text information of the text box is matched with a predetermined text template, and the category of the text information is determined according to the matching degree, and then the category of the text box is determined. The template library can be a regular expression library corresponding to each category, that is, a plurality of possible corresponding regular expressions preset in advance according to the characteristics of each category. For example, for the text information of the attribute name category, it usually includes Chinese characters, slash symbols or English letters, and will carry some specific characters, such as "pressure", "flow", "output", "rated", "date", etc. For the attribute value, except for the attribute values of the date type, it does not contain Chinese characters and mainly includes numbers or English characters. The unit information is even simpler. In a specific scenario, it only involves several determined sets of English characters and Chinese characters. According to different situations, corresponding regular expressions are designed for the three different categories of information respectively as text templates to be matched with the text information of the text box, so as to use the category of the matched regular expression as the category of the text information.
[0052] Regular expressions are tools for describing text patterns and matching text that conforms to a given pattern. They consist of ordinary characters (e.g., letters a through z) and special characters (called "metacharacters"). Ordinary characters represent themselves, while metacharacters have specific meanings. Regular expressions allow you to match text information according to different patterns, thus classifying the text according to predefined categories corresponding to the regular expressions.
[0053] Furthermore, several subcategories can be set under the three categories of unit information, attribute value, and attribute name. These subcategories can further distinguish the content expressed by the corresponding text boxes from the perspective of entity category. For example, "output voltage" is the name of the voltage category in the attribute name category, while "220V" is the attribute value of the voltage category in the attribute value category. When using regular expressions as text templates, since a regular expression can usually only cover text information with a relatively fixed pattern, the regular expression can be subdivided into categories to obtain the categories of the text boxes in different dimensions. It should be understood that since the presentation classification and entity category are two unrelated dimensions, the above classification operation can also be performed completely independently to obtain the categories of the text boxes in two dimensions through two classifications.
[0054] Typically, a large number of text templates are pre-set to ensure that each text message can be effectively matched to its category.
[0055] In some implementations, the recognition information may also include the confidence level of the text information. If text template matching fails to determine the category of the text information in the target text box, and the confidence level is below a predetermined threshold, it indicates that the optical character recognition result is likely to be incorrect. Therefore, optical character recognition is performed again on the image corresponding to the target text box. Optionally, the optical character recognition performed again can use a different algorithm than the one used previously. Thus, when the text information of the text box obtained by the first optical character recognition algorithm cannot be effectively classified through text template matching, using a different optical character recognition algorithm and then reclassifying it can improve the classification success rate and further improve the accuracy of the output information.
[0056] In other implementations, machine learning models can be used to classify text information. A lightweight text classification model can be pre-trained to categorize text information into different classes. Then, by inputting the text information into the text classification model, the corresponding class can be determined. Using a text classification model increases the computational resource requirements, but it can improve the accuracy and success rate of classification.
[0057] After classifying the text boxes, we can merge and match them based on the characteristics of the nameplate information to determine the attribute names (keys) and attribute values that match in the nameplate image, and output them as key-value pairs.
[0058] Figure 2 This is a schematic diagram illustrating the data flow for text box matching in an embodiment of the present invention. For example... Figure 2 As shown, based on the corresponding unit information template 24, attribute value template 25, and attribute name template 26, text box 21 is identified as the unit information text box, text box 22 as the attribute value text box, and text box 23 as the attribute name text box. First, the unit information text box 21 is merged into the corresponding attribute value text box 22. The reason for merging the unit information text boxes is that, through practice, it has been found that in some nameplate information, the unit information is set separately from the preceding numerical value, and during optical character recognition, it will be recognized as two separate text boxes.
[0059] exist Figure 2 The example text template is provided. The unit information template 24 can include the regular expressions "A" and "V" for specific units. The attribute value template 25 can include the corresponding regular expressions "%d" and "%dV-%dV". The attribute name template 26 can include the corresponding regular expressions "*output*pressure" and "rated output".
[0060] After all the unit information has been merged, the processed text boxes are reduced to attribute value text box 22 (including the new attribute value text box formed by the merging operation) and attribute name text box 23. At this point, by matching the position of the attribute value text box to the text box belonging to the attribute name category, the nameplate information can be extracted, obtaining at least one key-value pair corresponding to the attribute name and attribute value in the nameplate information. The reason for traversing attribute value text box 22 instead of attribute name text box 23 is that some text information in the nameplate image is not an attribute name, such as the nameplate title or name, while the attribute value category information is necessarily accompanied by an attribute name. Therefore, traversing attribute value text box 22 can effectively filter out the aforementioned unnecessary information.
[0061] Return to reference Figure 1 In step S400, for each unit information text box, it is merged with the nearest attribute value text box to determine a new attribute value text box.
[0062] Figure 3 This diagram illustrates the arrangement of text on a nameplate. Figure 3 The dashed box in the image represents a text box obtained through optical character recognition. According to... Figure 3As shown in the example, the text arrangement in the nameplate exhibits a tabular format, with the unit of the attribute value closest to the preceding number, and the attribute value closest to its corresponding attribute name. For example, in Figure 3 In the text box, the text box 31 containing the unit "V" is closest to the preceding text box 32 containing the attribute value "220". Because there is a certain distance between them, they are recognized as two different text boxes during optical character recognition. Simultaneously, the attribute value text box 33, obtained by merging the text box containing the unit "V" and the text box containing the attribute value "220", is closest to the text box 34 containing the attribute name "Rated Output Voltage".
[0063] Based on the above features, the unit information text box and the attribute value text box can be merged based on position matching.
[0064] In step S400, each unit information text box obtained from the classification can be traversed. For each unit information text box, it is merged into the nearest attribute value text box based on distance, thereby completing the merging operation. It should be understood that the distance in steps S400 and S500 refers to the distance between the positions of the text boxes, which can be represented in different ways. For example, it can be the distance between the center points of the text boxes. In some optional implementations, the distance can also be a function of the distance between several key points of the text boxes. For example, the average of the distances (16 distance values) between the four vertices of text box A and the four vertices of text box B.
[0065] In one optional implementation, such as Figure 4 As shown, step S400 includes:
[0066] Step S410: Determine the current target unit information text box.
[0067] Step S420: Determine the distance between the target unit information text box and all attribute value text boxes.
[0068] Step S430: Merge the target unit information text box with the attribute value text box with the smallest distance into a new attribute value text box.
[0069] The merge operation can include merging the text information of the text boxes and calculating a minimum rectangle that includes both text boxes as the position information of the new text box based on the position information of the two text boxes.
[0070] After step S430 is completed, you can return to step S410 to proceed to the next iteration.
[0071] Return to reference Figure 1In step S500, for each attribute value text box, the nearest attribute name text box is obtained.
[0072] In this step, the attribute name text box to which each attribute value text box belongs is searched based on distance. Specifically, as shown... Figure 5 As shown, step S500 may include:
[0073] Step S510: Determine the current target attribute value text box.
[0074] Step S520: Determine the distance between the target attribute value text box and all attribute name text boxes.
[0075] Step S530: The attribute name text box with the smallest distance is determined as the attribute name text box corresponding to the target attribute value text box.
[0076] Therefore, the attribute name text box to which each attribute value text box belongs can be determined. After step S530 is completed, the process can return to step S510 to execute the next iteration. This establishes a correspondence between each attribute value text box and its corresponding attribute name text box.
[0077] In some optional implementations, the identification of entity categories for attribute values and attribute names can be added, and entity category constraints can be incorporated when searching for the attribute name text box to which the attribute value text box belongs. This can further improve the accuracy of identification. The entity category is the category to which the physical concept corresponding to the attribute value or attribute name belongs. For example, the entity category for the attribute value "220V" and the attribute names "Rated Input Voltage" or "Maximum Output Voltage" is "Voltage" or "Electrical Parameter". The entity category for the attribute name "Production Date" and the attribute value "January 1, 2021" is "Date". By pre-classifying entity categories, errors that may occur when matching attribute value text boxes and attribute name text boxes solely based on distance can be avoided.
[0078] Specifically, such as Figure 6 As shown, in this implementation, step S500 may include:
[0079] Step S510': Determine the current target attribute value text box.
[0080] Step S520': Determine the entity category of the text information in the target attribute value text box.
[0081] Step S530': Determine at least one similar attribute name text box that matches the entity category with the attribute value text box.
[0082] The entity category of the text information in the attribute value text box and the attribute name text box can be determined in different ways and at different times. For example, the entity category can be determined by regular expression matching based on the merged unit information or the unit information inherent in the attribute value, and the entity category of the attribute name text box can also be identified using the corresponding regular expression. Alternatively, a machine learning model can be used to classify and identify the entity category. Furthermore, the operation of obtaining the entity category can be performed simultaneously in step S300 when determining the category of the text information in each box, based on the entity type corresponding to the matched regular expression. Alternatively, the entity category of each text box can be reclassified in step S500.
[0083] Step S540': Determine the distance between the target attribute value text box and all similar attribute name text boxes.
[0084] Step S550': Determine the text box with the smallest distance of the same type of attribute name as the attribute name text box to which the target attribute value text box belongs.
[0085] After step S550' is completed, you can return to step S510' to execute the next round of iterations.
[0086] Therefore, by adding a constraint on matching entity categories before calculating distance, the accuracy of nameplate information collection is increased. Furthermore, if classification is achieved using regular expressions that simultaneously include category information from both dimensions, no additional classification calculations are needed. This reduces computational complexity in this step, further improving efficiency while maintaining high accuracy.
[0087] Step S600: Determine the key-value pairs of the nameplate information based on the text information of each attribute name text box and the corresponding attribute value text box.
[0088] In some alternative implementations, the text information of each attribute name text box can be directly extracted as a key of the nameplate information, and the text information of the corresponding attribute value text box can be extracted as the attribute value of this key. After all key-value pairs are determined, the nameplate information is output to the user for uploading and archiving.
[0089] In some alternative implementations, attribute values can be further processed to improve their normalization. Since different attribute values should actually be processed using different types of normalization methods, specifically, such as... Figure 7 As shown, step S600 may include:
[0090] Step S610: Determine the target attribute name text box.
[0091] Step S620: Extract the text information of the target attribute name text box as the attribute name.
[0092] Step S630: Obtain the attribute value processing rules corresponding to the attribute name of the target attribute name text box.
[0093] Specifically, regular expression rules can be used to process the text information (i.e., attribute values) corresponding to attribute value text boxes, converting them into a standardized or uniform form. Attribute value processing rules can be a sequence of regular expression instructions or rules. For example, if the attribute name is "output voltage," then the standard format for the corresponding output voltage attribute value is that there are no spaces between the unit and the number. The goal of the attribute value processing rule is to obtain a regular expression conversion rule for a string like "220V."
[0094] Step S640: Process the text information of the attribute value text box corresponding to the target attribute name text box according to the attribute value processing rules to determine the attribute value.
[0095] Step S650: Output the attribute name and the corresponding attribute value as the key-value pair.
[0096] After step S650 is completed, you can return to step S610 to execute the next round of iterations.
[0097] Therefore, based on the attribute name, the matched attribute values can be further processed precisely and automatically converted into a standardized format, ensuring the standardization and accuracy of the identified nameplate information.
[0098] In some alternative implementations, constraints based on entity categories can also be applied to both attribute names and attribute values to improve the data consistency of the output key-value pairs.
[0099] like Figure 8 As shown, step S600 may include:
[0100] Step S610': Determine the target attribute name text box and the corresponding target attribute value text box.
[0101] Step S620': Determine the entity category of the target attribute name text box.
[0102] Step S630': Determine the corresponding key processing rules and attribute value processing rules based on the entity category.
[0103] Specifically, different entity categories can have different processing rules. For example, for voltage attribute names, it is desirable to unify different expressions such as "rated output power" and "output function" into the same expression. Similarly, for date attribute values, it is desirable to unify their format as "year, month, day". Likewise, for date key values, their names can also be standardized through corresponding key processing rules or attribute value processing rules.
[0104] Step S640': Process the text information of the target attribute name text box according to the key processing rules to determine the attribute name.
[0105] Step S650': Process the text information of the target attribute value text box according to the attribute value processing rules to determine the attribute value.
[0106] The above processing can be performed using regular expression matching with corresponding conversion strategies. For example, regular expressions can be used to identify the canonical name corresponding to the current attribute name, and then it can be converted into the corresponding canonical name. If necessary, multiple steps can be performed to determine the canonical name or the canonical format of the attribute value.
[0107] Alternatively, a large language model deployed locally or in the cloud can be used. For example, multiple standardized names corresponding to the entity category can be provided in the prompts for the large language model, and then the large language model can recognize the text information in the target attribute name text box and automatically convert it into one of the multiple standardized names. The conversion of attribute values is similar and will not be elaborated here.
[0108] Step S660': Output the attribute name and the corresponding attribute value as the key-value pair.
[0109] After step S660' is completed, you can return to step S610' to execute the next round of iterations.
[0110] The method of this invention, based on the characteristic that nameplate information is usually represented as key-value pairs of attribute names and attribute values, uses optical character recognition to extract text boxes from the nameplate image, resulting in multiple different text boxes clustered in different areas of the image. Then, the text boxes are classified to determine their categories. The unit information text box is merged with the nearest attribute value text box, thereby identifying all attribute value text boxes and attribute name text boxes. Next, the attribute value text boxes and attribute name text boxes are matched based on positional information to extract the correspondence. After matching, the corresponding text information is extracted to form the key-value pairs of the nameplate information. Therefore, it can accurately identify nameplate information without requiring a complex recognition model or significantly increasing computational complexity, facilitating automated collection of nameplate information by offline staff.
[0111] Figure 9 This is a schematic diagram of the nameplate information collection device according to an embodiment of the present invention. Figure 9 As shown, the device in this embodiment of the invention includes an image acquisition unit 91, a recognition unit 92, a classification unit 93, a text box merging unit 94, a relationship extraction unit 95, and an output unit 96.
[0112] The system includes: an image acquisition unit 91 for acquiring a nameplate image; an identification unit 92 for performing optical character recognition on the nameplate image to determine identification information, including the position information and text information of multiple identified text boxes; a classification unit 93 for determining the category of the text information of each text box, thereby classifying each text box into a unit information text box, an attribute value text box, or an attribute name text box; a text box merging unit 94 for merging each unit information text box with the nearest attribute value text box to determine a new attribute value text box; a relationship extraction unit 95 for obtaining the attribute name text box to which each attribute value text box belongs; and an output unit 96 for determining the key-value pairs of the nameplate information based on the text information of each attribute name text box and its corresponding attribute value text box.
[0113] The device in this invention, based on the characteristic that nameplate information is typically represented as key-value pairs of attribute names and attribute values, uses optical character recognition (OCR) to identify nameplate images, resulting in multiple distinct text boxes clustered in different areas of the image. These text boxes are then categorized, and the unit information text box is merged with its nearest attribute value text box. This process identifies all attribute value and attribute name text boxes. The attribute value and attribute name text boxes are then matched based on their location information to extract the corresponding relationships. After matching, the corresponding text information is extracted to form the key-value pairs of the nameplate information. Therefore, it can accurately identify nameplate information without requiring complex recognition models or significantly increasing computational complexity, facilitating automated collection of nameplate information by offline staff.
[0114] Figure 10 This is a schematic diagram of an electronic device according to an embodiment of the present invention. (For example...) Figure 10 As shown, the electronic device includes a general computer hardware structure for implementing the methods described in the embodiments of the present invention, and includes at least a processor 101 and a memory 102.
[0115] Processor 101 and memory 102 are connected via bus 103. Memory 102 is adapted to store instructions or programs executable by processor 101. Processor 101 may be a standalone microprocessor or a collection of one or more microprocessors. Thus, processor 101 executes the instructions stored in memory 102 to perform the method flow of the embodiments of the present invention as described above, thereby realizing data processing and control of other devices. Bus 103 connects the above-mentioned components together, and also connects the above-mentioned components to display controller 104, display device, and input / output (I / O) device 105. Input / output (I / O) device 105 may be a mouse, keyboard, modem, network interface, touch input device, motion-sensing input device, printer, and other devices known in the art. Typically, input / output device 105 is connected to the system via input / output (I / O) controller 106.
[0116] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus (devices), or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0117] This application is described with reference to flowchart illustrations of methods, apparatus (devices), and computer program products according to embodiments of this application. It should be understood that each step in the flowchart can be implemented by computer program instructions.
[0118] These computer program instructions may be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction means, the implementation process of which is described in the instruction means. Figure 1 The function specified in one or more processes.
[0119] These computer program instructions may also be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, produce instructions for implementing processes. Figure 1 A device for a function specified in one or more processes.
[0120] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program for use by a computer to execute some or all of the above-described method embodiments.
[0121] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program specifying the relevant hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0122] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for collecting nameplate information, characterized in that, The method includes: Obtain the nameplate image; Optical character recognition is performed on the nameplate image to determine the recognition information, which includes the position information of multiple text boxes and the text information of the text boxes. Determine the category of text information in each text box, thereby classifying each text box into a unit information text box, an attribute value text box, or an attribute name text box; For each unit information text box, merge it with the nearest attribute value text box to determine the new attribute value text box; For each attribute value text box, retrieve the attribute name text box to which it belongs; The key-value pairs for the nameplate information are determined based on the text information in each attribute name text box and the corresponding attribute value text box.
2. The method according to claim 1, characterized in that, Determining the category of text information in each text box includes: Match the text information in the text box with a predetermined text template to determine the category; or The text information of the text box is input into the text classification model to determine the category.
3. The method according to claim 1, characterized in that, Merging with the nearest attribute value text box includes: Define the current target unit information text box; Determine the distance between the target unit information text box and all attribute value text boxes; The target unit information text box is merged with the attribute value text box with the smallest distance to form a new attribute value text box.
4. The method according to claim 1, characterized in that, The text box for retrieving the attribute name includes: The text box for determining the current target attribute value; Determine the distance between the target attribute value text box and all attribute name text boxes; The attribute name text box with the smallest distance is determined as the attribute name text box to which the target attribute value text box belongs.
5. The method according to claim 1, characterized in that, The text box for retrieving the attribute name includes: The text box for determining the current target attribute value; Determine the entity category of the text information in the target attribute value text box; Identify at least one attribute name text box that matches the entity category with the attribute value text box; Determine the distance between the target attribute value text box and all similar attribute name text boxes; The text box with the smallest distance of the same type of attribute name is determined as the attribute name text box to which the target attribute value text box belongs.
6. The method according to claim 1, characterized in that, The key-value pairs for the nameplate information are determined based on the text information in each attribute name text box and its corresponding attribute value text box, including: Define the target attribute name text box; Extract the text information from the target attribute name text box as the attribute name; Obtain the attribute value processing rules corresponding to the attribute name of the target attribute name text box; The text information of the attribute value text box corresponding to the target attribute name text box is processed according to the attribute value processing rules to determine the attribute value; Output the attribute name and the corresponding attribute value as the key-value pair.
7. The method according to claim 1, characterized in that, The key-value pairs for the nameplate information are determined based on the text information in each attribute name text box and its corresponding attribute value text box, including: Define the target attribute name text box and the corresponding target attribute value text box; Determine the entity category of the target attribute name text box; Determine the corresponding key processing rules and attribute value processing rules based on the entity category; The attribute name is determined by processing the text information of the target attribute name text box according to the key processing rules. The attribute value is determined by processing the text information of the target attribute value text box according to the attribute value processing rules. Output the attribute name and the corresponding attribute value as the key-value pair.
8. The method according to claim 2, characterized in that, The identification information also includes the confidence level of the text; The method further includes: In response to the failure to determine the category of the text information of the target text box through text template matching, and the confidence level being lower than a predetermined threshold, optical character recognition is performed again on the image corresponding to the target text box; The algorithm used in the second optical character recognition test is different from the one used in the previous test.
9. A nameplate information acquisition device, characterized in that, The device includes: The image acquisition unit is used to acquire the nameplate image; The recognition unit is used to perform optical character recognition on the nameplate image and determine the recognition information, which includes the position information of multiple text boxes and the text information of the text boxes. The classification unit is used to determine the category of the text information in each text box, thereby dividing each text box into a unit information text box, an attribute value text box, or an attribute name text box. The text box merging unit is used to merge each unit information text box with the nearest attribute value text box to determine a new attribute value text box. The relation extraction unit is used to retrieve the attribute name text box to which each attribute value text box belongs; The output unit determines the key-value pairs of the nameplate information based on the text information in each attribute name text box and the corresponding attribute value text box.
10. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1-8.
11. A computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method as described in any one of claims 1-8.
