Method and apparatus for extracting key-value information of a table in a text image

By generating the MAP graph of the table key-value and determining the optimal subordinate relationship, the complexity and low accuracy of extracting table key-value information in the prior art are solved, and automated and robust table information extraction is achieved.

CN114495144BActive Publication Date: 2025-08-01新奥新智科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111599279.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2025-08-01
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

In the prior art, when extracting table key-value information in text images based on templates and rules, the operation is complex, poor robustness, low applicability and low accuracy.

Method used

The MAP graph of table key-value is generated based on statistical machine learning, and the optimal key-value affiliation relationship is determined through dynamic optimization. The table key-value information is automatically extracted in combination with image processing technology and statistical machine learning methods to avoid relying on templates and rules hard coding.

Benefits of technology

It realizes simple operations without cumbersome rules or thresholds, improves the applicability and accuracy of extraction, and enhances robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114495144B_ABST
    Figure CN114495144B_ABST
Patent Text Reader

Abstract

This application relates to the field of image processing technology, and particularly to a method and device for extracting table key-value information in a text image. The method includes: identifying the position information of table cells in the text image; constructing cell features based on the position information and content information of the table cells, and obtaining the MAP graph of key-value using a machine learning classification algorithm; expanding each table cell into a one-dimensional link using the MAP graph of key-value, constructing dynamic programming, obtaining the optimal key-value subordination relationship path, and obtaining the table key-value information based on the optimal key-value subordination relationship path. Thus, it solves the problems in the related art that when extracting key-value information based on templates and rules, it usually requires setting cumbersome rules or thresholds, the operation is complex, the robustness is poor, the applicability is poor, and the extraction accuracy is low, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and particularly to a method and device for extracting table key-value information in text images. Background Art

[0002] As a part of documents, tables are simple and easy to use, and are commonly used effective information presentation methods in daily work. The table contains rich key-value pair information. Extracting the table key-value information essentially broadens the dimension of obtaining unstructured information, and has a huge promoting effect on natural language processing, data mining, semantic analysis, etc. Therefore, how to extract table information in image text has become the focus of people's attention.

[0003] In related technologies, table information in text images is usually extracted based on templates and rules; specifically: a table template is pre-made, and then the text image to be recognized is uploaded, and hard coding is performed with the help of OCR (optical character recognition) to obtain the table key-value information of the text image.

[0004] However, extracting key-value information based on templates and rules in related technologies requires relying on rule hard coding, usually requires setting cumbersome rules or thresholds, resulting in complex operations, poor robustness, poor template generality, resulting in poor extraction applicability, and low accuracy of information extraction. Summary of the Invention

[0005] This application provides a method, device, electronic device and storage medium for extracting table key-value information in text images to solve the problems in related technologies that extracting key-value information based on templates and rules usually requires setting cumbersome rules or thresholds, has complex operations, poor robustness, poor applicability and low extraction accuracy.

[0006] The first aspect embodiment of this application provides a method for extracting table key-value information in text images, including the following steps: identifying the position information of table cells in the text image; constructing cell features according to the table cell position information and cell content information, and obtaining the MAP graph of key-value using a machine learning classification algorithm; expanding each table cell into a one-dimensional link using the MAP graph of key-value, and constructing dynamic programming to obtain the optimal key-value subordination relationship path, and obtaining the table key-value information based on the optimal key-value subordination relationship path.

[0007] Further, before identifying the position information of table cells in the text image, it includes: transforming the text image into the Fourier spectrum space by using the fast Fourier transform of the two-dimensional image to obtain a spectrum image; performing Hough line extraction on the spectrum image to obtain the angle information of the lines in the spectrum, and using the angle information to correct the tilt of the picture.

[0008] Further, the identifying the position information of table cells in the text image includes: performing gray processing on the text image, and performing dilation and erosion on the binary image based on horizontal and vertical convolution operators to obtain a binary image; obtaining the outer frame information of the table through the image connected regions of the binary image to determine the horizontal and vertical lines in the table; obtaining the corner coordinates of the table based on the intersection points of the horizontal and vertical lines in the table, arranging the corner coordinates according to a preset rule to obtain the sorted corner coordinates, and obtaining the position information of the table cells.

[0009] Further, the obtaining the table key-value information based on the optimal key-value subordinate relationship path includes: decoding the optimal key-value subordinate relationship path to obtain the table key-value information.

[0010] An embodiment of the second aspect of the present application provides an extraction device for table key-value information in a text image, including: an identification module for identifying the position information of table cells in the text image; a construction module for constructing cell features according to the position information of the table cells and the cell content information, and obtaining a MAP graph of key-value by using a machine learning classification algorithm; an acquisition module for expanding each table cell into a one-dimensional link by using the MAP graph of key-value, constructing dynamic programming, obtaining an optimal key-value subordinate relationship path, and obtaining the table key-value information based on the optimal key-value subordinate relationship path.

[0011] Further, it further includes: a correction module for, before identifying the position information of table cells in the text image, transforming the text image into the Fourier spectrum space by using the fast Fourier transform of the two-dimensional image to obtain a spectrum image, performing Hough line extraction on the spectrum image to obtain the angle information of the lines in the spectrum, and using the angle information to correct the tilt of the picture.

[0012] Further, the recognition module is used to perform grayscale processing on the text image, and based on horizontal and vertical convolution operators, perform dilation and erosion on the binary image to obtain a binary image; obtain the table outer frame information through the image connected regions of the binary image, and determine the horizontal and vertical lines in the table; obtain the table corner point coordinates based on the intersection points of the horizontal and vertical lines in the table, and arrange the corner point coordinates according to a preset rule to obtain the sorted corner point coordinates, and obtain the table cell position information.

[0013] Further, the obtaining module is used to decode the optimal key-value subordination relationship path to obtain the table key-value information.

[0014] An embodiment of the third aspect of the present application provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the program to implement the method for extracting table key-value information in the text image as described in the above embodiment.

[0015] An embodiment of the fourth aspect of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the method for extracting table key-value information in the text image as described in the above embodiment.

[0016] Thus, the present application has at least the following beneficial effects:

[0017] Generate a MAP graph of table key-value based on statistical machine learning, and determine the optimal key-value subordination relationship based on dynamic optimization, so that the table key-value information in the text image can be automatically extracted by combining image processing technology and statistical machine learning methods, without relying on templates and without rule hard coding, with simple operation and strong robustness, effectively improving the applicability and accuracy of extraction. It solves the problems in the related art that when extracting key-value information based on templates and rules, it usually requires setting cumbersome rules or thresholds, with complex operation, poor robustness, poor applicability, and low extraction accuracy.

[0018] The additional aspects and advantages of the present application will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and / or additional aspects and advantages of the present application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0020] Figure 1It is a schematic flowchart of a method for extracting table key-value information in a text image provided according to an embodiment of the present application;

[0021] Figure 2 It is a schematic flowchart of a method for extracting table key-value information in a text image provided according to an embodiment of the present application;

[0022] Figure 3 It is an example diagram of a key-value subordination relationship path provided according to an embodiment of the present application;

[0023] Figure 4 It is an example diagram of an apparatus for extracting table key-value information in a text image provided according to an embodiment of the present application;

[0024] Figure 5 It is a block diagram of an electronic device provided according to an embodiment of the present application. Detailed Description of the Embodiment

[0025] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present application and should not be construed as limiting the present application.

[0026] Currently, document scans or text images frequently appear in government administrative approval, enterprise office work, and personal work and study. In many scenarios, it is necessary to obtain the key-value pair information of the tables in the text images, such as intelligent review of materials in government affairs, RPA (Robotic process automation) tools, and document difference comparison. With the acceleration of the social digitalization process, the extraction of table information in text images becomes particularly important.

[0027] In related technologies, the extraction of key-value information is usually carried out by means of "image processing + rule hard coding", "image processing + deep learning + rule hard coding", and "deep learning + rule hard coding". However, the above methods usually rely on rule hard coding and often need to set different thresholds in each link of program processing, resulting in poor robustness and universality of the methods; although the above methods can extract table cell character information or table topological structure information for table reconstruction in other business scenarios, they do not involve the direct extraction of table key-value semantic key-value pairs. Therefore, the embodiments of the present application provide a fully automatic method for extracting table key-value in text images to solve the above problems.

[0028] The method, apparatus, electronic device, and storage medium for extracting table key-value information from text images according to embodiments of the present application will be described below with reference to the accompanying drawings. In view of the problems in the related art of extracting key-value information based on templates and rules mentioned in the above background art, which usually require setting cumbersome rules or thresholds, are complex to operate, have poor robustness, poor applicability, and low extraction accuracy, the present application provides a method for extracting table key-value information from text images. In this method, a MAP graph of table key-value is generated based on statistical machine learning, and the optimal key-value subordination relationship is determined based on dynamic optimization, so that the key-value information of the text image table can be automatically extracted by combining image processing technology and statistical machine learning methods, without relying on templates and without rule hard coding, with simple operation and strong robustness, effectively improving the applicability and accuracy of extraction. It solves the problems in the related art of extracting key-value information based on templates and rules, which usually require setting cumbersome rules or thresholds, are complex to operate, have poor robustness, poor applicability, and low extraction accuracy, etc.

[0029] Specifically, Figure 1 FIG. is a schematic flowchart of a method for extracting table key-value information from text images provided by an embodiment of the present application.

[0030] As Figure 1 shown, the method for extracting table key-value information from text images includes the following steps:

[0031] In step S101, identify the position information of table cells in the text image.

[0032] It should be noted that the text image is text in image format, which converts paper text, etc. into text in image format for users' electronic reading; among them, the text image can be stored electronically in various media, networks, etc., and users can obtain, carry, and read it conveniently and quickly.

[0033] In this embodiment, identifying the position information of table cells in the text image includes: performing grayscale processing on the text image, and performing dilation and erosion on the binary image based on horizontal and vertical convolution operators to obtain a binary image; obtaining the table outer frame information through the image connected regions of the binary image, and determining the horizontal and vertical lines in the table; obtaining the corner coordinates of the table based on the intersection points of the horizontal and vertical lines in the table, and arranging the corner coordinates according to a preset rule to obtain the sorted corner coordinates, and obtaining the position information of the table cells.

[0034] Among them, the preset rule can be specifically set according to actual arrangement requirements, and no specific limitation is made here.

[0035] It can be understood that, asFigure 2 As shown, the embodiment of the present application can perform table detection and segmentation processing on the text image, and obtain the table cell position information after processing.

[0036] Specifically, (1) table detection includes: grayscale processing of text images, designing horizontal and vertical convolution operators, dilating and corroding the binary image to obtain a binary image, and obtaining the table frame information through the image connected domain, thereby realizing table positioning.

[0037] (2) Table segmentation includes: identifying the horizontal and vertical lines in the detected table, obtaining the coordinates of the table corners through the intersection of the horizontal straight line graph and the vertical straight line graph, arranging the corner coordinates according to preset rules to obtain sorted corner coordinates; combining the corner points and establishing rules to finally obtain the table cell position information.

[0038] In this embodiment, before identifying the position information of table cells in a text image, the following steps are performed: using a two-dimensional fast Fourier transform to convert the text image into a Fourier spectrum space to obtain a spectrum image; performing Hough line extraction on the spectrum image to obtain the angle information of the line in the spectrum, and using the angle information to perform tilt correction on the image.

[0039] It is understandable that if Figure 2 As shown, before identifying the table cell position information in the text image, the embodiment of the present application can first perform tilt correction on the text image.

[0040] In step S102, cell features are constructed according to the table cell position information and cell content information, and a key-value MAP is obtained using a machine learning classification algorithm.

[0041] Among them, the key-value MAP diagram is the key-value mapping diagram.

[0042] Among them, the machine learning classification algorithm can be an algorithm with classification function such as SVM, RF, Adaboost, LR, etc.; and for the cell feature construction, other column information dimensions can be added, such as cross-row information of cells.

[0043] It is understandable that if Figure 2 As shown, the embodiment of the present application can further obtain table cell feature information after segmenting the table, and generate a table key-value MAP diagram based on statistical machine learning.

[0044] Specifically, (1) obtain the characteristic information of the table cell

[0045] First, the embodiment of the present application can number each obtained table cell, as shown in Table 1:

[0046] Table 1

[0047] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

[0048] Secondly, the embodiments of the present application can construct cell features by combining the position information and cell content information of table cells with domain knowledge, as shown in Table 2:

[0049] Table 2

[0050] Cell No semantic_sim up_cell down_cell left_cell right_cell label 1 0.98 0 3 0 3 key 2 0.72 0 3 1 2 key 3 0.99 0 3 2 1 value 4 0.87 0 3 3 0 key ......

[0051] (2) Obtain the MAP graph of key-value

[0052] The embodiments of the present application can use a machine learning classification algorithm (such as SVM) to obtain the MAP of key-value as shown in Table 3.

[0053] Table 3

[0054] key key key key value value value value value value value value value value value value

[0055] In step S103, each table cell is expanded into a one-dimensional link using the MAP graph of key-value, and dynamic programming is constructed to obtain the optimal key-value subordination relationship path. Based on the optimal key-value subordination relationship path, the table key-value information is obtained.

[0056] It can be understood that as Figure 2 shown, after obtaining the MAP graph of key-value, the embodiments of the present application can determine the optimal key-value subordination relationship based on dynamic optimization. Among them, the embodiments of the present application can use other optimization algorithms to calculate the key-value subordination relationship, which is not specifically limited herein.

[0057] In this embodiment, obtaining the table key-value information based on the optimal key-value subordination relationship path includes: decoding the optimal key-value subordination relationship path to obtain the table key-value information.

[0058] Specifically, as Figure 3 shown, obtaining the key and value subordination relationship using the MAP graph of key-value includes: expanding each table cell into a one-dimensional link, constructing dynamic programming, obtaining the optimal key-value subordination relationship path, and the table key-value information can be obtained by decoding the optimal key-value relationship path.

[0059] In summary, compared with the template-based table key-value extraction or semi-automatic table key-value extraction methods in the related art, the method of the embodiment of the present application directly focuses on the fully automatic key-value extraction of text image tables. Specifically: by fusing the semantic information, spatial location information, and knowledge information of the table cells, the key-value semantic key-value pair information of the table is obtained. Among them, the fusion process includes two extraction stages: First, extract the MAP graph of the table key-value; Second, obtain the belonging relationship between the key and the value from the MAP graph of the key-value; and both extraction stages utilize statistical algorithms or dynamic programming, so that there is no need to set cumbersome rules or thresholds, and it has strong universality, robustness, and high accuracy.

[0060] According to the method for extracting table key-value information in a text image proposed by an embodiment of the present application, a MAP graph of the table key-value is generated based on statistical machine learning, and the optimal key-value subordination relationship is determined based on dynamic optimization, so that the key-value information of the text image table can be automatically extracted by combining image processing technology and statistical machine learning methods, without relying on templates and without rule hard coding, with simple operation and strong robustness, effectively improving the applicability and accuracy of extraction.

[0061] Next, a device for extracting table key-value information in a text image proposed by an embodiment of the present application will be described with reference to the accompanying drawings.

[0062] Figure 4 It is a block diagram of a device for extracting table key-value information in a text image according to an embodiment of the present application.

[0063] As Figure 4 shown, the device 10 for extracting table key-value information in the text image includes: an identification module 100, a construction module 200, and an acquisition module 300.

[0064] Among them, the identification module 100 is used to identify the position information of the table cells in the text image; the construction module 200 is used to construct cell features according to the position information of the table cells and the cell content information, and obtain the MAP graph of the key-value by using a machine learning classification algorithm; the acquisition module 300 is used to expand each table cell into a one-dimensional link by using the MAP graph of the key-value, construct a dynamic programming, obtain the optimal key-value subordination relationship path, and obtain the table key-value information based on the optimal key-value subordination relationship path.

[0065] Further, the apparatus 10 according to the embodiment of the present application further includes: a calibration module. The calibration module is configured to, before identifying the position information of the table cells in the text image, convert the text image into a Fourier spectrum space by using the fast Fourier transform of the two-dimensional image to obtain a spectrum image, perform Hough line extraction on the spectrum image to obtain the angle information of the lines in the spectrum, and perform skew correction on the image by using the angle information.

[0066] Further, the recognition module 100 is configured to perform grayscale processing on the text image, and perform dilation and erosion on the binary image based on the horizontal and vertical convolution operators to obtain a binary image; obtain the table outer frame information through the image connected domain of the binary image to determine the horizontal and vertical lines in the table; obtain the table corner point coordinates based on the intersection points of the horizontal and vertical lines in the table, and arrange the corner point coordinates according to a preset rule to obtain the sorted corner point coordinates, and obtain the position information of the table cells.

[0067] Further, the obtaining module 300 is configured to decode the optimal key-value dependency path to obtain the table key-value information.

[0068] It should be noted that the foregoing explanation of the method embodiment for extracting the table key-value information in the text image also applies to the apparatus for extracting the table key-value information in the text image of this embodiment, and will not be repeated here.

[0069] The apparatus for extracting the table key-value information in the text image according to the embodiment of the present application generates a MAP graph of the table key-value based on statistical machine learning, and determines the optimal key-value dependency based on dynamic optimization, so that the table key-value information in the text image can be automatically extracted by combining image processing technology and statistical machine learning methods, without relying on templates and without rule hard coding, with simple operation and strong robustness, effectively improving the applicability and accuracy of the extraction.

[0070] Figure 5 The structural schematic diagram of the electronic device provided by the embodiment of the present application. The electronic device may include:

[0071] A memory 501, a processor 502, and a computer program stored on the memory 501 and executable on the processor 502.

[0072] When the processor 502 executes the program, it implements the method for extracting the table key-value information in the text image provided in the foregoing embodiment.

[0073] Further, the electronic device further includes:

[0074] A communication interface 503 for communication between the memory 501 and the processor 502.

[0075] A memory 501 for storing a computer program that can run on the processor 502.

[0076] The memory 501 may include a high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.

[0077] If the memory 501, the processor 502, and the communication interface 503 are implemented independently, the communication interface 503, the memory 501, and the processor 502 can be interconnected through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0078] Optionally, in a specific implementation, if the memory 501, the processor 502, and the communication interface 503 are integrated on a single chip, the memory 501, the processor 502, and the communication interface 503 can communicate with each other through an internal interface.

[0079] The processor 502 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0080] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method for extracting key-value information in the table in the text image as described above is implemented.

[0081] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0082] In addition, the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of this application, the meaning of "N" is at least two, such as two, three, etc., unless otherwise specifically defined.

[0083] Any process or method description shown in the flowchart or described in other ways herein can be understood as representing a module, segment, or portion of code including one or more N executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of this application includes additional implementations, where the functions can be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the technical field to which the embodiments of this application belong.

[0084] The logic and / or steps represented in the flowchart or otherwise described herein can, for example, be considered as a definite sequence list of executable instructions for implementing a logical function, which can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection part (electronic device) having one or N wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.

[0085] It should be understood that various parts of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0086] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0087] In addition, each functional unit in various embodiments of the present application may be integrated into a processing module, may exist separately as individual physical units, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0088] The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disc, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A method for extracting table key-value information in a text image, characterized in that Including the following steps: Identifying the position information of table cells in a text image, including performing grayscale processing on the text image, and performing dilation and erosion on the binary image based on horizontal and vertical convolution operators to obtain a binary image; obtaining table outer frame information through the image connectivity domain of the binary image, and determining the horizontal and vertical lines in the table; obtaining table corner coordinates based on the intersection points of the horizontal and vertical lines in the table, and arranging the corner coordinates according to a preset rule to obtain sorted corner coordinates, thereby obtaining the position information of the table cells; Constructing cell features according to the table cell position information and cell content information, and obtaining a MAP graph of key-value using a machine learning classification algorithm; And Using the MAP graph of key-value to expand each table cell into a one-dimensional link, constructing dynamic programming, obtaining an optimal key-value subordination relationship path, and obtaining table key-value information based on the optimal key-value subordination relationship path.

2. The method according to claim 1, characterized in that, Before identifying the position information of table cells in the text image, it includes: Converting the text image to the Fourier spectrum space using the fast Fourier transform of a two-dimensional image to obtain a spectrum image; Performing Hough line extraction on the spectrum image to obtain the angle information of the lines in the spectrum, and using the angle information to correct the tilt of the picture.

3. The method according to claim 1, wherein The obtaining the table key-value information based on the optimal key-value subordination relationship path includes: Decoding the optimal key-value subordination relationship path to obtain the table key-value information.

4. An apparatus for extracting table key-value information in a text image, characterized in that, Including: An identification module for identifying the position information of table cells in a text image, including performing grayscale processing on the text image, and performing dilation and erosion on the binary image based on horizontal and vertical convolution operators to obtain a binary image; obtaining table outer frame information through the image connectivity domain of the binary image, and determining the horizontal and vertical lines in the table; obtaining table corner coordinates based on the intersection points of the horizontal and vertical lines in the table, and arranging the corner coordinates according to a preset rule to obtain sorted corner coordinates, thereby obtaining the position information of the table cells; A construction module for constructing cell features according to the table cell position information and cell content information, and obtaining a MAP graph of key-value using a machine learning classification algorithm; And An obtaining module for using the MAP graph of key-value to expand each table cell into a one-dimensional link, constructing dynamic programming, obtaining an optimal key-value subordination relationship path, and obtaining table key-value information based on the optimal key-value subordination relationship path.

5. The device according to claim 4, characterized in that, It also includes: A correction module, which is used to convert the text image into a Fourier spectrum space by using the fast Fourier transform of the two-dimensional image to obtain a spectrum image before identifying the position information of the table cells in the text image, perform Hough line extraction on the spectrum image to obtain the angle information of the lines in the spectrum, and use the angle information to correct the tilt of the picture.

6. The device according to claim 4, characterized in that, The obtaining module is used to decode the optimal key-value subordinate relationship path to obtain the table key-value information.

7. An electronic device, characterized in that, Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method for extracting table key-value information from a text image according to any one of claims 1-3.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to be used to implement the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Handwriting registration method based on stroke characteristics

    CN103927532A

  • Table picture recognition method and broadcasting method, electronic equipment and storage medium

    CN112949596A