Image recognition method and related apparatus
By obtaining the target data name and location information in image recognition and modifying the data frame range until the positional relationship conditions are met, the problem of insufficient data frame range is solved, and the accuracy of image recognition is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2022-09-21
- Publication Date
- 2026-06-05
Smart Images

Figure CN115471859B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image recognition method and related apparatus. Background Technology
[0002] With the rapid development of information technology, images are widely used for data display and transmission. Therefore, image recognition helps in the acquisition of data information.
[0003] Currently, text recognition is an important development direction in the field of computer vision technology, which can realize the analysis of images to obtain the data information carried by the images.
[0004] For example, in a credit certificate approval scenario, text recognition technology is used to identify images carrying the credit data of the target object. This involves using a preset text box to define the data name of the credit data, and then obtaining the credit data corresponding to the data name based on the fixed data frame range corresponding to the identified data name. Next, it is determined whether the obtained credit data of the target object matches the requirements of the credit certificate, thereby concluding whether the target object meets the requirements of the credit certificate.
[0005] However, if the data frame cannot completely contain the credit data when using the above image recognition method, that is, if the fixed data frame is smaller than the data display range of the credit data, the credit data cannot be completely obtained, and thus it is impossible to accurately determine whether the credit certificate requirements are met.
[0006] Therefore, the accuracy of image recognition is low when using the above method. Summary of the Invention
[0007] This application provides an image recognition method and related apparatus to improve the accuracy of image recognition.
[0008] In a first aspect, embodiments of this application provide an image recognition method, the method comprising:
[0009] Acquire the image to be identified, perform image recognition on the image to be identified, and obtain the name and position information of the target data name contained in the image to be identified in the reference coordinate system;
[0010] Based on the name and location information, the initial data frame range corresponding to the target data name is determined, and the initial dataset within the data frame range is obtained; wherein, the initial data frame range is used to indicate: the actual position of each initial data in the initial dataset in the reference coordinate system;
[0011] According to the preset data acquisition cycle, the initial data frame range is modified until there is no edge data outside the modified initial data frame range that meets the preset positional relationship conditions for the target data; wherein, each time the initial data frame range is modified, the following operations are performed:
[0012] Retrieve at least one new data point within the modified initial data frame and save at least one new data point to the initial dataset.
[0013] Secondly, embodiments of this application also provide an image recognition device, the device comprising:
[0014] The acquisition module is used to acquire the image to be identified and perform image recognition on the image to be identified to obtain the name and position information of the target data name contained in the image to be identified in the reference coordinate system.
[0015] The determination module is used to determine the initial data frame range corresponding to the target data name based on the name and location information, and to obtain the initial dataset within the initial data frame range; wherein, the initial data frame range is used to indicate the actual position of each initial data in the initial dataset in the reference coordinate system;
[0016] The modification module is used to modify the initial data frame range according to a preset data acquisition cycle until there is no edge data outside the modified initial data frame range that meets the preset positional relationship conditions for the target data. Each time the initial data frame range is modified, the following operations are performed:
[0017] Retrieve at least one new data point within the modified initial data frame and save at least one new data point to the initial dataset.
[0018] In one possible embodiment, when determining the initial data frame range corresponding to the target data name based on name location information, the determining module is specifically used for:
[0019] From the preset set of candidate data frame templates, select the target data frame template that matches the name type of the target data name; wherein, the target data frame template is used to indicate the display area corresponding to each data that is associated with the target data name and meets the preset data display conditions;
[0020] Based on the name location information, the target data framing template is adjusted to obtain the adjusted target data framing template;
[0021] Based on the template position information of the adjusted target data frame template, the initial data frame range is determined.
[0022] In one possible embodiment, during the process of obtaining the initial dataset within the initial data frame, the determining module is further configured to:
[0023] If there is boundary data on the boundary of the initial data frame, then obtain the data display range of the boundary data in the reference coordinate system, and obtain the overlapping area between the data display range and the initial data frame.
[0024] Based on the data display range and overlapping area, the degree of overlap between the data display range and the initial data frame range is obtained;
[0025] When the overlap of the ranges exceeds the preset overlap threshold, the boundary data is saved to the initial dataset.
[0026] In one possible embodiment, if the following condition is met, the target data outside the modified initial data frame is determined to satisfy a positional relationship condition with the edge data of the modified initial data frame:
[0027] Based on the target position of the target data in the reference coordinate system, edge data that meets the preset positional interval conditions with the target data are selected from each edge data of the modified initial data bounding range.
[0028] The target data and the obtained marginal data satisfy the row and column characteristics between the initial data contained in the initial dataset.
[0029] In one possible embodiment, when the target data and the obtained edge data satisfy the row and column characteristics between the initial data contained in the initial dataset, the modification module is specifically used to:
[0030] If the x-coordinate position of the target data is the same as the x-coordinate position of the edge data, and the row spacing between the target data and the edge data meets the preset row spacing condition, then the target data and the edge data are determined to meet the row and column characteristics.
[0031] If the vertical coordinate position of the target data is the same as that of the edge data, and the column spacing between the target data and the edge data meets the preset column spacing condition, then the target data and the edge data are determined to satisfy the row and column characteristics.
[0032] In one possible embodiment, during the process of saving at least one new data entry to the initial dataset, the modification module is further configured to:
[0033] For at least one new piece of data, perform the following operations respectively:
[0034] Based on the data type of a newly added data, determine the data correlation between the newly added data and the target data name;
[0035] If the data correlation meets the preset data correlation conditions, then a new data entry will be saved to the initial dataset.
[0036] Thirdly, an electronic device is proposed, comprising a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the image recognition method described in the first aspect.
[0037] Fourthly, a computer-readable storage medium is provided, comprising program code that, when executed on an electronic device, causes the electronic device to perform the steps of the image recognition method described in the first aspect.
[0038] Fifthly, a computer program product is provided, which, when invoked by a computer, causes the computer to perform the image recognition method steps as described in the first aspect.
[0039] The beneficial effects of this application are as follows:
[0040] In the image recognition method provided in this application embodiment, an image to be recognized is acquired, and image recognition is performed on the image to be recognized to obtain the name location information of the target data name contained in the image to be recognized in the reference coordinate system; then, based on the name location information, the initial data frame range corresponding to the target data name is determined, and the initial dataset within the initial data frame range is obtained; wherein, the initial data frame range is used to indicate: the actual position of each initial data in the initial dataset in the reference coordinate system; further, the initial data frame range is modified according to a preset data acquisition cycle until there is no edge data outside the modified initial data frame range that meets the preset positional relationship condition for target data; wherein, each time the initial data frame range is modified, the following operations are performed: at least one new data within the modified initial data frame range is acquired, and at least one new data is saved to the initial dataset.
[0041] This approach, based on name and location information, determines the initial data frame range corresponding to the target data name and obtains the initial dataset within the initial data frame range. Then, according to a preset data acquisition cycle, the initial data frame range is modified until there is no edge data outside the modified initial data frame range that satisfies the preset positional relationship conditions for the target data. This avoids the technical drawback of existing technologies where the data frame range cannot completely contain the data (i.e., the fixed data frame range is smaller than the data display range), leading to incomplete data acquisition. Therefore, it improves the accuracy of image recognition.
[0042] Furthermore, other features and advantages of this application will be set forth in the following description and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0044] Figure 1 An exemplary illustration shows a schematic diagram of the position and structure of a text block provided in an embodiment of this application;
[0045] Figure 2 An exemplary schematic diagram of an optional system architecture provided by an embodiment of this application is shown;
[0046] Figure 3 An exemplary schematic diagram illustrates the implementation flow of an image recognition method provided in an embodiment of this application;
[0047] Figure 4 An exemplary illustration shows a schematic diagram of a region structure provided in an embodiment of this application;
[0048] Figure 5 An exemplary schematic diagram of a logic for obtaining an initial dataset provided in an embodiment of this application is shown;
[0049] Figure 6 An exemplary illustration shows a logical diagram of saving boundary data to an initial dataset according to an embodiment of this application;
[0050] Figure 7 An exemplary illustration shows a logical diagram of determining whether target data and edge data satisfy row and column characteristics, provided in an embodiment of this application.
[0051] Figure 8 An exemplary diagram illustrates a specific application scenario for identifying elements outside the core area provided in an embodiment of this application;
[0052] Figure 9A An exemplary diagram illustrates a specific application scenario of an image recognition method provided in an embodiment of this application;
[0053] Figure 9B An exemplary diagram illustrates a specific application scenario of an image recognition method provided in an embodiment of this application;
[0054] Figure 9C An exemplary diagram illustrates a specific application scenario of an image recognition method provided in an embodiment of this application;
[0055] Figure 10 An exemplary embodiment of this application provides a method based on... Figure 3 A logical diagram;
[0056] Figure 11 An exemplary schematic diagram of an image recognition device provided in an embodiment of this application is shown;
[0057] Figure 12 An exemplary schematic diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0059] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. A connected to B can represent: A and B directly connected, or A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.
[0060] Furthermore, the data collection, dissemination, and use in the technical solution of this application all comply with the requirements of relevant national laws and regulations.
[0061] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0062] (1) Optical Character Recognition (OCR): refers to the process by which electronic devices (e.g., scanners or digital cameras) examine printed characters on paper, determine their shape by detecting dark and light patterns, and then translate the shape into computer text using character recognition methods; that is, for printed characters, optical methods are used to convert the text in paper documents into black and white dot matrix image files, and recognition software is used to convert the text in the image into text format for further editing and processing by word processing software, including adjusting the image rotation angle, recognizing text in images, table lines, etc.
[0063] (2) Hypertext Markup Language (HTML) files: These are files that can be read by various web browsers to generate web pages that convey various types of information. Essentially, the Internet is a collection of a series of transmission protocols and various types of documents. HTML files are just one type of document. These HTML files are stored on server hard drives distributed around the world, and users can remotely access the information conveyed by these files through transmission protocols.
[0064] (3) Span tag: A commonly used layout tag in HTML. Usually, when using the Span tag, there is no line break. That is, consecutive Span tags are usually displayed on the same line. For ease of understanding and description, all data names or elements (values) mentioned in this article are Span tags.
[0065] It should be noted that the Span tag does not have a fixed format. When styles are applied to it, visual changes will occur. It has no attributes on its own.
[0066] (4) Artificial Intelligence (AI): AI refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.
[0067] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.
[0068] The design concept of the embodiments of this application is briefly introduced below:
[0069] Currently, text recognition technology is an important development direction in the field of computer vision technology. It can recognize images and thus obtain the data information carried by the images.
[0070] For example, in the credit certificate approval process, comparing the semantic and character consistency of document elements usually requires a lot of time and effort. Therefore, using OCR in AI to complete character extraction and recognition, and then using NLP to realize the parsing and mapping of semantic elements, is the main way to enable AI to realize intelligent approval of credit certificates.
[0071] It should be noted that after completing a series of OCR operations, including document rotation correction, table line recognition, text region recognition, and text content recognition, a corresponding HTML file (which serves as the input for subsequent document parsing) is obtained. The text content is presented in text block format. Specifically, text that is in the same line and close together is generally within the same text block (Span). See also... Figure 1 As shown, each text block corresponds to its coordinate information [x, y, width, height] in the image, where x and y are the absolute horizontal and vertical distances between the top left corner of the Span and the leftmost and topmost (point O) of the image, respectively, width is the width of the Span, and height is the height of the Span.
[0072] It is evident that the definition of the feature box and the extraction of features (the content of the span) based on the feature box directly affect the location and parsing of features in the document, which is crucial for image recognition.
[0073] Therefore, in order to achieve element recognition of documents, there are three main solutions in the existing technology: a pattern matching solution based on a fixed range, a solution based on OCR slicing, and a generalized document solution based on deep learning. The specific solutions are as follows:
[0074] 1. Fixed-range pattern matching schemes analyze documents (e.g., standard documents) to predefine the range of each element (i.e., the predefined range). Some implementations use an interactive interface where elements are drawn with a mouse and then converted to a configuration file, while others directly define the top-left and bottom-right coordinates of the span in the configuration file. Further, during element parsing and recognition, each span is checked to see if it falls within the predefined range or meets a certain intersection threshold. If it does, the content within the span is considered part of the corresponding element value; otherwise, it is skipped, and the judgment of other spans continues. Ultimately, each span is determined to belong to a certain element or not to any element.
[0075] 2. The OCR-based slicing solution uses OCR to recognize table lines in the document and slices or cuts the entire document into feature areas based on the table lines. This allows for the identification of independent features within the sliced areas, avoiding interference from irrelevant fields caused by searching for feature values across a wide range. Optionally, the individual features after slicing can be identified by rule matching, fixed area definition, or model classification to determine their feature category, and then perform operations such as decomposing composite features and cleaning irrelevant fields.
[0076] 3. A generalized document solution based on deep learning: By labeling the categories of spans or the categories of partial text sequences within a span, text features and coordinate information are used as input to a deep learning network. Through model training, a text classification / sequence labeling model is obtained. For example, the text classification / sequence labeling model will select a predefined category for each span or the text within a span. For instance, the classification model determines that the text "USD12,000.00" in the span is "insurance amount".
[0077] However, the above three methods of element recognition still have certain problems. The specific problems of each image recognition method are as follows:
[0078] 1. Fixed-range pattern matching: Due to the frequent occurrence of positional offsets and excessive element values exceeding the original range when printing elements on documents, fixed-range pattern matching cannot cover these issues. That is, if the range definition is too small, it usually cannot cover all elements; if the range definition is too large, it is more likely to mistakenly include the content of other elements.
[0079] 2. OCR-based slicing: This method is only applicable to documents with fixed table lines. If the document does not have horizontal or vertical table lines, it cannot be used. Furthermore, for documents with fixed table lines, each table frame must contain only one key-value pair or element content. Otherwise, multi-element area splitting and other steps are still required. In addition, table lines are often thin, which often results in large cutting errors. Incomplete or excessive cutting will affect the element parsing in subsequent steps.
[0080] 3. Deep Learning-Based Generalized Document Parsing: Based on massive training corpora, this model is theoretically applicable to parsing documents in any scenario and possesses strong generalization capabilities, even recognizing documents not trained on it to some extent. However, in practice, the extremely high similarity or significant differences between similar documents of the same type can prevent the model from generalizing after training. Furthermore, a single type of document may contain over 80 elements to be parsed, some common, others uncommon or long-tailed. Deep learning methods face significant training pressure, often requiring massive amounts of data. Additionally, the model typically determines whether a span belongs to a certain category, with a probability of classifying a span as not belonging to that category (determined by the model training principle), which introduces errors and leads to incomplete element recognition, particularly noticeable in multi-line span scenarios.
[0081] In view of this, in order to improve the accuracy of image recognition, based on the characteristics of fixed image representation, differences between different types of images, and low frequency of changes in fixed image categories, an image recognition method is proposed. Specifically, the method includes: acquiring an image to be recognized, performing image recognition on the image to be recognized, and obtaining the name location information of the target data name contained in the image to be recognized in a reference coordinate system; then, based on the name location information, determining the initial data frame range corresponding to the target data name, and obtaining the initial dataset within the initial data frame range; wherein, the initial data frame range is used to indicate the actual position of each initial data in the initial dataset in the reference coordinate system; further, modifying the initial data frame range according to a preset data acquisition cycle until there is no edge data outside the modified initial data frame range that satisfies the preset positional relationship condition for target data; wherein, each time the initial data frame range is modified, the following operations are performed: acquiring at least one newly added data within the modified initial data frame range, and saving at least one newly added data to the initial dataset.
[0082] In particular, the preferred embodiments of this application will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments of this application and the features in the embodiments can be combined with each other without conflict.
[0083] See Figure 2 The diagram illustrates a system architecture applicable to an embodiment of this application. This system architecture includes a target terminal (201a, 101b) and a server 202. The target terminal (201a, 201b) and the server 202 can interact via a communication network. The communication network can employ wireless communication or wired communication methods.
[0084] For example, the target terminal (201a, 201b) can access the network and communicate with the server 202 through cellular mobile communication technology, wherein the cellular mobile communication technology includes, for example, 5th generation mobile network (5G) technology.
[0085] Optionally, the target terminal (201a, 201b) can access the network and communicate with the server 202 via short-range wireless communication, wherein the short-range wireless communication method includes, for example, Wireless Fidelity (Wi-Fi) technology.
[0086] This application embodiment does not impose any limitation on the number of the above-mentioned devices, such as Figure 2 As shown, only the target terminal (201a, 201b) and server 202 are described as examples. The following is a brief introduction to each of the above devices and their respective functions.
[0087] The target terminal (201a, 201b) is a device that can provide voice and / or data connectivity to a user, including: handheld terminal devices with wireless connectivity, vehicle-mounted terminal devices, etc.
[0088] For example, target terminals (201a, 201b) include, but are not limited to: mobile phones, tablets, laptops, handheld computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in autonomous driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.
[0089] Furthermore, the target terminals (201a, 201b) may have a related client installed. This client can be software (e.g., an application, browser, short video software, etc.), or a webpage, mini-program, etc. In this embodiment, the acquired image to be identified can be sent from the target terminals (201a, 201b) to the server 202.
[0090] Server 202 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0091] It is worth mentioning that, in this embodiment of the application, the server 202 is used to acquire the image to be identified and perform image recognition on the image to be identified to obtain the name location information of the target data name contained in the image to be identified in the reference coordinate system; then, based on the name location information, the initial data frame range corresponding to the target data name is determined, and the initial dataset within the initial data frame range is obtained; wherein, the initial data frame range is used to indicate: the actual position of each initial data in the initial dataset in the reference coordinate system; further, the initial data frame range is modified according to a preset data acquisition cycle until there is no edge data outside the modified initial data frame range that meets the preset positional relationship condition for the target data; wherein, each time the initial data frame range is modified, the following operations are performed: acquire at least one new data within the modified initial data frame range, and save at least one new data to the initial dataset.
[0092] The image recognition method provided by the exemplary embodiments of this application will be described below in conjunction with the above system architecture and with reference to the accompanying drawings. It should be noted that the above system architecture is only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect.
[0093] See Figure 3 The diagram shown is a flowchart of an image recognition method provided in this application. Taking a server as an example, the specific implementation process of this method is as follows:
[0094] S301: Acquire the image to be identified and perform image recognition on the image to be identified to obtain the name and location information of the target data name contained in the image to be identified in the reference coordinate system.
[0095] Specifically, when executing step S301, after the server obtains the image to be recognized, it can obtain the name location information of the target data name contained in the image to be recognized in the reference coordinate system based on the preset image recognition method. It should be noted that in this embodiment, the number of target data names contained in the image to be recognized can be one or more. In addition, for ease of description and understanding, the target data name can also be referred to as Key or KEY in this document.
[0096] Optionally, the location information of the target data name in the reference coordinate system can be represented by (Left, Top, Height, Width), where Left represents the left margin of the target data name relative to the positioning reference, Top represents the top margin of the target data name relative to the positioning reference, Height represents the height of the target data name in the browser's view window, and Width represents the width of the target data name in the browser's view window.
[0097] S302: Based on the name location information, determine the initial data frame range corresponding to the target data name, and obtain the initial dataset within the initial data frame range.
[0098] Specifically, when executing step S302, after the server obtains the name location information of the target data name in the reference coordinate system, it can adjust the target data frame template that matches the name type of the target data name based on the name location information, thereby determining the initial data frame range corresponding to the target data name, and then obtaining the initial dataset within the initial data frame range; wherein, the initial data frame range is used to indicate the actual position of each initial data in the initial dataset in the reference coordinate system.
[0099] For example, see Figure 4 As shown, KEY represents the target data name, i.e., the name of the feature key in the document; VALUE represents the initial data, the value content corresponding to the feature key in the document, which may have multiple rows (e.g., ...). Figure 3The area within the thin dashed box represents the initial data frame range, i.e., the core area or the feature core area. It should be noted that the initial data frame range (i.e., the core area) is usually a predefined, fixed area close to the key and where the VALUE value frequently appears; it is generally located to the right or below the key. The area between the solid box and the thin dashed box represents the newly added data frame range after subsequent modifications, i.e., the generalized area. It should be noted that the initial data frame range (i.e., the generalized area) after the modifications are completed is a non-predefined area without a specific range; it represents the range that the VALUE might reach when there are excessively long line breaks, print offsets, or multiple lines exceeding the range. Its coverage is determined by the core area and the specific VALUE value's representation. The generalized area is different for each document or feature. It is worth mentioning that in this embodiment, the initial data frame range after modification is the sum of the core area and the generalized area.
[0100] Optionally, the server defines the area corresponding to the initial data frame (i.e., the core area) based on the common presentation format of the VALUE value corresponding to each KEY. It should be noted that, in this embodiment, the initial data frame (i.e., the core area) only needs to be defined once for each target data name KEY of each type of document. For example, if KEY-VALUE is presented in a left-right structure, the initial data frame (i.e., the core area) is directly to the right of the target data name KEY. The specific range of the core area is as follows:
[0101] (1) Left starting point of the core area: The most common left starting point position of VALUE can be directly taken as the left starting point of the core area by the end position of the printed KEY.
[0102] (2) The upper starting point of the core area: The most common upper starting point of VALUE is the position that is level with the top of the printed KEY as the upper starting point of the core area.
[0103] (3) Core area height: Define the core area height according to the common number of rows of VALUE. For example, if the common row height is 25 pixels and the common VALUE has two rows, then the core area height can be defined as 50 pixels.
[0104] (4) Width of core area: Define the width of core area according to the common length of VALUE. Optionally, since each field usually wraps before interacting with other fields, the width of core area can also be defined according to the position of the next field. Each field corresponds to a KEY.
[0105] Based on the above methods and steps, please refer to Figure 5As shown, this is a logical schematic diagram of obtaining an initial dataset according to an embodiment of this application. The server can filter out the target data frame template Tra.Data.Tem from the preset candidate data frame template set Data.Tem.Set, which matches the name type Name.Type of the target data name Targ.Data.Name. Then, based on the name location information Name.Loc.Infor, the target data frame template Tra.Data.Tem is adjusted to obtain the adjusted target data frame template Adjust.Data.Tem. Further, based on the template location information Tem.Loc.Infor of the adjusted target data frame template Adjust.Data.Tem, the initial data frame range Init.Data.Fra.Range is determined. Finally, the initial dataset Init.Dataset within the initial data frame range Init.Data.Fra.Range can be obtained. The target data frame template is used to indicate the display area Display.Area corresponding to each data that is associated with the target data name Targ.Data.Name and meets the preset data display conditions Data.Dis.Con.
[0106] In one possible implementation, see [reference] Figure 6 As shown, during the process of obtaining the initial dataset within the initial data frame, if boundary data exists on the boundary of the initial data frame, the server obtains the data display range of the boundary data in the reference coordinate system and the overlap area between the data display range and the initial data frame. Next, based on the data display range and the overlap area, the degree of overlap between the data display range and the initial data frame is obtained. Finally, when the degree of overlap is greater than a preset overlap threshold, the boundary data is saved to the initial dataset. It should be noted that... Figure 6 Some boundary data in the dataset meet the above conditions. Therefore, some boundary data that meet the above conditions can be saved into the initial dataset.
[0107] It should be noted that the server calculates the overlap between the data display area and the initial data frame area based on the data display range and the overlapping area using the following formula:
[0108]
[0109] Among them, R c S represents the degree of overlap between the data display range and the initial data frame range. o S represents the overlapping area between the data display area and the initial data frame area. d This indicates the range of boundary data displayed in the reference coordinate system.
[0110] For example, assume a preset overlap threshold R y =80%, if the server obtains the overlap degree R of the corresponding boundary data based on the calculation formula of the overlap degree between the above data display range and the initial data frame range. c =88%, then it is easy to know the degree of overlap R. c =88% is greater than the preset overlap threshold R y =80%, therefore, the corresponding boundary data can be saved to the initial dataset.
[0111] Optionally, the server may obtain the overlap degree R of the corresponding boundary data based on the calculation formula for the overlap degree between the data display range and the initial data frame range. c =65%, then it is easy to know the degree of overlap R. c =65% is less than the preset overlap threshold R y =80%, therefore, the corresponding boundary data mentioned above cannot be saved into the initial dataset.
[0112] S303: Modify the initial data frame range according to the preset data acquisition cycle until there is no edge data outside the modified initial data frame range that meets the preset positional relationship conditions for the target data.
[0113] Specifically, when executing step S303, after obtaining the initial data frame range and its corresponding initial dataset, the server can determine, according to the preset data acquisition cycle and preset positional relationship conditions, whether there is still edge data outside the modified initial data frame range that meets the preset positional relationship conditions. When it is determined that there is no corresponding target data, the modification of the initial data frame range and the corresponding new data saved to the initial dataset can be stopped.
[0114] In one possible implementation, the server can, based on the target position of the target data in the reference coordinate system, filter out edge data from each edge data within the modified initial data frame that satisfy a preset positional interval condition (e.g., nearest neighbor or smallest positional interval) with the target data; furthermore, when the target data and the obtained edge data satisfy the row and column characteristics between the initial data contained in the initial dataset, it can be determined that the target data outside the modified initial data frame satisfies the preset positional relationship condition with the edge data within the modified initial data frame.
[0115] For example, assuming the initial dataset within the initial data frame is in 2×2 format, containing 4 initial data points, then it can be seen that all 4 initial data points are edge data points. The position coordinates of each edge data point relative to the target data are shown in Table 1:
[0116] Table 1
[0117] Initial data Init.Data1 Init.Data2 Init.Data3 Init.Data4 Edge data Edge.Data1 Edge.Data2 Edge.Data3 Edge.Data4 Position coordinates (0,1) (0,2) (1,1) (1,2)
[0118] Obviously, based on the position coordinates of the four edge data points recorded in the table above, the server can determine the positional interval between each of the four edge data points and the target data. Thus, it can filter out the edge data Edge.Data1 that meets the preset positional interval condition with the target data from the four edge data points, namely, the nearest or smallest positional interval.
[0119] Furthermore, based on the position coordinates of the four edge data relative to the target data in the table above, the server can obtain the row and column characteristics of the initial data contained in the initial dataset, which are continuous rows and columns, that is, there is no gap between two adjacent initial data.
[0120] It should be noted that, for reference Figure 7 As shown, if the target data and the obtained edge data meet any of the following conditions, then it can be determined that the target data and the obtained edge data satisfy the row and column characteristics between the initial data contained in the initial dataset:
[0121] Scenario 1: If the x-coordinate position of the target data is the same as the x-coordinate position of the edge data, and the row spacing between the target data and the edge data meets the preset row spacing condition.
[0122] The above-mentioned identical horizontal coordinate positions indicate that the leftmost regions of the target data and edge data are aligned, and the above-mentioned preset row spacing conditions indicate that the target data and edge data are normal continuous rows, that is, without blank rows or extra intervals.
[0123] Optionally, after the x-coordinate position of the target data is the same as that of the edge data, if the row spacing between the target data and the edge data is 3, while the row spacing of normal continuous rows is 1.5, then it can be known that the row spacing between the target data and the edge data is 3, which is greater than the row spacing of normal continuous rows of 1.5. Therefore, it can be determined that the row spacing between the target data and the edge data meets the preset row spacing condition.
[0124] Scenario 2: If the vertical coordinate position of the target data is the same as that of the edge data, and the column spacing between the target data and the edge data meets the preset column spacing condition.
[0125] The above-mentioned identical vertical coordinate positions indicate that the top regions of the target data and edge data are aligned, and the above-mentioned preset column spacing conditions indicate that the target data and edge data are normal continuous columns, with at most a distance difference of a single character.
[0126] Optionally, after the vertical coordinate position of the target data is the same as that of the edge data, if the column spacing between the target data and the edge data is 2 characters, while the column spacing of normal consecutive columns is 0 or 1 character, then it can be known that the column spacing of 2 between the target data and the edge data is greater than the column spacing of 0 or 1 of normal consecutive rows. Therefore, it can be determined that the column spacing between the target data and the edge data meets the preset column spacing condition.
[0127] Based on the above method and steps for modifying the initial data frame range, the server can... Figure 4 Within the core area, the corresponding generalization area is obtained, and then a generalization alignment operation is performed. That is, after identifying the main element content (i.e., the initial dataset) in the core area, the region is generalized according to the row and column characteristics of the element content (i.e., the initial dataset) to obtain other element content (i.e., the new data) associated with the target data name KEY.
[0128] Therefore, in this embodiment of the application, the modified initial data frame is a soft and hard area structure of "core area + generalization area", which can effectively locate the element content within the core area and generalize to identify the element content outside the core area (i.e., the generalization area), and is not easily affected by other field information (other data names and their corresponding data).
[0129] See Figure 8 As shown, this is a schematic diagram of a specific application scenario for identifying elements outside the core area provided by an embodiment of this application. For the Span outside the core area, the server will generalize the core area range based on the row and column feature constraints of generalization alignment, that is, modify the initial data frame range. It should be noted that this step is executed cyclically. In the first round of traversing and judging all Spans outside the core area, the VALUE in box ① will be matched first according to the row and column features. Then, in the second round of traversing and judging the Spans outside the generalized area in the first round, it will be found that the VALUE in box ② satisfies the row and column features with the VALUE in the generalized area in the first round and is included. This process is repeated until no new Span is included. It should be noted that each Span records the corresponding VALUE.
[0130] Specifically, each time the server modifies the initial data frame, it needs to obtain at least one new data point within the modified initial data frame and save at least one new data point to the initial dataset. Optionally, during the process of saving at least one new data point to the initial dataset, the server needs to perform an operation for each new data point: based on the data type of the new data, determine the data correlation between the new data and the target data name; furthermore, if the data correlation meets the preset data correlation condition, the new data is saved to the initial dataset; otherwise, if the data correlation does not meet the preset data correlation condition, the new data cannot be saved to the initial dataset.
[0131] Clearly, by performing a judgment operation on whether the new data can be saved to the initial dataset when saving the new data to the initial dataset, the problem of some of the new data (also known as "candidate features") obtained by generalization alignment being other irrelevant content is effectively avoided.
[0132] Furthermore, since some newly added data may be other irrelevant content, the largest proportion of which is the predefined other data name (i.e., field KEY), field validation is required to complete the merging of element content, that is, to save the newly added data to the initial data set. Therefore, it is possible to exclude other data name KEYs. In special cases, the presentation of field value VALUE can also be judged. For example, the VALUE of "insurance amount" should not include the VALUE of company name and address information.
[0133] In summary, the image recognition methods described above can greatly improve the accuracy of image recognition. For ease of understanding, this paper will illustrate this with the following three specific application scenarios:
[0134] See Figure 9A As shown, it is a schematic diagram of a specific application scenario of an image recognition method provided in this application embodiment. The server can generalize the predefined core area range into the corresponding generalization area, thereby effectively avoiding the problem of element area changes caused by multiple line switching during the image recognition process.
[0135] See Figure 9B As shown, it is a schematic diagram of a specific application scenario of an image recognition method provided in this application embodiment. The server can identify the correct element content according to the definition of the core area and the principle of retaining core elements, thereby avoiding the problem that the element value is not completely within the predefined core area in the post-printing offset scenario.
[0136] See Figure 9CAs shown, this is a schematic diagram of a specific application scenario of an image recognition method provided in this application embodiment. The server determines that there are 5 rows of element values in the image, while the preset core area has 3 rows. It can be seen that there are some element values outside the core area. Therefore, element value alignment and regional generalization can be performed on the element values outside the core area. Finally, based on element verification, no KEY needs to be excluded, and the element values contained in the entire core area and the generalized area are taken as the element values corresponding to the "survey agent KEY".
[0137] Based on the above image recognition method steps, please refer to Figure 10 As shown, this is a logical schematic diagram of an image recognition method provided in an embodiment of this application. After the server obtains the image to be recognized, Identi.Image, it can perform image recognition on the image to be recognized, Identi.Image, to obtain the name position information Name.Loc.Infor of the target data name Targ.Data.Name contained in the image to be recognized, in the reference coordinate system. Then, based on the name position information Name.Loc.Infor, the initial data frame range Init.Data.Fra.Range corresponding to the target data name Targ.Data.Name is determined, and the initial dataset Init.Dataset within the initial data frame range Init.Data.Fra.Range is obtained. Further, according to a preset data acquisition period (e.g., 1 second), the initial data frame range Init.Data.Fra.Range is processed. The modification of Data.Fra.Range continues until there is no edge data Edge.Data outside the modified initial data frame Tar.Data.Fra.Range, satisfying the preset positional relationship condition Loc.Rel.Co for target data Tar.Data.Fra.Range. Each time the initial data frame Init.Data.Fra.Range is modified, the following operations are performed: At least one new data point (e.g., New.Data1, New.Data2, and New.Data3) is retrieved from the modified initial data frame Tar.Data.Fra.Range, and at least one new data point (New.Data1, New.Data2, and New.Data3) is saved to the initial dataset Init.Dataset.
[0138] It should be noted that, for each image type corresponding to a template, each data type name in each image type only needs to define the corresponding initial data bounding range, which is easy to configure and maintain. Furthermore, since the initial data bounding range is generally the area where the corresponding data most frequently appears, the range is small and the boundaries are clear, with less interference from other data, and the data content corresponding to the corresponding data name can be accurately identified. In addition, no annotation is required, the configuration is convenient, there is little interference, and the requirements for hardware and development resources are small.
[0139] In summary, the image recognition method provided in this application embodiment involves acquiring an image to be recognized and performing image recognition on the image to obtain the name location information of the target data name contained in the image to be recognized in the reference coordinate system; then, based on the name location information, determining the initial data frame range corresponding to the target data name, and obtaining the initial dataset within the initial data frame range; wherein, the initial data frame range is used to indicate: the actual position of each initial data in the initial dataset in the reference coordinate system; further, the initial data frame range is modified according to a preset data acquisition cycle until there is no edge data outside the modified initial data frame range that meets the preset positional relationship condition for target data; wherein, each time the initial data frame range is modified, the following operations are performed: acquiring at least one new data within the modified initial data frame range, and saving at least one new data to the initial dataset.
[0140] This approach, based on name and location information, determines the initial data frame range corresponding to the target data name and obtains the initial dataset within the initial data frame range. Then, according to a preset data acquisition cycle, the initial data frame range is modified until there is no edge data outside the modified initial data frame range that satisfies the preset positional relationship conditions for the target data. This avoids the technical drawback of existing technologies where the data frame range cannot completely contain the data (i.e., the fixed data frame range is smaller than the data display range), leading to incomplete data acquisition. Therefore, it improves the accuracy of image recognition.
[0141] Furthermore, based on the same technical concept, embodiments of this application provide an image recognition device for implementing the above-described method flow of embodiments of this application. See also... Figure 11 As shown, the image recognition device includes: an acquisition module 1101, a determination module 1102, and a modification module 1103, wherein:
[0142] The acquisition module 1101 is used to acquire the image to be identified and perform image recognition on the image to be identified to obtain the name and position information of the target data name contained in the image to be identified in the reference coordinate system.
[0143] The determination module 1102 is used to determine the initial data frame range corresponding to the target data name based on the name location information, and to obtain the initial dataset within the initial data frame range; wherein, the initial data frame range is used to indicate: the actual position of each initial data in the initial dataset in the reference coordinate system;
[0144] Modification module 1103 is used to modify the initial data frame range according to a preset data acquisition cycle until there is no edge data outside the modified initial data frame range that meets the preset positional relationship conditions for target data; wherein, each time the initial data frame range is modified, the following operations are performed:
[0145] Retrieve at least one new data point within the modified initial data frame and save at least one new data point to the initial dataset.
[0146] In one possible embodiment, when determining the initial data frame range corresponding to the target data name based on name location information, the determining module 1102 is specifically used for:
[0147] From the preset set of candidate data frame templates, select the target data frame template that matches the name type of the target data name; wherein, the target data frame template is used to indicate the display area corresponding to each data that is associated with the target data name and meets the preset data display conditions;
[0148] Based on the name location information, the target data framing template is adjusted to obtain the adjusted target data framing template;
[0149] Based on the template position information of the adjusted target data frame template, the initial data frame range is determined.
[0150] In one possible embodiment, during the process of obtaining the initial dataset within the initial data frame, the determining module 1102 is further configured to:
[0151] If there is boundary data on the boundary of the initial data frame, then obtain the data display range of the boundary data in the reference coordinate system, and obtain the overlapping area between the data display range and the initial data frame.
[0152] Based on the data display range and overlapping area, the degree of overlap between the data display range and the initial data frame range is obtained;
[0153] When the overlap of the ranges exceeds the preset overlap threshold, the boundary data is saved to the initial dataset.
[0154] In one possible embodiment, if the following condition is met, the target data outside the modified initial data frame is determined to satisfy a positional relationship condition with the edge data of the modified initial data frame:
[0155] Based on the target position of the target data in the reference coordinate system, edge data that meets the preset positional interval conditions with the target data are selected from each edge data of the modified initial data frame range.
[0156] The target data and the obtained marginal data satisfy the row and column characteristics between the initial data contained in the initial dataset.
[0157] In one possible embodiment, when the target data and the obtained edge data satisfy the row and column characteristics between the initial data contained in the initial dataset, the modification module 1103 is specifically used for:
[0158] If the x-coordinate position of the target data is the same as the x-coordinate position of the edge data, and the row spacing between the target data and the edge data meets the preset row spacing condition, then the target data and the edge data are determined to meet the row and column characteristics.
[0159] If the vertical coordinate of the target data is the same as that of the edge data, and the column spacing between the target data and the edge data meets the preset column spacing condition, then the target data and the edge data are determined to satisfy the row and column characteristics.
[0160] In one possible embodiment, during the process of saving at least one new data set to the initial dataset, the modification module 1103 is further configured to:
[0161] For at least one new piece of data, perform the following operations respectively:
[0162] Based on the data type of a newly added data, determine the data correlation between the newly added data and the target data name;
[0163] If the data correlation meets the preset data correlation conditions, then a new data entry will be saved to the initial dataset.
[0164] Based on the same technical concept, embodiments of this application also provide an electronic device that can implement the image recognition method flow provided in the above embodiments of this application. In one embodiment, the electronic device may be a server, a terminal device, or other electronic equipment. Figure 12 As shown, the electronic device may include:
[0165] At least one processor 1201 and a memory 1202 connected to at least one processor 1201. In this embodiment, the specific connection medium between the processor 1201 and the memory 1202 is not limited. Figure 12 The example shown is the connection between processor 1201 and memory 1202 via bus 1200. Bus 1200 is... Figure 12 The connections between other components are shown in thick lines only and are not intended to be limiting. The Bus 1200 can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 12 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 1201 can also be called a controller; there is no restriction on the name.
[0166] In this embodiment, the memory 1202 stores instructions executable by at least one processor 1201. By executing the instructions stored in the memory 1202, the at least one processor 1201 can perform an image recognition method as described above. The processor 1201 can implement... Figure 11 The functions of each module in the device shown.
[0167] The processor 1201 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 1202 and calling data stored in memory 1202, the processor can perform various functions and process data, thereby monitoring the device as a whole.
[0168] In one possible design, processor 1201 may include one or more processing units. Processor 1201 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 1201. In some embodiments, processor 1201 and memory 1202 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0169] The processor 1201 can be a general-purpose processor, such as a CPU, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of an image recognition method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0170] Memory 1202, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 1202 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 1202 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 1202 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0171] By designing and programming the processor 1201, the code corresponding to the image recognition method described in the foregoing embodiments can be embedded into the chip, thereby enabling the chip to execute the code during operation. Figure 3 The illustrated embodiment presents the steps of an image recognition method. How to design and program the processor 1201 is a technique well-known to those skilled in the art and will not be described further here.
[0172] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform an image recognition method as described above.
[0173] In some possible implementations, this application also provides that various aspects of an image recognition method can be implemented as a program product including program code, which, when the program product is run on a device, causes the control device to perform the steps of an image recognition method according to various exemplary embodiments of this application as described above.
[0174] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0175] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0176] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, 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-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0177] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a server, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0178] Program code for performing the operations of this application can be written using any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0179] In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0180] These computer program instructions may also 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 instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0181] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0182] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An image recognition method, characterized in that, include: Acquire the image to be identified, and perform image recognition on the image to be identified to obtain the name and position information of the target data name contained in the image to be identified in the reference coordinate system; Based on the name location information, the initial data frame range corresponding to the target data name is determined. If there is boundary data on the boundary of the initial data frame range, the data display range of the boundary data in the reference coordinate system is obtained, and the overlapping area between the data display range and the initial data frame range is obtained. The initial data frame range is used to indicate the actual position of each initial data in the initial dataset in the reference coordinate system. Based on the data display range and the overlapping area, the degree of overlap between the data display range and the initial data frame range is obtained; When the overlap of the ranges is greater than a preset overlap threshold, the boundary data is saved to the initial dataset; According to a preset data acquisition cycle, the initial data frame range is modified until there is no target data outside the modified initial data frame range that satisfies the preset positional relationship condition. Specifically, satisfying the preset positional relationship condition involves: based on the target position of the target data in the reference coordinate system, selecting edge data from the edge data of the modified initial data frame range that satisfies the preset positional interval condition. If the horizontal coordinate position of the target data and the edge data are the same, and the row spacing between the target data and the edge data satisfies the preset row spacing condition, then the target data and the edge data satisfy the row-column characteristic. If the vertical coordinate position of the target data and the edge data are the same, and the column spacing between the target data and the edge data satisfies the preset column spacing condition, then the target data and the edge data satisfy the row-column characteristic. Each time the initial data frame range is modified, the following operations are performed: Obtain at least one new data point within the modified initial data frame and save the at least one new data point to the initial dataset.
2. The method as described in claim 1, characterized in that, The step of determining the initial data frame range corresponding to the target data name based on the name location information includes: From a preset set of candidate data frame templates, a target data frame template that matches the name type of the target data name is selected; wherein, the target data frame template is used to indicate the display area corresponding to each piece of data that is associated with the target data name and meets the preset data display conditions; Based on the name location information, the target data frame template is adjusted to obtain the adjusted target data frame template; Based on the template position information of the adjusted target data framing template, the initial data framing range is determined.
3. The method according to any one of claims 1-2, characterized in that, The process of saving the at least one new data to the initial dataset also includes: For each of the at least one new data entry, perform the following operations: Based on the data type of a newly added data, determine the data correlation degree between the newly added data and the target data name; If the data correlation degree meets the preset data correlation degree condition, then the newly added data will be saved to the initial dataset.
4. An image recognition device, characterized in that, include: The acquisition module is used to acquire the image to be identified and perform image recognition on the image to be identified to obtain the name and position information of the target data name contained in the image to be identified in the reference coordinate system. The determination module is used to determine the initial data frame range corresponding to the target data name based on the name location information. If there is boundary data on the boundary of the initial data frame range, the data display range of the boundary data in the reference coordinate system is obtained, and the overlapping area of the data display range and the initial data frame range is obtained. Based on the data display range and the overlapping area, the overlap degree between the data display range and the initial data frame range is obtained; when the overlap degree is greater than a preset overlap threshold, the boundary data is saved to the initial dataset; wherein, the initial data frame range is used to indicate: the actual position of each initial data in the initial dataset in the reference coordinate system; The modification module is used to modify the initial data frame range according to a preset data acquisition cycle until there is no target data outside the modified initial data frame range that meets the preset positional relationship conditions. Specifically, meeting the preset positional relationship conditions involves: based on the target position of the target data in the reference coordinate system, selecting edge data from the edge data of the modified initial data frame range that meets the preset positional interval conditions. If the horizontal coordinate position of the target data and the edge data are the same, and the row spacing between the target data and the edge data meets the preset row spacing condition, then the target data and the edge data satisfy row-column characteristics. If the vertical coordinate position of the target data and the edge data are the same, and the column spacing between the target data and the edge data meets the preset column spacing condition, then the target data and the edge data satisfy row-column characteristics. Each time the initial data frame range is modified, the following operations are performed: Obtain at least one new data point within the modified initial data frame and save the at least one new data point to the initial dataset.
5. The apparatus as described in claim 4, characterized in that, When determining the initial data frame range corresponding to the target data name based on the name location information, the determining module is specifically used for: From a preset set of candidate data frame templates, a target data frame template that matches the name type of the target data name is selected; wherein, the target data frame template is used to indicate the display area corresponding to each piece of data that is associated with the target data name and meets the preset data display conditions; Based on the name location information, the target data frame template is adjusted to obtain the adjusted target data frame template; Based on the template position information of the adjusted target data framing template, the initial data framing range is determined.
6. The apparatus as described in any one of claims 4-5, characterized in that, During the process of saving the at least one new data to the initial dataset, the modification module is further configured to: For each of the at least one new data entry, perform the following operations: Based on the data type of a newly added data, determine the data correlation degree between the newly added data and the target data name; If the data correlation degree meets the preset data correlation degree condition, then the newly added data will be saved to the initial dataset.
7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-3.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-3.
9. A computer program product, characterized in that, When the computer program product is invoked by a computer, it causes the computer to perform the method as described in any one of claims 1-3.