A data identification method, device, equipment and storage medium
By identifying and classifying the target image, the problem of inaccurate position detection caused by printing offset is solved, and the accuracy and robustness of data recognition are improved.
Patent Information
- Application Number
- CN202210239208.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-03-11
AI Technical Summary
The prior art in label detection is inaccurate due to printing offset, which affects the identification accuracy.
By acquiring the target image, using the image detection model for target recognition, the category, location and content information of multiple target areas are obtained, and matching with the preset information template based on the classification results to generate data recognition results to avoid relying on fixed position interception.
It significantly improves the accuracy of image data recognition, improves the accuracy of data information recognition in the target area, and enhances the robustness of printing offsets.
Smart Images

Figure CN114677701B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision technology, and in particular to a data recognition method, device, equipment and storage medium. Background Art
[0002] Various configuration labels are often attached to the outer packaging of laptop computers. The labels contain various information about the laptop, so the inspection of packaging box labels is very important. In the process of label inspection, there are many complex contents to be inspected, and they all need to be inspected. The operation of the prior art is to model by means of pre-manual measurement or automatic image matching and text recognition, and then intercept a fixed sub-image in a fixed area based on the data obtained by modeling for corresponding inspection. However, printing deviation often occurs at the printing end of the label, resulting in the original position data obtained by measurement no longer being accurate. Summary of the invention
[0003] The present disclosure provides a data identification method, device, equipment and storage medium to at least solve the above technical problems existing in the prior art.
[0004] According to a first aspect of the present disclosure, a data recognition method is provided, the method comprising: acquiring a target image; performing image recognition on the target image to obtain an image recognition result, the image recognition result comprising multiple target areas and data information of the target areas; classifying the multiple target areas based on the data information to obtain classification results of the target areas; and classifying and matching the data information of the multiple target areas based on the classification results to generate a data recognition result.
[0005] In one possible implementation manner, acquiring the target image includes: acquiring an original image; and preprocessing the original image to obtain the target image.
[0006] In one possible implementation manner, performing image recognition on the target image includes: using an image detection model to perform target recognition on the target image to obtain multiple target areas; and performing category recognition, location recognition, and content recognition on the target areas.
[0007] In one possible implementation manner, the image detection model is obtained by the following operations: acquiring multiple sample images, wherein the sample images include multiple sample areas; annotating data information of the multiple sample areas of the sample images to determine the data information of the multiple sample images; and training a neural network based on the data information of the multiple sample images to obtain the image detection model.
[0008] In one possible implementation, the data information of the multiple target areas is classified and matched based on the classification result to generate a data recognition result, including: based on the classification result, the data information of the target area is traversed and matched with the data information of the area in the preset information template that is consistent with the classification result of the target area to generate a data recognition result; wherein the preset information template includes multiple preset target areas and the data information of the preset target areas.
[0009] In one possible implementation manner, the traversal matching of the data information of the target area with the data information of the area in the preset information template that is consistent with the classification result of the target area includes: matching the area information of the target area with the area information of the area in the preset information template that is consistent with the classification result of the target area, and determining the area matching result of the target area according to a preset area threshold; when the area matching result of the target area does not meet the preset area condition, matching the position information of the target area with the position information of the area in the preset information template that is consistent with the classification result of the target area, and determining the position matching result of the target area according to the preset position threshold.
[0010] In one possible implementation, the traversal matching of the data information of the target area with the data information of an area in a preset information template that is consistent with the classification result of the target area includes: matching the content information of the target area with the content information of an area in a preset information template that is consistent with the classification result of the target area, and determining the content matching result of the target area.
[0011] According to a second aspect of the present disclosure, a data recognition device is provided, the device comprising: an acquisition module for acquiring a target image; a recognition module for performing image recognition on the target image to obtain an image recognition result, the image recognition result comprising multiple target areas and data information of the target areas; a classification module for classifying the multiple target areas according to the data information to obtain classification results of the target areas; and a matching module for classifying and matching the data information of the multiple target areas according to the classification results to generate a data recognition result.
[0012] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the present disclosure.
[0013] According to a fourth aspect of the present disclosure, a computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the present disclosure.
[0014] A data recognition method disclosed herein directly recognizes an image, obtains multiple target areas and data information of the target areas, and then directly classifies and matches the target areas according to their categories to obtain an automatic recognition solution for image data recognition results. It can realize automatic recognition for target images and effectively solve the problem of inaccurate image position detection due to image printing offset during image position detection. Therefore, the accuracy of image data recognition is significantly improved, and the accuracy of data information recognition of the target area is effectively improved.
[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0017] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0018] Figure 1 A schematic diagram showing a flow chart of a data identification method according to an embodiment of the present disclosure is shown;
[0019] Figure 2 The images before and after preprocessing in the data recognition method of the embodiment of the present disclosure are shown;
[0020] Figure 3 A schematic diagram showing a preset information template in the form of an XML document in the data identification method according to an embodiment of the present disclosure;
[0021] Figure 4 A schematic diagram of a data identification device according to another embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0022] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0023] The existing outer packaging box is attached with a label image, which is usually attached to the front or two sides of the box. These label images are of various sizes, shapes, and types. During the product production process, label printing deviation and other phenomena often occur, which seriously affects the appearance and information integrity of the outer packaging box label, so the inspection of the packaging box label is very important.
[0024] At present, the method of label detection is usually to model by means of pre-manual measurement or automatic image matching and text recognition, and then intercept a fixed sub-image in a fixed area for corresponding detection based on the data obtained by modeling. However, printing and modeling are prone to deviations, and printing deviations may affect the subsequent recognition of labels. Based on this, the present application provides a data recognition method to solve the problem of label printing deviation affecting label recognition.
[0025] Figure 1 A flow chart of a data identification method according to an embodiment of the present disclosure is shown.
[0026] like Figure 1 As shown, the data recognition method of the embodiment of the present disclosure mainly includes: step S101, acquiring a target image; step S102, performing image recognition on the target image to obtain an image recognition result, wherein the image recognition result includes multiple target areas and data information of the target areas; step S103, classifying the multiple target areas according to the data information to obtain classification results of the target areas; step S104, classifying and matching the data information of the multiple target areas according to the classification results to generate a data recognition result.
[0027] In step S101, a target image is acquired.
[0028] In this embodiment of the present disclosure, the target image may include a label image of multiple information of the device, or may be other images, which are not limited here. Here, the target image may also be acquired based on scanning, or may be acquired using an image acquisition device, such as a camera, etc., or may be acquired based on image feature extraction or image recognition.
[0029] In one embodiment of the present disclosure, before performing image recognition on a target image, an original image may be first acquired, and then the original image may be preprocessed to obtain the target image.
[0030] Figure 2 The images before and after preprocessing of the data recognition method according to the embodiment of the present disclosure are shown.
[0031] In this embodiment of the present invention, after the original image is acquired, the original image is firstly subjected to black and white binarization processing, then the specific contour of the target image is found by finding the contour, and four border lines are obtained by performing line scanning within the contour, and finally the specific target image is cut out by finding the intersection of the four lines.
[0032] refer to Figure 2 , taking the label as an example, we can first obtain an image such as Figure 2 The original label image shown in (a) is then calibrated using the above method. Figure 2 (a) is preprocessed to obtain a preprocessed label image 2 (b). In step S102, image recognition is performed on the target image to obtain an image recognition result, which includes multiple target areas and data information of the target areas.
[0033] For example, after acquiring a target image, the target image will be recognized, and multiple target areas in the target image will be recognized. Here, the target area can be multiple black areas in the recognized label, such as barcodes, text, pictures, etc. The data information of the target area is used to indicate the content information, location information, size information, and category information of the target image.
[0034] In one embodiment of the present disclosure, the specific operation of performing image recognition on the target image may include: using an image detection model to perform target recognition on the target image to obtain multiple target areas; performing category recognition, location recognition, and content recognition on the target areas.
[0035] For example, after acquiring the target image, the target image needs to be scanned using the image detection model to scan out multiple target areas. After scanning out the multiple target areas, the multiple target areas are classified to obtain the categories of the multiple target areas. In the process of classifying the multiple target areas, the multiple target areas are simultaneously identified to obtain the location information of the target areas. After the category information and location information of all target areas are identified, the multiple target areas are content identified to obtain the content information corresponding to the multiple target areas.
[0036] In one embodiment of the present disclosure, the image detection model can be a mask-based regional convolutional neural network MaskR-CNN. Mask R-CNN can detect and segment multiple types of objects at the same time. Mask R-CNN mainly includes three branches, namely, a classification branch, which is used to classify targets; a bounding box regression branch, which is used to locate objects; and a mask branch, which is used to perform instance segmentation on objects in the box. It should be noted that the image detection model is not specifically limited here, and any model that can achieve the same effect can be used, such as Faster R-CNN.
[0037] For example, in the process of using Mask R-CNN to identify the target image, the target image is first convolved to extract the features of the image to be processed, and then three branches are used to identify and segment multiple target areas in the target image based on the features of the target image, and the data information of each target area is returned, where the data information may include the area, location, category, and content of the target area. In this way, through an end-to-end neural network, after the target image is input into the network model, the location, category, content, and other information of the target area in the target image can be directly output, thereby improving the recognition efficiency of the target image.
[0038] In one embodiment of the present disclosure, the target image may be input into the image detection model as three copies to further speed up the recognition speed of the target image.
[0039] For example, in the process of identifying a target image, it is necessary to identify the category, location and content of the target image, and these three types of identification require three networks in the image detection model to perform them separately. In this way, inputting the target image into the image detection model as three copies can enable the three network branches in the model to calculate in parallel, thereby speeding up the recognition efficiency of the target image.
[0040] In one embodiment of the present disclosure, an image detection model is obtained by the following operations: first, a plurality of sample images including a plurality of sample areas are obtained; then, data information is annotated on the plurality of sample areas of the sample images to determine the data information of the plurality of sample images; finally, a neural network is trained according to the data information of the plurality of sample images to obtain an image detection model.
[0041] For example, in the process of training the image detection model, first obtain multiple sample images and annotate the sample images. The annotation here includes boxing out multiple target areas in the target image and annotating the multiple target areas with data information. Here, the data information annotation can be position annotation, category annotation, and content annotation, etc. After that, the annotated sample image is input into the convolutional neural network to extract the features of the image, and the extracted features are respectively subjected to classification training, positioning training, and content recognition training. The specific model training process can be realized by the existing technology, so it will not be repeated here. In step S103, multiple target areas are classified according to the data information to obtain the classification results of the target areas.
[0042] For example, after the target image is recognized, multiple target regions may be recognized, and the multiple target regions may be classified according to category information of the target regions.
[0043] Specifically, assuming that the detected target image is a label, after the label is recognized, target areas of different categories can be recognized, such as target areas of barcode category, target areas of picture category, and target areas of text category, etc. At this time, it is necessary to classify target areas of the same category together according to the category information of the target area for subsequent processing.
[0044] In step S104, based on the classification results, the data information of the multiple target areas is classified and matched to generate a data recognition result.
[0045] For example, after differentiating multiple target regions in a target image according to categories, multiple target region sets of different categories are obtained, and the target regions in each target region set belong to the same category. Next, matching operations are performed on the target regions in different target region sets to generate data recognition results of the target image.
[0046] Specifically, taking a label as an example, the identified label is classified to obtain a text target area set, a picture target area set, and a barcode target area set. In a further matching operation, it is necessary to perform matching operations on the target areas in the text area set, the picture target area set, and the barcode target area set, respectively, and finally obtain the data recognition result of the label. It should be noted that the label is only used as an example for illustrative explanation here, and is not specifically limited.
[0047] In one embodiment of the present disclosure, before traversing and matching the data information of the target area with the data information of the area in the preset information template that is consistent with the classification result of the target area according to the classification result, it is necessary to establish a preset information template.
[0048] Figure 3A schematic diagram showing a preset information template in the form of an XML document in the data identification method according to an embodiment of the present disclosure.
[0049] refer to Figure 3 , the preset information template exists in XML format.
[0050] In one embodiment of the present disclosure, the preset information template may be pre-configured by manual surveying.
[0051] For example, first obtain multiple sample images, then frame the black areas in the sample images, and measure the data information of multiple target areas, such as area, location and other information, and make this information into a table. Then, use rules to convert the table into an XML format document to generate an information template.
[0052] In one embodiment of the present disclosure, the preset information template may also be pre-configured in an automated manner.
[0053] For example, first obtain a sample image, and use morphological transformation to grow the black area in the sample image and form a connected domain, then find the contour of the connected domain to obtain the area of each connected domain, and calculate the position of the connected domain with pixel accuracy. Then identify each connected domain, if it is recognized as text, further identify the text content, if it is recognized as an image, further extract the image features, and finally convert the recognized data into a preset information template in the form of an XML document.
[0054] It should be noted that the specific process of forming the preset information template may also be implemented in other applicable ways, which will not be elaborated here.
[0055] In one embodiment of the present disclosure, the process of classifying and matching data information of multiple target areas according to classification results and generating data recognition results includes: according to the classification results, traversing and matching the data information of the target area with the data information of the area in the preset information template that is consistent with the classification result of the target area to generate a data recognition result; wherein the preset information template includes multiple preset target areas and data information of the preset target areas.
[0056] For example, after classifying multiple target areas of the target image, multiple target area sets of different categories can be obtained. In the process of traversal matching, target area sets of different categories need to be traversed and matched separately. Taking the traversal matching process of a category of target area set as an example, the specific traversal matching process can be: first traverse each target area in this area target set, and match the data information of the target area with the data information of the area belonging to the same category as the target area set in the preset information template in the order of traversal, and obtain the data recognition result of the target area. In this way, by matching the data information of multiple target areas with the information of the pre-established information template for correlation to determine the recognition result, it no longer relies on the solution of using template information to perform fixed position interception for recognition in the prior art, but uses the template as the matching object, which effectively targets the situation of inaccurate image data recognition caused by printing offset, making image content recognition more robust.
[0057] In one possible implementation manner, the process of traversing and matching the data information of the target area may include: matching the area information of the target area with the area information of an area in a preset information template that is consistent with the classification result of the target area, and determining the area matching result of the target area according to a preset area threshold; when the area matching result of the target area does not meet the preset area condition, matching the position information of the target area with the position information of an area in the preset information template that is consistent with the classification result of the target area, and determining the position matching result of the target area according to the preset position threshold.
[0058] In this embodiment of the present invention, the target image includes multiple target areas. After classifying the multiple target areas of the target image, multiple target area sets can be obtained. For example, three target area sets can be obtained. The three target area sets can be a first classification set, a second classification set, and a third classification set. The three classification sets represent different categories of areas, such as the first classification set can represent text types, the second classification set can represent barcode types, and the third classification set can represent picture classification sets. In the following matching process, the first classification set, the second classification set, and the third classification set need to be separated and classified and matched with the preset information template. Taking the first classification as an example, the first classification set is first traversed, and in the order of traversal, the area information of each target area in the first classification set is matched with the area information of the area of the same category as the first classification set in the preset information template. After the area matching operation is performed on all target areas in the first classification set, the area matching result of each target area set can be obtained according to the preset area threshold. In actual applications, there may be multiple target areas with the same area, which will make the area information of a target area match many area information in the preset information template. At this time, it is necessary to match the position information of these target areas with the position information of the areas in the preset template that belong to the same category as these target areas, and obtain the position matching result according to the preset position threshold. In this way, according to the above matching method for the first classification set, the target areas in the second classification set and the third classification set are also subjected to area matching and position matching operations, and the recognition result of the target image can be obtained.
[0059] In one embodiment of the present disclosure, the preset area threshold may be obtained according to the modeling accuracy n of the preset information template and the pixel accuracy PPM of the target image, and the preset area threshold may be: n*n*PPM.
[0060] Specifically, in the process of selecting an area, the selected area may be inaccurate due to printing offset. Accordingly, in the matching process, a threshold can be set to avoid the problem of inaccurate area selection caused by printing offset.
[0061] In one embodiment of the present disclosure, the modeling accuracy of the information template may be set according to the situation during the information template establishment process.
[0062] Specifically, due to some situations when establishing the information template, the position information in the template is also inaccurate. If the information template is established manually, when the template is re-established, the position of the paper used for printing changes each time, which may cause the position of some areas in the information template established manually each time to change. At this time, it is necessary to set the modeling accuracy to avoid the problem of the position of each area in the template changing during the manual template establishment process.
[0063] Among them, there is a situation that, in the process of automatically generating information templates by image processing, the sample image obtained has printing deviation. If printing deviation occurs, when selecting a certain area, it may cause inaccurate selection content. At this time, when establishing the template, a modeling accuracy must be set to avoid the problem of incomplete selection of content in the image.
[0064] For example, taking labels as an example, there are many densely packed fonts in labels. When trimming, in order to avoid the problem of incomplete fonts after trimming due to printing offset, a precision needs to be set. Generally speaking, the precision can be set to about 2 mm. It should be noted here that the process of determining the modeling precision of the specific information template can be realized by existing technologies, so it will not be repeated here.
[0065] In one embodiment of the present disclosure, the preset position threshold is half of the width and height of the smallest area in the information template, and the preset position threshold may be: min(W, H) / 2.
[0066] Specifically, taking one of the target areas as an example, assuming that the position of the target area is (X, Y), in order to avoid inaccurate position caused by printing offset, the threshold corresponding to the X aspect can be set to half the width of the smallest area in the information template, and the threshold corresponding to the Y aspect can be set to half the height of the smallest area in the information template. Thus, by setting the threshold, the printing offset can be effectively addressed, making the image content recognition more robust.
[0067] In one embodiment of the present disclosure, after the position matching operation is completed on the target area in the target image, if there is still a target area whose position information corresponds to the position information of multiple areas in the preset information template, it means that the target image at this time may have printing deviation and the like, and the target image is judged to be unqualified.
[0068] Specifically, in the process of image recognition, we must first ensure that the position and area of the frame are accurate before we can proceed to the next step of data recognition. If, after matching the area and position of the target area in the target image, it still does not match the preset information template, it means that the image may have printing offset, etc., and the image is directly judged as unqualified, and no content information recognition is performed. In this way, unqualified images are identified in advance, which reduces the workload of subsequent content recognition for unqualified images and improves the efficiency of image data recognition.
[0069] In one possible implementation, the data information of the target area is traversed and matched with the data information of the area in the preset information template that is consistent with the classification result of the target area, including: matching the content information of the target area with the content information of the area in the preset information template that is consistent with the classification result of the target area, and determining the content matching result of the target area.
[0070] Specifically, after area matching and position matching of multiple target areas in the target image, it is necessary to further perform content recognition of the target area to determine whether the content of the corresponding area of the image is printed correctly through content recognition, thereby further improving the accuracy of image recognition.
[0071] Figure 4 A schematic diagram of a data identification device according to another embodiment of the present disclosure is shown.
[0072] refer to Figure 4 Based on the above-mentioned discharge method of the electronic device, the embodiment of the present disclosure further provides a data recognition device 40, which includes: an acquisition module 401, used to acquire a target image; a recognition module 402, used to perform image recognition on the image to be detected to obtain an image recognition result, and the image recognition result includes multiple target areas and data information of the target areas; a classification module 403, used to classify the multiple target areas according to the data information to obtain classification results of the target areas; a matching module 404, used to classify and match the data information of the multiple target areas according to the classification results to generate a data recognition result.
[0073] In one embodiment of the present disclosure, the device 40 further includes: an original image acquisition module, used to acquire the original image; and a preprocessing module, used to preprocess the original image to obtain a target image.
[0074] In one embodiment of the present disclosure, the recognition module 402 includes: a first recognition module, which uses an image detection model to perform target recognition on the image to be detected to obtain multiple target areas; and a second recognition module, which performs category recognition, location recognition and content recognition on the target area.
[0075] In one embodiment of the present disclosure, the recognition module 402 also includes: a sample image acquisition module, which is used to acquire multiple sample images, and the sample images include multiple sample areas; an information labeling module, which is used to label the multiple sample areas of the sample images with data information and determine the data information of the multiple sample images; and a model training module, which is used to train the neural network according to the data information of the multiple sample images to obtain an image detection model.
[0076] In one embodiment of the present disclosure, the matching module 404 is also used to traverse and match the data information of the target area with the data information of the area in the preset information template that is consistent with the classification result of the target area according to the classification result, so as to generate a data recognition result; wherein the preset information template includes multiple preset target areas and data information of the preset target areas.
[0077] In one embodiment of the present disclosure, the matching module 404 includes: an area matching module, which is used to match the area information of the target area with the area information of the area in the preset information template that is consistent with the classification result of the target area, and determine the area matching result of the target area according to a preset area threshold; a position matching module, which is used to match the position information of the target area with the position information of the area in the preset information template that is consistent with the classification result of the target area when the area matching result of the target area does not meet the preset area condition, and determine the position matching result of the target area according to the preset position threshold.
[0078] In one embodiment of the present disclosure, the matching module 404 further includes: a content matching module, which is used to match the content information of the target area with the content information of the area in the preset information template that is consistent with the classification result of the target area, and determine the content matching result of the target area.
[0079] It should be noted here that the above description of the data identification device embodiment is similar to the description of the aforementioned method embodiment, and has similar beneficial effects as the aforementioned method embodiment, so it will not be repeated. For the technical details not yet disclosed in the description of the data identification device embodiment of this embodiment of the present application, please refer to the description of the aforementioned method embodiment of the present application for understanding, and in order to save space, it will not be repeated.
[0080] Furthermore, based on the above data identification method, an embodiment of the present disclosure also provides an electronic device.
[0081] Similarly, based on the above data recognition method, the embodiment of the present disclosure also provides a computer-readable storage medium, which stores a program. When the program is executed by a processor, the processor at least performs the following operation steps: step S101, acquiring a target image; step S102, performing image recognition on the target image to obtain an image recognition result, wherein the image recognition result includes multiple target areas and data information of the target areas; step S103, classifying the multiple target areas according to the data information to obtain classification results of the target areas; step S104, classifying and matching the data information of the multiple target areas according to the classification results to generate a data recognition result.
[0082] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0083] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0084] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment of the present disclosure.
[0085] In addition, all functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0086] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0087] Alternatively, if the above-mentioned integrated unit of the present disclosure is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0088] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A data identification method, characterized in that: The method comprises: Get the target image; Performing image recognition on the target image to obtain an image recognition result, wherein the image recognition result includes a plurality of target areas and data information of the target areas; Classifying the multiple target areas according to the data information to obtain classification results of the target areas; According to the classification results, classify and match the data information of the multiple target areas to generate a data recognition result; Wherein, classifying and matching the data information of the multiple target areas according to the classification result to generate a data recognition result includes: According to the classification result, the data information of the target area is traversed and matched with the data information of the area in the preset information template that is consistent with the classification result of the target area to generate a data recognition result; The preset information template includes a plurality of preset target areas and data information of the preset target areas.
2. The method according to claim 1, characterized in that: The acquiring of the target image comprises: Get the original image; The original image is preprocessed to obtain a target image.
3. The method according to claim 1, characterized in that: The performing image recognition on the target image comprises: Using an image detection model, performing target recognition on the target image to obtain multiple target areas; The target area is subjected to category recognition, location recognition and content recognition.
4. The method according to claim 3, characterized in that The image detection model is obtained by the following operations: Acquire a plurality of sample images, wherein the sample images include a plurality of sample areas; Annotating data information on a plurality of sample areas of the sample image to determine data information of the plurality of sample images; The neural network is trained according to the data information of the multiple sample images to obtain the image detection model.
5. The method according to claim 1, characterized in that: The traversing and matching the data information of the target area with the data information of an area in a preset information template that is consistent with the classification result of the target area includes: Matching the area information of the target area with the area information of the area in the preset information template that is consistent with the classification result of the target area, and determining the area matching result of the target area according to a preset area threshold; When the area matching result of the target area does not meet the preset area condition, the position information of the target area is matched with the position information of the area in the preset information template that is consistent with the classification result of the target area, and the position matching result of the target area is determined according to the preset position threshold.
6. The method according to claim 1, characterized in that: The traversing and matching the data information of the target area with the data information of an area in a preset information template that is consistent with the classification result of the target area includes: The content information of the target area is matched with the content information of an area in a preset information template that is consistent with the classification result of the target area, and a content matching result of the target area is determined.
7. A data identification device, characterized in that: The device comprises: An acquisition module, used for acquiring a target image; A recognition module, used for performing image recognition on the target image to obtain an image recognition result, wherein the image recognition result includes a plurality of target areas and data information of the target areas; A classification module, used for classifying the multiple target areas according to the data information to obtain classification results of the target areas; A matching module, used to classify and match the data information of the multiple target areas according to the classification results to generate a data recognition result; Among them, the matching module is also used to traverse and match the data information of the target area with the data information of the area in the preset information template that is consistent with the classification result of the target area according to the classification result, and generate a data recognition result; wherein the preset information template includes multiple preset target areas and data information of the preset target areas.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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 perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
Citation Information
Patent Citations
Image text recognition method and device, computer equipment and computer storage medium
CN111275038A